ApplyExtendMapper.xml 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.idea.oa.apply.mapper.ApplyExtendMapper">
  4. <!-- <select id="findOffWorkListByInfo" parameterType="java.util.Map" resultType="java.util.Map">-->
  5. <!-- SELECT-->
  6. <!-- t.*,-->
  7. <!-- off.apply_reasons,-->
  8. <!-- time.use_time AS use_time,-->
  9. <!-- time.time_unit,-->
  10. <!-- time.off_work_type,-->
  11. <!-- CASE-->
  12. <!-- time.time_unit-->
  13. <!-- WHEN '天' THEN-->
  14. <!-- concat( date_format( time.start_day, '%Y-%m-%d' ), time.start_time )-->
  15. <!-- WHEN '小时' THEN-->
  16. <!-- date_format( time.start_day, '%Y-%m-%d %H:%i:%S' ) ELSE ''-->
  17. <!-- END AS startTime,-->
  18. <!-- CASE-->
  19. <!-- time.time_unit-->
  20. <!-- WHEN '天' THEN-->
  21. <!-- concat( date_format( time.end_day, '%Y-%m-%d' ), time.end_time )-->
  22. <!-- WHEN '小时' THEN-->
  23. <!-- date_format( time.end_day, '%Y-%m-%d %H:%i:%S' ) ELSE ''-->
  24. <!-- END AS endTime,-->
  25. <!-- time.start_day,-->
  26. <!-- time.start_time,-->
  27. <!-- time.end_day,-->
  28. <!-- time.end_time-->
  29. <!-- FROM-->
  30. <!-- (-->
  31. <!-- SELECT-->
  32. <!-- f.id,-->
  33. <!-- f.form_id,-->
  34. <!-- f.apply_user,-->
  35. <!-- USER.truename,-->
  36. <!-- dept.dept_name,-->
  37. <!-- f.created_at created_at,-->
  38. <!-- f.updated_at,-->
  39. <!-- log.created_at last_update_time,-->
  40. <!-- log.audit_result-->
  41. <!-- FROM-->
  42. <!-- flow_main f-->
  43. <!-- LEFT JOIN frame_user USER ON USER.id = f.apply_user-->
  44. <!-- LEFT JOIN sys_dept dept ON dept.id = USER.department-->
  45. <!-- LEFT JOIN flow_main_log log ON log.id = f.last_main_log_id-->
  46. <!-- WHERE-->
  47. <!-- f.flow_type = 'off_work'-->
  48. <!-- AND f.flow_status = 3-->
  49. <!-- AND log.audit_result = 1-->
  50. <!-- <if test="name != null and name !=''">-->
  51. <!-- AND USER.truename like concat('%',#{name},'%')-->
  52. <!-- </if>-->
  53. <!-- <if test="startTime != null and startTime !=''">-->
  54. <!-- AND f.created_at >= #{startTime}-->
  55. <!-- </if>-->
  56. <!-- <if test="endTime != null and endTime !=''">-->
  57. <!-- AND date_format( f.created_at, '%Y-%m-%d' ) &lt;= #{endTime}-->
  58. <!-- </if>-->
  59. <!-- GROUP BY f.id-->
  60. <!-- ) t-->
  61. <!-- LEFT JOIN apply_off_work off ON off.id = t.form_id-->
  62. <!-- LEFT JOIN apply_off_work_time time ON time.off_work_id = off.id-->
  63. <!-- order by t.created_at desc-->
  64. <!-- </select>-->
  65. <!-- <select id="findApplyPaymentListByInfo" parameterType="java.util.Map" resultType="java.util.Map">-->
  66. <!-- SELECT-->
  67. <!-- out_order_main.pro_name,-->
  68. <!-- out_order_main.order_no,-->
  69. <!-- out_order_main.procure_content as remark,-->
  70. <!-- pay.order_id,-->
  71. <!-- pay.pay_name,-->
  72. <!-- pay.pay_money,-->
  73. <!-- IFNULL(biz_main.business_name,oa_supplier.supplier_name) as biz_name,-->
  74. <!-- out_order_main.pay_type,-->
  75. <!-- pay.bill_number,-->
  76. <!-- pay.bill_rate,-->
  77. <!-- pay.updated_at AS createCardTime,-->
  78. <!-- pay.pay_time,-->
  79. <!-- pay.file_data_ids,-->
  80. <!-- t.*-->
  81. <!-- FROM-->
  82. <!-- (-->
  83. <!-- SELECT-->
  84. <!-- f.flow_status,-->
  85. <!-- f.id,-->
  86. <!-- f.form_id,-->
  87. <!-- f.apply_user,-->
  88. <!-- USER.truename,-->
  89. <!-- dept.dept_name,-->
  90. <!-- f.created_at created_at,-->
  91. <!-- case when f.flow_status=3 then f.updated_at else null end-->
  92. <!-- last_update_time-->
  93. <!-- FROM-->
  94. <!-- flow_main f-->
  95. <!-- left join flow_main_push push on push.flow_main_id=f.id and push.status=0-->
  96. <!-- LEFT JOIN frame_user USER ON USER.id = f.apply_user-->
  97. <!-- LEFT JOIN sys_dept dept ON dept.id = USER.department-->
  98. <!-- WHERE-->
  99. <!-- f.flow_type = 'paymen'-->
  100. <!-- AND (f.flow_status = 3 or (f.flow_status=1 and push.status=0 and push.push_user_key in('flow_cnzf_0_0_1','flow_zffh_0_0_1')))-->
  101. <!-- <if test="startTime != null and startTime !=''">-->
  102. <!-- AND f.created_at >= #{startTime}-->
  103. <!-- </if>-->
  104. <!-- <if test="endTime != null and endTime !=''">-->
  105. <!-- AND date_format( f.created_at, '%Y-%m-%d' ) &lt;= #{endTime}-->
  106. <!-- </if>-->
  107. <!-- GROUP BY f.id-->
  108. <!-- ) t-->
  109. <!-- LEFT JOIN apply_payment pay ON pay.id = t.form_id-->
  110. <!-- LEFT JOIN out_order_main ON out_order_main.id = pay.order_id-->
  111. <!-- left join biz_main on biz_main.id=out_order_main.supplier_id-->
  112. <!-- left join oa_supplier on oa_supplier.id=out_order_main.supplier_id-->
  113. <!-- where 1=1-->
  114. <!-- <if test="name != null and name !=''">-->
  115. <!-- AND out_order_main.pro_name like concat('%',#{name},'%')-->
  116. <!-- </if>-->
  117. <!-- <if test="supplierName != null and supplierName !=''">-->
  118. <!-- AND IFNULL(biz_main.business_name,oa_supplier.supplier_name) like concat('%',#{supplierName},'%')-->
  119. <!-- </if>-->
  120. <!-- order by t.created_at desc-->
  121. <!-- </select>-->
  122. <!-- <select id="findApplyUseMoneyListByInfo" parameterType="com.idea.oa.apply.vo.SplitVo" resultType="java.util.Map">-->
  123. <!-- SELECT-->
  124. <!-- pro.proName,-->
  125. <!-- detail.fee_type,-->
  126. <!-- money.use_reasons,-->
  127. <!-- detail.fee_money,-->
  128. <!-- money.payee_name,-->
  129. <!-- money.bank_name,-->
  130. <!-- money.make_date,-->
  131. <!-- money.pay_time,-->
  132. <!-- money.make_num,-->
  133. <!-- detail.file_data_ids,-->
  134. <!-- detail.file_type,-->
  135. <!-- ifnull(detail.file_number,'') as file_number,-->
  136. <!-- t.*-->
  137. <!-- FROM-->
  138. <!-- (-->
  139. <!-- SELECT-->
  140. <!-- f.flow_status,-->
  141. <!-- f.id,-->
  142. <!-- f.form_id,-->
  143. <!-- f.apply_user,-->
  144. <!-- USER.truename,-->
  145. <!-- dept.dept_name,-->
  146. <!-- f.created_at created_at,-->
  147. <!-- CASE-->
  148. <!-- WHEN f.flow_status = 3 THEN-->
  149. <!-- f.updated_at ELSE NULL-->
  150. <!-- END last_update_time-->
  151. <!-- FROM-->
  152. <!-- flow_main f-->
  153. <!-- left join flow_main_push push on push.flow_main_id=f.id and push.status=0-->
  154. <!-- LEFT JOIN frame_user USER ON USER.id = f.apply_user-->
  155. <!-- LEFT JOIN sys_dept dept ON dept.id = USER.department-->
  156. <!-- WHERE-->
  157. <!-- f.flow_type = 'use_money'-->
  158. <!-- AND (f.flow_status = 3 or (f.flow_status=1 and push.status=0 and push.push_user_key in( 'flow_cnzf_0_0_1-yes', 'flow_zffh_0_0_1-yes@end' )))-->
  159. <!-- <if test="startTime != null and startTime !=''">-->
  160. <!-- AND f.created_at >= #{startTime}-->
  161. <!-- </if>-->
  162. <!-- <if test="endTime != null and endTime !=''">-->
  163. <!-- AND date_format( f.created_at, '%Y-%m-%d' ) &lt;= #{endTime}-->
  164. <!-- </if>-->
  165. <!-- GROUP BY f.id-->
  166. <!-- ) t-->
  167. <!-- LEFT JOIN apply_use_money money ON money.id = t.form_id-->
  168. <!-- LEFT JOIN apply_use_money_detail detail ON money.id = detail.use_money_id-->
  169. <!-- LEFT JOIN pro_main pro ON pro.id = money.pro_id-->
  170. <!-- where 1=1-->
  171. <!-- <if test="name != null and name !=''">-->
  172. <!-- AND pro.proName like concat('%',#{name},'%')-->
  173. <!-- </if>-->
  174. <!-- <if test="payeeName != null and payeeName !=''">-->
  175. <!-- AND money.payee_name like concat('%',#{payeeName},'%')-->
  176. <!-- </if>-->
  177. <!-- <if test="feeType != null and feeType !=''">-->
  178. <!-- AND detail.fee_type like concat('%',#{feeType},'%')-->
  179. <!-- </if>-->
  180. <!-- <if test="flowStatus != null and flowStatus !=''">-->
  181. <!-- AND t.flow_status = #{flowStatus}-->
  182. <!-- </if>-->
  183. <!-- ORDER BY-->
  184. <!-- t.created_at DESC-->
  185. <!-- </select>-->
  186. </mapper>