InvAccountExcelMapper.xml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.ydtech.modules.inv.dao.InvAccountExcelMapper">
  6. <resultMap id="BaseResultMap" type="com.ydtech.modules.inv.model.InvAccountExcel">
  7. <id property="excelAccountOperateId" column="excel_account_operate_id" jdbcType="VARCHAR"/>
  8. <result property="company" column="company" jdbcType="VARCHAR"/>
  9. <result property="applicant" column="applicant" jdbcType="VARCHAR"/>
  10. <result property="applyTime" column="apply_time" jdbcType="TIMESTAMP"/>
  11. <result property="applySector" column="apply_sector" jdbcType="VARCHAR"/>
  12. <result property="collectionMessage" column="collection_message" jdbcType="VARCHAR"/>
  13. <result property="fundFlow" column="fund_flow" jdbcType="VARCHAR"/>
  14. <result property="fundUse" column="fund_use" jdbcType="VARCHAR"/>
  15. <result property="applyAmount" column="apply_amount" jdbcType="VARCHAR"/>
  16. <result property="bigApplyAmount" column="big_apply_amount" jdbcType="VARCHAR"/>
  17. <result property="uplodePath" column="uplode_path" jdbcType="VARCHAR"/>
  18. <result property="updateBy" column="update_by" jdbcType="VARCHAR"/>
  19. <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
  20. <result property="createBy" column="create_by" jdbcType="VARCHAR"/>
  21. <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
  22. <result property="enterCardNum" column="enter_card_num" jdbcType="VARCHAR"/>
  23. <result property="outCardNum" column="out_card_num" jdbcType="VARCHAR"/>
  24. <result property="transferFlag" column="transfer_flag" jdbcType="CHAR"/>
  25. <result property="outFlag" column="out_flag" jdbcType="CHAR"/>
  26. <result property="outAccountQuality" column="out_account_quality" jdbcType="CHAR"/>
  27. <result property="delFlag" column="del_flag" jdbcType="CHAR"/>
  28. <result property="payMethod" column="pay_method" jdbcType="VARCHAR"/>
  29. <result property="outProfit" column="out_profit" javaType="com.alibaba.fastjson.JSONObject"
  30. typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler"/>
  31. <result property="entProfit" column="ent_profit" javaType="com.alibaba.fastjson.JSONObject"
  32. typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler"/>
  33. <result property="fundFen" column="fund_fen" jdbcType="VARCHAR"/>
  34. <result property="remark" column="remark" jdbcType="VARCHAR"/>
  35. </resultMap>
  36. <sql id="Base_Column_List">
  37. excel_account_operate_id,company,applicant,
  38. apply_time,apply_sector,collection_message,
  39. fund_flow,fund_use,
  40. apply_amount,payout_amount,big_apply_amount,uplode_path,
  41. update_by,update_time,create_by,
  42. create_time,enter_card_num,out_card_num,
  43. del_flag,out_flag,out_account_quality,transfer_flag,pay_method,out_profit,ent_profit,fund_fen,remark
  44. </sql>
  45. <select id="selectExcelAccount" resultMap="BaseResultMap">
  46. select
  47. <include refid="Base_Column_List"/>
  48. from inv_account_excel
  49. where
  50. del_flag = '0'
  51. <if test="insAccountExcel.excelAccountOperateId!= null and insAccountExcel.excelAccountOperateId!= ''">
  52. and excel_account_operate_id = #{insAccountExcel.excelAccountOperateId}
  53. </if>
  54. <if test="insAccountExcel.company!= null and insAccountExcel.company!= ''">
  55. and company like concat('%',#{insAccountExcel.company},'%')
  56. </if>
  57. <if test="insAccountExcel.applicant!= null and insAccountExcel.applicant!= ''">
  58. and applicant = #{insAccountExcel.applicant}
  59. </if>
  60. <if test="insAccountExcel.applyTimeStart!= null">
  61. and apply_time &gt;= #{insAccountExcel.applyTimeStart}
  62. </if>
  63. <if test="insAccountExcel.applyTimeEnd!= null">
  64. and apply_time &lt;= #{insAccountExcel.applyTimeEnd}
  65. </if>
  66. <if test="insAccountExcel.applySector!= null and insAccountExcel.applySector!= ''">
  67. and apply_sector = #{insAccountExcel.applySector}
  68. </if>
  69. <if test="insAccountExcel.collectionMessage!= null and insAccountExcel.collectionMessage!= ''">
  70. and collection_message like concat('%',#{insAccountExcel.collectionMessage},'%')
  71. </if>
  72. <if test="insAccountExcel.fundFlow!= null and insAccountExcel.fundFlow!= ''">
  73. and fund_flow = #{insAccountExcel.fundFlow}
  74. </if>
  75. <if test="insAccountExcel.fundUse!= null and insAccountExcel.fundUse!= ''">
  76. and fund_use = #{insAccountExcel.fundUse}
  77. </if>
  78. <if test="insAccountExcel.applyAmount!= null and insAccountExcel.applyAmount!= ''">
  79. and apply_amount = #{insAccountExcel.applyAmount}
  80. </if>
  81. <if test="insAccountExcel.bigApplyAmount!= null and insAccountExcel.bigApplyAmount!= ''">
  82. and big_apply_amount = #{insAccount}
  83. </if>
  84. <if test="insAccountExcel.uplodePath!= null and insAccountExcel.uplodePath!= ''">
  85. and uplode_path = #{insAccountExcel.uplodePath}
  86. </if>
  87. <if test="insAccountExcel.updateBy!= null and insAccountExcel.updateBy!= ''">
  88. and update_by = #{insAccountExcel.updateBy}
  89. </if>
  90. <if test="insAccountExcel.createBy!= null and insAccountExcel.createBy!= ''">
  91. and create_by = #{insAccountExcel.createBy}
  92. </if>
  93. <if test="insAccountExcel.createTime!= null">
  94. and create_time &gt;= #{insAccountExcel.createTime}
  95. </if>
  96. <if test="insAccountExcel.createTime!= null">
  97. and create_time &lt;= #{insAccountExcel.createTime}
  98. </if>
  99. <if test="insAccountExcel.enterCardNum!= null and insAccountExcel.enterCardNum!= ''">
  100. and enter_card_num = #{insAccountExcel.enterCardNum}
  101. </if>
  102. <if test="insAccountExcel.outCardNum!= null and insAccountExcel.outCardNum!= ''">
  103. and out_card_num = #{insAccountExcel.outCardNum}
  104. </if>
  105. <if test="insAccountExcel.outFlag!= null and insAccountExcel.outFlag!= ''">
  106. and out_flag = #{insAccountExcel.outFlag}
  107. </if>
  108. <if test="insAccountExcel.outAccountQuality!= null and insAccountExcel.outAccountQuality!= ''">
  109. and out_account_quality = #{insAccountExcel.outAccountQuality}
  110. </if>
  111. <if test="insAccountExcel.transferFlag!= null and insAccountExcel.transferFlag!= ''">
  112. and transfer_flag = #{insAccountExcel.transferFlag}
  113. </if>
  114. <if test="insAccountExcel.payMethod!= null and insAccountExcel.payMethod!= ''">
  115. and pay_method = #{insAccountExcel.payMethod}
  116. </if>
  117. order by create_time
  118. desc
  119. </select>
  120. <resultMap id="InvAccountOperateVoResultMap" type="com.ydtech.modules.inv.model.vo.InvAccountOperateVo">
  121. <id property="accountOperateId" column="account_operate_id" jdbcType="VARCHAR"/>
  122. <result property="company" column="company" jdbcType="VARCHAR"/>
  123. <result property="applySector" column="apply_sector" jdbcType="VARCHAR"/>
  124. <result property="collectionMessage" column="collection_message" jdbcType="VARCHAR"/>
  125. <result property="fundUse" column="fund_use" jdbcType="VARCHAR"/>
  126. <result property="applyAmount" column="apply_amount" jdbcType="VARCHAR"/>
  127. <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
  128. <result property="remark" column="remark" jdbcType="VARCHAR"/>
  129. <result property="label" column="label" jdbcType="VARCHAR"/>
  130. </resultMap>
  131. <select id="selectDisburse" resultMap="InvAccountOperateVoResultMap">
  132. SELECT DISTINCT
  133. a.account_operate_id,
  134. DATE_FORMAT(a.create_time, '%Y-%m-%d') as create_date,
  135. a.fund_use,
  136. a.remark,
  137. a.apply_amount,
  138. a.apply_sector,
  139. a.company,
  140. a.collection_message,
  141. a.create_time,
  142. c.label as label
  143. from inv_account_operate a
  144. LEFT JOIN inv_account_expenses b ON a.fund_fen = b.category
  145. Left join sys_dict c on b.expenditure_details = c.value
  146. WHERE
  147. c.itemname = 'cost_type'
  148. AND
  149. a.fund_use != '往来款'
  150. AND collection_message LIKE '外部用户%'
  151. and a.revenue_outlay = '1'
  152. AND a.del_flag = '0'
  153. <if test="inAccountOperateVo.createTimeStart!= null">
  154. and a.create_time &gt;= #{inAccountOperateVo.createTimeStart}
  155. </if>
  156. <if test="inAccountOperateVo.createTimeEnd!= null">
  157. and a.create_time &lt;= #{inAccountOperateVo.createTimeEnd}
  158. </if>
  159. <if test="inAccountOperateVo.applySector!= null and inAccountOperateVo.applySector!= ''">
  160. and a.apply_sector = #{inAccountOperateVo.applySector}
  161. </if>
  162. <if test="inAccountOperateVo.collectionMessage!= null and inAccountOperateVo.collectionMessage!= ''">
  163. and a.collection_message like concat('%',#{inAccountOperateVo.collectionMessage},'%')
  164. </if>
  165. <if test="inAccountOperateVo.company!= null and inAccountOperateVo.company!= ''">
  166. and a.company like concat('%',#{inAccountOperateVo.company},'%')
  167. </if>
  168. <if test="inAccountOperateVo.fundUse!= null and inAccountOperateVo.fundUse!= ''">
  169. and a.fund_use = #{inAccountOperateVo.fundUse}
  170. </if>
  171. <if test="inAccountOperateVo.applyAmount!= null and inAccountOperateVo.applyAmount!= ''">
  172. and a.apply_amount = #{inAccountOperateVo.applyAmount}
  173. </if>
  174. <if test="inAccountOperateVo.label!= null and inAccountOperateVo.label!= ''">
  175. and c.label like concat('%',#{inAccountOperateVo.label},'%')
  176. </if>
  177. order by a.create_time desc
  178. </select>
  179. <select id="queryExpensesDataPage"
  180. resultType="com.ydtech.modules.admin.model.report.financeData.ExpensesDataDto">
  181. SELECT DISTINCT
  182. a.account_operate_id,
  183. DATE_FORMAT(a.create_time, '%Y-%m-%d') as transferAccountsDate,
  184. a.fund_use as costType,
  185. "" as businessSegmentsType,
  186. a.remark as abstracts,
  187. a.apply_amount as amount,
  188. a.apply_sector as deptName,
  189. a.collection_message,
  190. a.create_time
  191. from inv_account_operate a
  192. LEFT JOIN inv_account_expenses b ON a.fund_fen = b.category
  193. WHERE
  194. a.fund_use != '往来款'
  195. AND collection_message LIKE '外部用户%'
  196. and a.revenue_outlay = '1'
  197. AND a.del_flag = '0'
  198. <if test="vo.startDate !=null and vo.startDate != '' and vo.endDate !=null and vo.endDate != '' ">
  199. a.create_time BETWEEN #{vo.startDate} AND #{vo.endDate}
  200. </if>
  201. <if test="vo.costType!= null and vo.costTypee!= ''">
  202. and a.fund_use = #{vo.costType}
  203. </if>
  204. order by a.create_time desc
  205. </select>
  206. </mapper>