RoomRenovationRecordServiceDaoImplMapper.xml 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  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="roomRenovationRecordServiceDaoImpl">
  6. <!-- 保存装修记录信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveRoomRenovationRecordInfo" parameterType="Map">
  8. insert into room_renovation_record(record_id,r_id,staff_id,staff_name,state,remark,create_time,is_true) values (#{recordId},#{rId},#{staffId},#{staffName},#{state},#{remark},#{createTime},#{isTrue})
  9. </insert>
  10. <!-- 查询装修记录信息(与文件表关联) -->
  11. <select id="getRoomRenovationRecordsInfo" parameterType="Map" resultType="Map">
  12. SELECT
  13. re.record_id recordId,
  14. re.r_id rId,
  15. re.staff_id staffId,
  16. re.staff_name staffName,
  17. re.remark,
  18. re.state,
  19. re.is_true isTrue,
  20. td. NAME stateName,
  21. re.create_time createTime,
  22. r.room_id roomId,
  23. r.room_name roomName,
  24. fr.file_real_name fileRealName,
  25. fr.file_save_name fileSaveName,
  26. fr.rel_type_cd relTypeCd
  27. FROM
  28. room_renovation_record re
  29. LEFT JOIN room_renovation r ON re.r_id = r.r_id
  30. AND r.status_cd = '0'
  31. LEFT JOIN t_dict td ON td.table_name = 'room_renovation_record'
  32. AND td.table_columns = 'state'
  33. AND re.state = td.status_cd
  34. LEFT JOIN file_rel fr ON re.record_id = fr.obj_id
  35. AND fr.status_cd = "0"
  36. WHERE 1 = 1
  37. <if test="recordId !=null and recordId != ''">
  38. and re.record_id= #{recordId}
  39. </if>
  40. <if test="rId !=null and rId != ''">
  41. and re.r_id= #{rId}
  42. </if>
  43. <if test="staffId !=null and staffId != ''">
  44. and re.staff_id= #{staffId}
  45. </if>
  46. <if test="staffName !=null and staffName != ''">
  47. and re.staff_name like '%{staffName}%'
  48. </if>
  49. <if test="remark !=null and remark != ''">
  50. and re.remark= #{remark}
  51. </if>
  52. <if test="state !=null and state != ''">
  53. and re.state= #{state}
  54. </if>
  55. <if test="roomId !=null and roomId != ''">
  56. and r.room_id = #{roomId}
  57. </if>
  58. <if test="roomName !=null and roomName != ''">
  59. and r.room_name= #{roomName}
  60. </if>
  61. <if test="statusCd != null and statusCd != ''">
  62. and re.status_cd = #{statusCd}
  63. </if>
  64. <if test="isTrue != null and isTrue != ''">
  65. and re.is_true = #{isTrue}
  66. </if>
  67. <if test="createTime !=null and createTime != ''">
  68. and re.create_time= #{createTime}
  69. </if>
  70. order by re.create_time desc
  71. <if test="page != -1 and page != null ">
  72. limit #{page}, #{row}
  73. </if>
  74. </select>
  75. <!-- 查询装修记录数量(与文件表关联) -->
  76. <select id="queryRoomRenovationRecordsCount" parameterType="Map" resultType="Map">
  77. select count(1) count
  78. from room_renovation_record re
  79. LEFT JOIN room_renovation r ON re.r_id = r.r_id
  80. AND r.status_cd = '0'
  81. LEFT JOIN file_rel fr ON re.record_id = fr.obj_id
  82. AND fr.status_cd = '0'
  83. where 1 = 1
  84. <if test="recordId !=null and recordId != ''">
  85. and re.record_id= #{recordId}
  86. </if>
  87. <if test="rId !=null and rId != ''">
  88. and re.r_id= #{rId}
  89. </if>
  90. <if test="staffId !=null and staffId != ''">
  91. and re.staff_id= #{staffId}
  92. </if>
  93. <if test="staffName !=null and staffName != ''">
  94. and re.staff_name like '%{staffName}%'
  95. </if>
  96. <if test="remark !=null and remark != ''">
  97. and re.remark= #{remark}
  98. </if>
  99. <if test="state !=null and state != ''">
  100. and re.state= #{state}
  101. </if>
  102. <if test="roomId !=null and roomId != ''">
  103. and r.room_id = #{roomId}
  104. </if>
  105. <if test="roomName !=null and roomName != ''">
  106. and r.room_name= #{roomName}
  107. </if>
  108. <if test="statusCd != null and statusCd != ''">
  109. and re.status_cd = #{statusCd}
  110. </if>
  111. <if test="isTrue != null and isTrue != ''">
  112. and re.is_true = #{isTrue}
  113. </if>
  114. <if test="createTime !=null and createTime != ''">
  115. and re.create_time= #{createTime}
  116. </if>
  117. </select>
  118. <!-- 查询装修记录信息 -->
  119. <select id="getRoomRenovationRecords" parameterType="Map" resultType="Map">
  120. SELECT
  121. re.record_id recordId,
  122. re.r_id rId,
  123. re.staff_id staffId,
  124. re.staff_name staffName,
  125. re.remark,
  126. re.state,
  127. td.name stateName,
  128. re.is_true isTrue,
  129. td2.name isTrueName,
  130. re.create_time createTime,
  131. r.room_id roomId,
  132. r.room_name roomName
  133. FROM
  134. room_renovation_record re
  135. LEFT JOIN room_renovation r ON re.r_id = r.r_id
  136. AND r.status_cd = '0'
  137. LEFT JOIN t_dict td ON td.table_name = 'room_renovation_record'
  138. AND td.table_columns = 'state'
  139. AND re.state = td.status_cd
  140. LEFT JOIN t_dict td2 ON td2.table_name = 'room_renovation_record'
  141. AND td2.table_columns = 'is_true' AND re.is_true = td2.status_cd
  142. WHERE 1 = 1
  143. <if test="recordId !=null and recordId != ''">
  144. and re.record_id= #{recordId}
  145. </if>
  146. <if test="rId !=null and rId != ''">
  147. and re.r_id= #{rId}
  148. </if>
  149. <if test="staffId !=null and staffId != ''">
  150. and re.staff_id= #{staffId}
  151. </if>
  152. <if test="staffName !=null and staffName != ''">
  153. and re.staff_name like '%{staffName}%'
  154. </if>
  155. <if test="remark !=null and remark != ''">
  156. and re.remark= #{remark}
  157. </if>
  158. <if test="state !=null and state != ''">
  159. and re.state= #{state}
  160. </if>
  161. <if test="roomId !=null and roomId != ''">
  162. and r.room_id = #{roomId}
  163. </if>
  164. <if test="roomName !=null and roomName != ''">
  165. and r.room_name= #{roomName}
  166. </if>
  167. <if test="statusCd != null and statusCd != ''">
  168. and re.status_cd = #{statusCd}
  169. </if>
  170. <if test="isTrue != null and isTrue != ''">
  171. and re.is_true = #{isTrue}
  172. </if>
  173. <if test="createTime !=null and createTime != ''">
  174. and re.create_time= #{createTime}
  175. </if>
  176. order by re.create_time desc
  177. <if test="page != -1 and page != null ">
  178. limit #{page}, #{row}
  179. </if>
  180. </select>
  181. <!-- 查询装修记录数量 -->
  182. <select id="getRoomRenovationRecordsCount" parameterType="Map" resultType="Map">
  183. select count(1) count
  184. from room_renovation_record re
  185. LEFT JOIN room_renovation r ON re.r_id = r.r_id
  186. AND r.status_cd = '0'
  187. where 1 = 1
  188. <if test="recordId !=null and recordId != ''">
  189. and re.record_id= #{recordId}
  190. </if>
  191. <if test="rId !=null and rId != ''">
  192. and re.r_id= #{rId}
  193. </if>
  194. <if test="staffId !=null and staffId != ''">
  195. and re.staff_id= #{staffId}
  196. </if>
  197. <if test="staffName !=null and staffName != ''">
  198. and re.staff_name like '%{staffName}%'
  199. </if>
  200. <if test="remark !=null and remark != ''">
  201. and re.remark= #{remark}
  202. </if>
  203. <if test="state !=null and state != ''">
  204. and re.state= #{state}
  205. </if>
  206. <if test="roomId !=null and roomId != ''">
  207. and r.room_id = #{roomId}
  208. </if>
  209. <if test="roomName !=null and roomName != ''">
  210. and r.room_name= #{roomName}
  211. </if>
  212. <if test="statusCd != null and statusCd != ''">
  213. and re.status_cd = #{statusCd}
  214. </if>
  215. <if test="isTrue != null and isTrue != ''">
  216. and re.is_true = #{isTrue}
  217. </if>
  218. <if test="createTime !=null and createTime != ''">
  219. and re.create_time= #{createTime}
  220. </if>
  221. </select>
  222. <!-- 修改装修记录信息 add by wuxw 2018-07-03 -->
  223. <update id="updateRoomRenovationRecordInfo" parameterType="Map">
  224. update room_renovation_record r set r.status_cd = #{statusCd}
  225. where 1=1
  226. <if test="recordId !=null and recordId != ''">
  227. and r.record_id= #{recordId}
  228. </if>
  229. </update>
  230. </mapper>