ItemReleaseV1ServiceDaoImplMapper.xml 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  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="itemReleaseV1ServiceDaoImpl">
  6. <!-- 保存放行管理信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveItemReleaseInfo" parameterType="Map">
  8. insert into item_release(
  9. apply_company,id_card,pass_time,car_num,remark,apply_person,ir_id,apply_tel,type_id,state,community_id
  10. ) values (
  11. #{applyCompany},#{idCard},#{passTime},#{carNum},#{remark},#{applyPerson},#{irId},#{applyTel},#{typeId},#{state},#{communityId}
  12. )
  13. </insert>
  14. <!-- 查询放行管理信息 add by wuxw 2018-07-03 -->
  15. <select id="getItemReleaseInfo" parameterType="Map" resultType="Map">
  16. select t.apply_company,t.apply_company applyCompany,t.id_card,t.id_card idCard,t.pass_time,t.pass_time
  17. passTime,t.car_num,t.car_num carNum,t.remark,t.status_cd,t.status_cd statusCd,t.apply_person,t.apply_person
  18. applyPerson,t.ir_id,t.ir_id irId,t.apply_tel,t.apply_tel applyTel,t.type_id,t.type_id
  19. typeId,t.state,t.community_id,t.community_id communityId,irt.type_name typeName,irt.flow_id flowId,irt.flow_name flowName,
  20. td.name stateName,t.create_time createTime,SUM(irr.amount) amount
  21. from item_release t
  22. LEFT JOIN item_release_type irt on t.type_id = irt.type_id and irt.status_cd = '0' and irt.community_id = t.community_id
  23. left join t_dict td on t.state = td.status_cd and td.table_name = 'item_release' and td.table_columns = 'state'
  24. left join item_release_res irr on t.ir_id = irr.ir_id and t.community_id = irr.community_id and irr.status_cd = '0'
  25. where 1 =1
  26. <if test="applyCompany !=null and applyCompany != ''">
  27. and t.apply_company= #{applyCompany}
  28. </if>
  29. <if test="idCard !=null and idCard != ''">
  30. and t.id_card= #{idCard}
  31. </if>
  32. <if test="passTime !=null and passTime != ''">
  33. and t.pass_time= #{passTime}
  34. </if>
  35. <if test="carNum !=null and carNum != ''">
  36. and t.car_num= #{carNum}
  37. </if>
  38. <if test="remark !=null and remark != ''">
  39. and t.remark= #{remark}
  40. </if>
  41. <if test="statusCd !=null and statusCd != ''">
  42. and t.status_cd= #{statusCd}
  43. </if>
  44. <if test="applyPerson !=null and applyPerson != ''">
  45. and t.apply_person= #{applyPerson}
  46. </if>
  47. <if test="irId !=null and irId != ''">
  48. and t.ir_id= #{irId}
  49. </if>
  50. <if test="irIds !=null ">
  51. and t.ir_id in
  52. <foreach collection="irIds" item="item" open="(" close=")" separator=",">
  53. #{item}
  54. </foreach>
  55. </if>
  56. <if test="applyTel !=null and applyTel != ''">
  57. and t.apply_tel= #{applyTel}
  58. </if>
  59. <if test="typeId !=null and typeId != ''">
  60. and t.type_id= #{typeId}
  61. </if>
  62. <if test="state !=null and state != ''">
  63. and t.state= #{state}
  64. </if>
  65. <if test="communityId !=null and communityId != ''">
  66. and t.community_id= #{communityId}
  67. </if>
  68. group by t.create_time,t.apply_company,t.id_card,t.pass_time,t.car_num,t.remark,t.status_cd,t.apply_person,t.ir_id,t.apply_tel,t.type_id,t.state,t.community_id,irt.type_name,irt.flow_id ,irt.flow_name,
  69. td.name
  70. order by t.create_time desc
  71. <if test="page != -1 and page != null ">
  72. limit #{page}, #{row}
  73. </if>
  74. </select>
  75. <!-- 修改放行管理信息 add by wuxw 2018-07-03 -->
  76. <update id="updateItemReleaseInfo" parameterType="Map">
  77. update item_release t set t.status_cd = #{statusCd}
  78. <if test="amount !=null and amount != ''">
  79. , t.amount= #{amount}
  80. </if>
  81. <if test="applyCompany !=null and applyCompany != ''">
  82. , t.apply_company= #{applyCompany}
  83. </if>
  84. <if test="idCard !=null and idCard != ''">
  85. , t.id_card= #{idCard}
  86. </if>
  87. <if test="passTime !=null and passTime != ''">
  88. , t.pass_time= #{passTime}
  89. </if>
  90. <if test="carNum !=null and carNum != ''">
  91. , t.car_num= #{carNum}
  92. </if>
  93. <if test="remark !=null and remark != ''">
  94. , t.remark= #{remark}
  95. </if>
  96. <if test="applyPerson !=null and applyPerson != ''">
  97. , t.apply_person= #{applyPerson}
  98. </if>
  99. <if test="applyTel !=null and applyTel != ''">
  100. , t.apply_tel= #{applyTel}
  101. </if>
  102. <if test="typeId !=null and typeId != ''">
  103. , t.type_id= #{typeId}
  104. </if>
  105. <if test="state !=null and state != ''">
  106. , t.state= #{state}
  107. </if>
  108. where 1=1
  109. <if test="irId !=null and irId != ''">
  110. and t.ir_id= #{irId}
  111. </if>
  112. <if test="communityId !=null and communityId != ''">
  113. and t.community_id= #{communityId}
  114. </if>
  115. </update>
  116. <!-- 查询放行管理数量 add by wuxw 2018-07-03 -->
  117. <select id="queryItemReleasesCount" parameterType="Map" resultType="Map">
  118. select count(1) count
  119. from item_release t
  120. where 1 =1
  121. <if test="applyCompany !=null and applyCompany != ''">
  122. and t.apply_company= #{applyCompany}
  123. </if>
  124. <if test="idCard !=null and idCard != ''">
  125. and t.id_card= #{idCard}
  126. </if>
  127. <if test="passTime !=null and passTime != ''">
  128. and t.pass_time= #{passTime}
  129. </if>
  130. <if test="carNum !=null and carNum != ''">
  131. and t.car_num= #{carNum}
  132. </if>
  133. <if test="remark !=null and remark != ''">
  134. and t.remark= #{remark}
  135. </if>
  136. <if test="statusCd !=null and statusCd != ''">
  137. and t.status_cd= #{statusCd}
  138. </if>
  139. <if test="applyPerson !=null and applyPerson != ''">
  140. and t.apply_person= #{applyPerson}
  141. </if>
  142. <if test="irId !=null and irId != ''">
  143. and t.ir_id= #{irId}
  144. </if>
  145. <if test="irIds !=null ">
  146. and t.ir_id in
  147. <foreach collection="irIds" item="item" open="(" close=")" separator=",">
  148. #{item}
  149. </foreach>
  150. </if>
  151. <if test="applyTel !=null and applyTel != ''">
  152. and t.apply_tel= #{applyTel}
  153. </if>
  154. <if test="typeId !=null and typeId != ''">
  155. and t.type_id= #{typeId}
  156. </if>
  157. <if test="state !=null and state != ''">
  158. and t.state= #{state}
  159. </if>
  160. <if test="communityId !=null and communityId != ''">
  161. and t.community_id= #{communityId}
  162. </if>
  163. </select>
  164. </mapper>