CheckProblemsDao.xml 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461
  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="cn.ourwill.module.house.dao.daily.CheckProblemsDao">
  4. <resultMap type="cn.ourwill.module.house.entity.daily.CheckProblems" id="baseMap">
  5. <result column="id" property="id"/>
  6. <!--<result column="uuid" property="uuid"/>-->
  7. <!--<result column="c_id" property="cId"/>-->
  8. <!--<result column="c_time" property="cTime"/>-->
  9. <!--<result column="u_id" property="uId"/>-->
  10. <!--<result column="u_time" property="uTime"/>-->
  11. <!--<result column="version" property="version"/>-->
  12. <result column="checkrecords_uuid" property="checkRecordsUuid"/>
  13. <result column="checkitems_uuid" property="checkItemsUuid"/>
  14. <result column="problem_desc" property="problemDesc"/>
  15. <result column="problem_pic" property="problemPic"/>
  16. <result column="problem_changed_pic" property="problemChangedPic"/>
  17. <result column="have_changed" property="haveChanged"/>
  18. <result column="measure_changed" property="measureChanged"/>
  19. <result column="changed_person" property="changedPerson"/>
  20. <result column="changed_startdate" property="changedStartDate"/>
  21. <result column="changed_enddate" property="changedEndDate"/>
  22. <result column="measure_result" property="measureResult"/>
  23. </resultMap>
  24. <sql id="columns">
  25. id,
  26. checkrecords_uuid,
  27. checkitems_uuid,
  28. problem_desc,
  29. problem_pic,
  30. problem_changed_pic,
  31. have_changed,
  32. measure_changed,
  33. changed_person,
  34. changed_startdate,
  35. changed_enddate,
  36. measure_result
  37. /*c_time,
  38. c_id,
  39. u_time,
  40. u_id,
  41. version*/
  42. </sql>
  43. <sql id="joinCols">
  44. </sql>
  45. <select id="get" resultMap="baseMap">
  46. SELECT
  47. <include refid="columns"/>
  48. FROM check_problems a
  49. <include refid="joinCols"/>
  50. WHERE a.id = #{id}
  51. </select>
  52. <select id="getByUuid" resultMap="baseMap">
  53. SELECT
  54. <include refid="columns"/>
  55. FROM check_problems a
  56. <include refid="joinCols"/>
  57. WHERE a.uuid = #{uuid}
  58. </select>
  59. <select id="findList" resultMap="baseMap">
  60. SELECT
  61. <include refid="columns"/>
  62. FROM check_problems a
  63. <include refid="joinCols"/>
  64. <where>
  65. <if test="id !=null">
  66. and id = #{id}
  67. </if>
  68. <if test="checkRecordsUuid !=null">
  69. and checkrecords_uuid = #{checkRecordsUuid}
  70. </if>
  71. <if test="checkItemsUuid !=null">
  72. and checkitems_uuid = #{checkItemsUuid}
  73. </if>
  74. <if test="problemDesc !=null">
  75. and problem_desc = #{problemDesc}
  76. </if>
  77. <if test="problemPic !=null">
  78. and problem_pic = #{problemPic}
  79. </if>
  80. <if test="problemChangedPic !=null">
  81. and problem_changed_pic = #{problemChangedPic}
  82. </if>
  83. <if test="haveChanged !=null">
  84. and have_changed = #{haveChanged}
  85. </if>
  86. <if test="measureChanged !=null">
  87. and measure_changed = #{measureChanged}
  88. </if>
  89. <if test="changedPerson !=null">
  90. and changed_person = #{changedPerson}
  91. </if>
  92. <if test="changedStartDate !=null">
  93. and changed_startdate = #{changedStartDate}
  94. </if>
  95. <if test="changedEndDate !=null">
  96. and changed_enddate = #{changedEndDate}
  97. </if>
  98. <if test="measureResult !=null">
  99. and measure_result = #{measureResult}
  100. </if>
  101. <!-- <if test="cTime !=null">
  102. and c_time = #{cTime}
  103. </if>
  104. <if test="cId !=null">
  105. and c_id = #{cId}
  106. </if>
  107. <if test="uTime !=null">
  108. and u_time = #{uTime}
  109. </if>
  110. <if test="uId !=null">
  111. and u_id = #{uId}
  112. </if>
  113. <if test="version !=null">
  114. and version = #{version}
  115. </if>-->
  116. </where>
  117. <choose>
  118. <when test="page !=null and page.orderBy != null and page.orderBy != ''">
  119. ORDER BY ${page.orderBy}
  120. </when>
  121. <otherwise>
  122. </otherwise>
  123. </choose>
  124. </select>
  125. <select id="findAllList" resultMap="baseMap">
  126. SELECT
  127. <include refid="columns"/>
  128. FROM check_problems a
  129. <include refid="joinCols"/>
  130. <where>
  131. <if test="id !=null">
  132. and id = #{id}
  133. </if>
  134. <if test="uuid !=null">
  135. and uuid = #{uuid}
  136. </if>
  137. <if test="checkRecordsUuid !=null">
  138. and checkrecords_uuid = #{checkRecordsUuid}
  139. </if>
  140. <if test="checkItemsUuid !=null">
  141. and checkitems_uuid = #{checkItemsUuid}
  142. </if>
  143. <if test="problemDesc !=null">
  144. and problem_desc = #{problemDesc}
  145. </if>
  146. <if test="problemPic !=null">
  147. and problem_pic = #{problemPic}
  148. </if>
  149. <if test="problemChangedPic !=null">
  150. and problem_changed_pic = #{problemChangedPic}
  151. </if>
  152. <if test="haveChanged !=null">
  153. and have_changed = #{haveChanged}
  154. </if>
  155. <if test="measureChanged !=null">
  156. and measure_changed = #{measureChanged}
  157. </if>
  158. <if test="changedPerson !=null">
  159. and changed_person = #{changedPerson}
  160. </if>
  161. <if test="changedStartDate !=null">
  162. and changed_startdate = #{changedStartDate}
  163. </if>
  164. <if test="changedEndDate !=null">
  165. and changed_enddate = #{changedEndDate}
  166. </if>
  167. <if test="measureResult !=null">
  168. and measure_result = #{measureResult}
  169. </if>
  170. <if test="cTime !=null">
  171. and c_time = #{cTime}
  172. </if>
  173. <if test="cId !=null">
  174. and c_id = #{cId}
  175. </if>
  176. <if test="uTime !=null">
  177. and u_time = #{uTime}
  178. </if>
  179. <if test="uId !=null">
  180. and u_id = #{uId}
  181. </if>
  182. <if test="version !=null">
  183. and version = #{version}
  184. </if>
  185. </where>
  186. <choose>
  187. <when test="page !=null and page.orderBy != null and page.orderBy != ''">
  188. ORDER BY ${page.orderBy}
  189. </when>
  190. <otherwise>
  191. </otherwise>
  192. </choose>
  193. </select>
  194. <select id="getByCheckItemsUuid" resultMap="baseMap">
  195. SELECT
  196. <include refid="columns"/>
  197. FROM check_problems a
  198. <include refid="joinCols"/>
  199. WHERE a.checkitems_uuid = #{uuid}
  200. </select>
  201. <insert id="insert" keyColumn="id" keyProperty="id" useGeneratedKeys="true"
  202. parameterType="cn.ourwill.module.house.entity.daily.CheckProblems">
  203. INSERT INTO check_problems
  204. <trim prefix="(" suffix=")" suffixOverrides=",">
  205. <if test=" id != null">
  206. id,
  207. </if>
  208. <if test=" uuid != null">
  209. uuid,
  210. </if>
  211. <if test="checkRecordsUuid != null">
  212. checkrecords_uuid,
  213. </if>
  214. <if test="checkItemsUuid != null">
  215. checkitems_uuid,
  216. </if>
  217. <if test="problemDesc != null">
  218. problem_desc,
  219. </if>
  220. <if test="problemPic != null">
  221. problem_pic,
  222. </if>
  223. <if test="problemChangedPic !=null">
  224. problem_changed_pic,
  225. </if>
  226. <if test="haveChanged != null">
  227. have_changed,
  228. </if>
  229. <if test="measureChanged != null">
  230. measure_changed,
  231. </if>
  232. <if test="changedPerson != null">
  233. changed_person,
  234. </if>
  235. <if test="changedStartDate != null">
  236. changed_startdate,
  237. </if>
  238. <if test="changedEndDate != null">
  239. changed_enddate,
  240. </if>
  241. <if test="measureResult !=null">
  242. measure_result,
  243. </if>
  244. <if test=" cTime != null">
  245. c_time,
  246. </if>
  247. <if test=" cId != null">
  248. c_id,
  249. </if>
  250. <if test=" uTime != null">
  251. u_time,
  252. </if>
  253. <if test=" uId != null">
  254. u_id,
  255. </if>
  256. <if test=" version != null">
  257. version
  258. </if>
  259. </trim>
  260. <trim prefix="values (" suffix=")" suffixOverrides=",">
  261. <if test=" id != null">
  262. #{id},
  263. </if>
  264. <if test=" uuid != null">
  265. #{uuid},
  266. </if>
  267. <if test="checkRecordsUuid != null">
  268. #{checkRecordsUuid},
  269. </if>
  270. <if test="checkItemsUuid != null">
  271. #{checkItemsUuid},
  272. </if>
  273. <if test="problemDesc != null">
  274. #{problemDesc},
  275. </if>
  276. <if test="problemPic != null">
  277. #{problemPic},
  278. </if>
  279. <if test="problemChangedPic !=null">
  280. #{problemChangedPic},
  281. </if>
  282. <if test="haveChanged != null">
  283. #{haveChanged},
  284. </if>
  285. <if test="measureChanged != null">
  286. #{measureChanged},
  287. </if>
  288. <if test="changedPerson != null">
  289. #{changedPerson},
  290. </if>
  291. <if test="changedStartDate != null">
  292. #{changedStartDate},
  293. </if>
  294. <if test="changedEndDate != null">
  295. #{changedEndDate},
  296. </if>
  297. <if test="measureResult !=null">
  298. #{measureResult},
  299. </if>
  300. <if test=" cTime != null">
  301. #{cTime},
  302. </if>
  303. <if test=" cId != null">
  304. #{cId},
  305. </if>
  306. <if test=" uTime != null">
  307. #{uTime},
  308. </if>
  309. <if test=" uId != null">
  310. #{uId},
  311. </if>
  312. <if test=" version != null">
  313. #{version}
  314. </if>
  315. </trim>
  316. </insert>
  317. <update id="update" parameterType="cn.ourwill.module.house.entity.daily.CheckProblems">
  318. UPDATE check_problems
  319. <set>
  320. <if test="checkRecordsUuid !=null">
  321. checkrecords_uuid = #{checkRecordsUuid},
  322. </if>
  323. <if test="checkItemsUuid !=null">
  324. checkitems_uuid = #{checkItemsUuid},
  325. </if>
  326. <if test="problemDesc !=null">
  327. problem_desc = #{problemDesc},
  328. </if>
  329. <if test="problemPic !=null">
  330. problem_pic = #{problemPic},
  331. </if>
  332. <if test="problemChangedPic !=null">
  333. problem_changed_pic = #{problemChangedPic},
  334. </if>
  335. <if test="haveChanged !=null">
  336. have_changed = #{haveChanged},
  337. </if>
  338. <if test="measureChanged !=null">
  339. measure_changed = #{measureChanged},
  340. </if>
  341. <if test="changedPerson !=null">
  342. changed_person = #{changedPerson},
  343. </if>
  344. <if test="changedStartDate !=null">
  345. changed_startdate = #{changedStartDate},
  346. </if>
  347. <if test="changedEndDate !=null">
  348. changed_enddate = #{changedEndDate},
  349. </if>
  350. <if test="measureResult !=null">
  351. measure_result = #{measureResult},
  352. </if>
  353. <if test="cTime != null">
  354. c_time= #{cTime} ,
  355. </if>
  356. <if test="cId != null">
  357. c_id= #{cId} ,
  358. </if>
  359. <if test="uTime != null">
  360. u_time= #{uTime} ,
  361. </if>
  362. <if test="uId != null">
  363. u_id= #{uId} ,
  364. </if>
  365. <if test="version != null">
  366. version= #{version}
  367. </if>
  368. </set>
  369. WHERE id = #{id}
  370. </update>
  371. <update id="updateByUuid" parameterType="cn.ourwill.module.house.entity.daily.CheckProblems">
  372. UPDATE check_problems
  373. <set>
  374. <if test="checkRecordsUuid !=null">
  375. checkrecords_uuid = #{checkRecordsUuid},
  376. </if>
  377. <if test="checkItemsUuid !=null">
  378. checkitems_uuid = #{checkItemsUuid},
  379. </if>
  380. <if test="problemDesc !=null">
  381. problem_desc = #{problemDesc},
  382. </if>
  383. <if test="problemPic !=null">
  384. problem_pic = #{problemPic},
  385. </if>
  386. <if test="problemChangedPic !=null">
  387. problem_changed_pic = #{problemChangedPic},
  388. </if>
  389. <if test="haveChanged !=null">
  390. have_changed = #{haveChanged},
  391. </if>
  392. <if test="measureChanged !=null">
  393. measure_changed = #{measureChanged},
  394. </if>
  395. <if test="changedPerson !=null">
  396. changed_person = #{changedPerson},
  397. </if>
  398. <if test="changedStartDate !=null">
  399. changed_startdate = #{changedStartDate},
  400. </if>
  401. <if test="changedEndDate !=null">
  402. changed_enddate = #{changedEndDate},
  403. </if>
  404. <if test="measureResult !=null">
  405. measure_result = #{measureResult},
  406. </if>
  407. <if test="cTime != null">
  408. c_time= #{cTime} ,
  409. </if>
  410. <if test="cId != null">
  411. c_id= #{cId} ,
  412. </if>
  413. <if test="uTime != null">
  414. u_time= #{uTime} ,
  415. </if>
  416. <if test="uId != null">
  417. u_id= #{uId} ,
  418. </if>
  419. <if test="version != null">
  420. version= #{version}
  421. </if>
  422. </set>
  423. WHERE uuid = #{uuid}
  424. </update>
  425. <delete id="deleteById" parameterType="java.lang.Long">
  426. DELETE FROM check_problems
  427. WHERE id = #{id}
  428. </delete>
  429. <delete id="deleteByIds" parameterType="java.util.List">
  430. DELETE FROM check_problems WHERE id IN
  431. <foreach collection="list" index="index" item="item" open="(" separator="," close=")">
  432. #{item}
  433. </foreach>
  434. </delete>
  435. </mapper>