CarInoutDetailServiceDaoImplMapper.xml 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  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="carInoutDetailServiceDaoImpl">
  6. <!-- 保存进出场详情信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveBusinessCarInoutDetailInfo" parameterType="Map">
  8. insert into business_car_inout_detail(
  9. inout_id,machine_id,machine_code,operate,car_inout,detail_id,car_num,community_id,b_id
  10. ) values (
  11. #{inoutId},#{machineId},#{machineCode},#{operate},#{carInout},#{detailId},#{carNum},#{communityId},#{bId}
  12. )
  13. </insert>
  14. <!-- 查询进出场详情信息(Business) add by wuxw 2018-07-03 -->
  15. <select id="getBusinessCarInoutDetailInfo" parameterType="Map" resultType="Map">
  16. select t.inout_id,t.inout_id inoutId,t.machine_id,t.machine_id machineId,t.machine_code,t.machine_code
  17. machineCode,t.operate,t.car_inout,t.car_inout carInout,t.detail_id,t.detail_id detailId,t.car_num,t.car_num
  18. carNum,t.community_id,t.community_id communityId,t.b_id,t.b_id bId
  19. from business_car_inout_detail t
  20. where 1 =1
  21. <if test="inoutId !=null and inoutId != ''">
  22. and t.inout_id= #{inoutId}
  23. </if>
  24. <if test="machineId !=null and machineId != ''">
  25. and t.machine_id= #{machineId}
  26. </if>
  27. <if test="machineCode !=null and machineCode != ''">
  28. and t.machine_code= #{machineCode}
  29. </if>
  30. <if test="operate !=null and operate != ''">
  31. and t.operate= #{operate}
  32. </if>
  33. <if test="carInout !=null and carInout != ''">
  34. and t.car_inout= #{carInout}
  35. </if>
  36. <if test="detailId !=null and detailId != ''">
  37. and t.detail_id= #{detailId}
  38. </if>
  39. <if test="carNum !=null and carNum != ''">
  40. and t.car_num= #{carNum}
  41. </if>
  42. <if test="communityId !=null and communityId != ''">
  43. and t.community_id= #{communityId}
  44. </if>
  45. <if test="bId !=null and bId != ''">
  46. and t.b_id= #{bId}
  47. </if>
  48. </select>
  49. <!-- 保存进出场详情信息至 instance表中 add by wuxw 2018-07-03 -->
  50. <insert id="saveCarInoutDetailInfoInstance" parameterType="Map">
  51. insert into car_inout_detail(
  52. inout_id,machine_id,machine_code,car_inout,detail_id,car_num,status_cd,community_id,b_id
  53. ) select t.inout_id,t.machine_id,t.machine_code,t.car_inout,t.detail_id,t.car_num,'0',t.community_id,t.b_id from
  54. business_car_inout_detail t where 1=1
  55. <if test="inoutId !=null and inoutId != ''">
  56. and t.inout_id= #{inoutId}
  57. </if>
  58. <if test="machineId !=null and machineId != ''">
  59. and t.machine_id= #{machineId}
  60. </if>
  61. <if test="machineCode !=null and machineCode != ''">
  62. and t.machine_code= #{machineCode}
  63. </if>
  64. and t.operate= 'ADD'
  65. <if test="carInout !=null and carInout != ''">
  66. and t.car_inout= #{carInout}
  67. </if>
  68. <if test="detailId !=null and detailId != ''">
  69. and t.detail_id= #{detailId}
  70. </if>
  71. <if test="carNum !=null and carNum != ''">
  72. and t.car_num= #{carNum}
  73. </if>
  74. <if test="communityId !=null and communityId != ''">
  75. and t.community_id= #{communityId}
  76. </if>
  77. <if test="bId !=null and bId != ''">
  78. and t.b_id= #{bId}
  79. </if>
  80. </insert>
  81. <!-- 查询进出场详情信息 add by wuxw 2018-07-03 -->
  82. <select id="getCarInoutDetailInfo" parameterType="Map" resultType="Map">
  83. select t.inout_id,t.inout_id inoutId,t.machine_id,t.machine_id machineId,t.machine_code,t.machine_code
  84. machineCode,t.car_inout,t.car_inout carInout,t.detail_id,t.detail_id detailId,t.car_num,t.car_num
  85. carNum,t.status_cd,t.status_cd statusCd,t.community_id,t.community_id communityId,t.b_id,t.b_id bId
  86. from car_inout_detail t
  87. where 1 =1
  88. <if test="inoutId !=null and inoutId != ''">
  89. and t.inout_id= #{inoutId}
  90. </if>
  91. <if test="machineId !=null and machineId != ''">
  92. and t.machine_id= #{machineId}
  93. </if>
  94. <if test="machineCode !=null and machineCode != ''">
  95. and t.machine_code= #{machineCode}
  96. </if>
  97. <if test="carInout !=null and carInout != ''">
  98. and t.car_inout= #{carInout}
  99. </if>
  100. <if test="detailId !=null and detailId != ''">
  101. and t.detail_id= #{detailId}
  102. </if>
  103. <if test="carNum !=null and carNum != ''">
  104. and t.car_num= #{carNum}
  105. </if>
  106. <if test="statusCd !=null and statusCd != ''">
  107. and t.status_cd= #{statusCd}
  108. </if>
  109. <if test="communityId !=null and communityId != ''">
  110. and t.community_id= #{communityId}
  111. </if>
  112. <if test="bId !=null and bId != ''">
  113. and t.b_id= #{bId}
  114. </if>
  115. order by t.create_time desc
  116. <if test="page != -1 and page != null ">
  117. limit #{page}, #{row}
  118. </if>
  119. </select>
  120. <!-- 修改进出场详情信息 add by wuxw 2018-07-03 -->
  121. <update id="updateCarInoutDetailInfoInstance" parameterType="Map">
  122. update car_inout_detail t set t.status_cd = #{statusCd}
  123. <if test="newBId != null and newBId != ''">
  124. ,t.b_id = #{newBId}
  125. </if>
  126. <if test="inoutId !=null and inoutId != ''">
  127. , t.inout_id= #{inoutId}
  128. </if>
  129. <if test="machineId !=null and machineId != ''">
  130. , t.machine_id= #{machineId}
  131. </if>
  132. <if test="machineCode !=null and machineCode != ''">
  133. , t.machine_code= #{machineCode}
  134. </if>
  135. <if test="carInout !=null and carInout != ''">
  136. , t.car_inout= #{carInout}
  137. </if>
  138. <if test="carNum !=null and carNum != ''">
  139. , t.car_num= #{carNum}
  140. </if>
  141. <if test="communityId !=null and communityId != ''">
  142. , t.community_id= #{communityId}
  143. </if>
  144. where 1=1
  145. <if test="detailId !=null and detailId != ''">
  146. and t.detail_id= #{detailId}
  147. </if>
  148. <if test="bId !=null and bId != ''">
  149. and t.b_id= #{bId}
  150. </if>
  151. </update>
  152. <!-- 查询进出场详情数量 add by wuxw 2018-07-03 -->
  153. <select id="queryCarInoutDetailsCount" parameterType="Map" resultType="Map">
  154. select count(1) count
  155. from car_inout_detail t
  156. where 1 =1
  157. <if test="inoutId !=null and inoutId != ''">
  158. and t.inout_id= #{inoutId}
  159. </if>
  160. <if test="machineId !=null and machineId != ''">
  161. and t.machine_id= #{machineId}
  162. </if>
  163. <if test="machineCode !=null and machineCode != ''">
  164. and t.machine_code= #{machineCode}
  165. </if>
  166. <if test="carInout !=null and carInout != ''">
  167. and t.car_inout= #{carInout}
  168. </if>
  169. <if test="detailId !=null and detailId != ''">
  170. and t.detail_id= #{detailId}
  171. </if>
  172. <if test="carNum !=null and carNum != ''">
  173. and t.car_num= #{carNum}
  174. </if>
  175. <if test="statusCd !=null and statusCd != ''">
  176. and t.status_cd= #{statusCd}
  177. </if>
  178. <if test="communityId !=null and communityId != ''">
  179. and t.community_id= #{communityId}
  180. </if>
  181. <if test="bId !=null and bId != ''">
  182. and t.b_id= #{bId}
  183. </if>
  184. </select>
  185. </mapper>