CheckPointsDao.xml 9.5 KB

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