GasCheckTaskDao.xml 8.5 KB

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