CheckItemsDao.xml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369
  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.CheckItemsDao">
  4. <resultMap type="cn.ourwill.module.house.entity.daily.CheckItems" 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="checkrecord_id" property="checkRecordId"/>
  13. <result column="checkrecord_uuid" property="checkRecordsUuid"/>
  14. <result column="itemgroup" property="itemGroup"/>
  15. <result column="itemname" property="itemName"/>
  16. <result column="itemresult" property="itemResult"/>
  17. <result column="itemresultdetail" property="itemResultDetail"/>
  18. <result column="explanation" property="Explanation"/>
  19. </resultMap>
  20. <sql id="columns">
  21. id,
  22. uuid,
  23. checkrecord_id,
  24. itemgroup,
  25. itemname,
  26. itemresult,
  27. itemresultdetail,
  28. explanation
  29. /*c_time,
  30. c_id,
  31. u_time,
  32. u_id,
  33. version*/
  34. </sql>
  35. <sql id="joinCols">
  36. </sql>
  37. <select id="get" resultMap="baseMap">
  38. SELECT
  39. <include refid="columns"/>
  40. FROM checkitems a
  41. <include refid="joinCols"/>
  42. WHERE a.id = #{id}
  43. </select>
  44. <select id="findList" resultMap="baseMap">
  45. SELECT
  46. <include refid="columns"/>
  47. FROM checkitems a
  48. <include refid="joinCols"/>
  49. <where>
  50. <if test="id !=null">
  51. and id = #{id}
  52. </if>
  53. <if test="checkRecordId !=null">
  54. and checkrecord_id = #{checkRecordId}
  55. </if>
  56. <if test="checkRecordsUuid !=null">
  57. and checkrecord_uuid = #{checkRecordsUuid}
  58. </if>
  59. <if test="itemGroup !=null">
  60. and itemgroup = #{itemGroup}
  61. </if>
  62. <if test="itemName !=null">
  63. and itemname = #{itemName}
  64. </if>
  65. <if test="itemResult !=null">
  66. and itemresult = #{itemResult}
  67. </if>
  68. <if test="itemResultDetail !=null">
  69. and itemresultdetail = #{itemResultDetail}
  70. </if>
  71. <if test="Explanation !=null">
  72. and explanation = #{Explanation}
  73. </if>
  74. <!--<if test="cTime !=null">-->
  75. <!--and c_time = #{cTime}-->
  76. <!--</if>-->
  77. <!--<if test="cId !=null">-->
  78. <!--and c_id = #{cId}-->
  79. <!--</if>-->
  80. <!--<if test="uTime !=null">-->
  81. <!--and u_time = #{uTime}-->
  82. <!--</if>-->
  83. <!--<if test="uId !=null">-->
  84. <!--and u_id = #{uId}-->
  85. <!--</if>-->
  86. <!--<if test="version !=null">-->
  87. <!--and version = #{version}-->
  88. <!--</if>-->
  89. </where>
  90. <choose>
  91. <when test="page !=null and page.orderBy != null and page.orderBy != ''">
  92. ORDER BY ${page.orderBy}
  93. </when>
  94. <otherwise>
  95. </otherwise>
  96. </choose>
  97. </select>
  98. <select id="findAllList" resultMap="baseMap">
  99. SELECT
  100. <include refid="columns"/>
  101. FROM checkitems a
  102. <include refid="joinCols"/>
  103. <where>
  104. <if test="id !=null">
  105. and id = #{id}
  106. </if>
  107. <if test="checkRecordId !=null">
  108. and checkrecord_id = #{checkRecordId}
  109. </if>
  110. <if test="itemGroup !=null">
  111. and itemgroup = #{itemGroup}
  112. </if>
  113. <if test="itemName !=null">
  114. and itemname = #{itemName}
  115. </if>
  116. <if test="itemResult !=null">
  117. and itemresult = #{itemResult}
  118. </if>
  119. <if test="itemResultDetail !=null">
  120. and itemresultdetail = #{itemResultDetail}
  121. </if>
  122. <if test="Explanation !=null">
  123. and explanation = #{Explanation}
  124. </if>
  125. <if test="cTime !=null">
  126. and c_time = #{cTime}
  127. </if>
  128. <if test="cId !=null">
  129. and c_id = #{cId}
  130. </if>
  131. <if test="uTime !=null">
  132. and u_time = #{uTime}
  133. </if>
  134. <if test="uId !=null">
  135. and u_id = #{uId}
  136. </if>
  137. <if test="version !=null">
  138. and version = #{version}
  139. </if>
  140. </where>
  141. <choose>
  142. <when test="page !=null and page.orderBy != null and page.orderBy != ''">
  143. ORDER BY ${page.orderBy}
  144. </when>
  145. <otherwise>
  146. </otherwise>
  147. </choose>
  148. </select>
  149. <select id="getByUuid" resultMap="baseMap">
  150. SELECT
  151. <include refid="columns"/>
  152. FROM checkitems a
  153. <include refid="joinCols"/>
  154. WHERE a.uuid = #{uuid}
  155. </select>
  156. <insert id="insert" keyColumn="id" keyProperty="id" useGeneratedKeys="true"
  157. parameterType="cn.ourwill.module.house.entity.daily.CheckItems">
  158. INSERT INTO checkitems
  159. <trim prefix="(" suffix=")" suffixOverrides=",">
  160. <if test=" id != null">
  161. id,
  162. </if>
  163. <if test=" uuid != null">
  164. uuid,
  165. </if>
  166. <if test="checkRecordId !=null">
  167. checkrecord_id,
  168. </if>
  169. <if test="checkRecordsUuid !=null">
  170. checkrecord_uuid,
  171. </if>
  172. <if test="itemGroup !=null">
  173. itemgroup,
  174. </if>
  175. <if test="itemName !=null">
  176. itemname,
  177. </if>
  178. <if test="itemResult !=null">
  179. itemresult,
  180. </if>
  181. <if test="itemResultDetail !=null">
  182. itemresultdetail,
  183. </if>
  184. <if test="Explanation !=null">
  185. explanation,
  186. </if>
  187. <if test=" cTime != null">
  188. c_time,
  189. </if>
  190. <if test=" cId != null">
  191. c_id,
  192. </if>
  193. <if test=" uTime != null">
  194. u_time,
  195. </if>
  196. <if test=" uId != null">
  197. u_id,
  198. </if>
  199. <if test=" version != null">
  200. version
  201. </if>
  202. </trim>
  203. <trim prefix="values (" suffix=")" suffixOverrides=",">
  204. <if test=" id != null">
  205. #{id},
  206. </if>
  207. <if test=" uuid != null">
  208. #{uuid},
  209. </if>
  210. <if test="checkRecordId !=null">
  211. #{checkRecordId},
  212. </if>
  213. <if test="checkRecordsUuid !=null">
  214. #{checkRecordsUuid},
  215. </if>
  216. <if test="itemGroup !=null">
  217. #{itemGroup},
  218. </if>
  219. <if test="itemName !=null">
  220. #{itemName},
  221. </if>
  222. <if test="itemResult !=null">
  223. #{itemResult},
  224. </if>
  225. <if test="itemResultDetail !=null">
  226. #{itemResultDetail},
  227. </if>
  228. <if test="Explanation !=null">
  229. #{Explanation},
  230. </if>
  231. <if test=" cTime != null">
  232. #{cTime},
  233. </if>
  234. <if test=" cId != null">
  235. #{cId},
  236. </if>
  237. <if test=" uTime != null">
  238. #{uTime},
  239. </if>
  240. <if test=" uId != null">
  241. #{uId},
  242. </if>
  243. <if test=" version != null">
  244. #{version}
  245. </if>
  246. </trim>
  247. </insert>
  248. <update id="update" parameterType="cn.ourwill.module.house.entity.daily.CheckItems">
  249. UPDATE checkitems
  250. <set>
  251. <if test="checkRecordId !=null">
  252. checkrecord_id = #{checkRecordId},
  253. </if>
  254. <if test="checkRecordsUuid !=null">
  255. checkrecord_uuid = #{checkRecordsUuid},
  256. </if>
  257. <if test="itemGroup !=null">
  258. itemgroup = #{itemGroup},
  259. </if>
  260. <if test="itemName !=null">
  261. itemname = #{itemName},
  262. </if>
  263. <if test="itemResult !=null">
  264. itemresult = #{itemResult},
  265. </if>
  266. <if test="itemResultDetail !=null">
  267. itemresultdetail = #{itemResultDetail},
  268. </if>
  269. <if test="Explanation !=null">
  270. explanation = #{Explanation},
  271. </if>
  272. <if test="cTime != null">
  273. c_time= #{cTime} ,
  274. </if>
  275. <if test="cId != null">
  276. c_id= #{cId} ,
  277. </if>
  278. <if test="uTime != null">
  279. u_time= #{uTime} ,
  280. </if>
  281. <if test="uId != null">
  282. u_id= #{uId} ,
  283. </if>
  284. <if test="version != null">
  285. version= #{version}
  286. </if>
  287. </set>
  288. WHERE id = #{id}
  289. </update>
  290. <update id="updateByUuid" parameterType="cn.ourwill.module.house.entity.daily.CheckItems">
  291. U UPDATE checkitems
  292. <set>
  293. <if test="checkRecordId !=null">
  294. checkrecord_id = #{checkRecordId},
  295. </if>
  296. <if test="checkRecordsUuid !=null">
  297. checkrecord_uuid = #{checkRecordsUuid},
  298. </if>
  299. <if test="itemGroup !=null">
  300. itemgroup = #{itemGroup},
  301. </if>
  302. <if test="itemName !=null">
  303. itemname = #{itemName},
  304. </if>
  305. <if test="itemResult !=null">
  306. itemresult = #{itemResult},
  307. </if>
  308. <if test="itemResultDetail !=null">
  309. itemresultdetail = #{itemResultDetail},
  310. </if>
  311. <if test="Explanation !=null">
  312. explanation = #{Explanation},
  313. </if>
  314. <if test="cTime != null">
  315. c_time= #{cTime} ,
  316. </if>
  317. <if test="cId != null">
  318. c_id= #{cId} ,
  319. </if>
  320. <if test="uTime != null">
  321. u_time= #{uTime} ,
  322. </if>
  323. <if test="uId != null">
  324. u_id= #{uId} ,
  325. </if>
  326. <if test="version != null">
  327. version= #{version}
  328. </if>
  329. </set>
  330. WHERE uuid = #{uuid}
  331. </update>
  332. <delete id="deleteById" parameterType="java.lang.Long">
  333. DELETE FROM checkitems
  334. WHERE id = #{id}
  335. </delete>
  336. <delete id="deleteByIds" parameterType="java.util.List">
  337. DELETE FROM checkitems WHERE id IN
  338. <foreach collection="list" index="index" item="item" open="(" separator="," close=")">
  339. #{item}
  340. </foreach>
  341. </delete>
  342. </mapper>