GrainStatusCheckTaskDao.xml 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351
  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.GrainStatusCheckTaskDao">
  4. <resultMap type="cn.ourwill.module.house.entity.intelcontrol.GrainStatusCheck" id="baseMap">
  5. <result column="id" property="id"/>
  6. <result column="cityId" property="cityId"/>
  7. <result column="type" property="type"/>
  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 grain_status_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 grain_status_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. <select id="findAllList" resultMap="baseMap">
  109. SELECT
  110. <include refid="columns"/>
  111. FROM grain_status_check
  112. <where>
  113. <if test="id !=null">
  114. and id = #{id}
  115. </if>
  116. <if test="type !=null">
  117. and `type` = #{type}
  118. </if>
  119. <if test="cityId !=null">
  120. and cityId = #{cityId}
  121. </if>
  122. <if test="grainId !=null">
  123. and grain_id = #{grainId}
  124. </if>
  125. <if test="houseId !=null">
  126. and house_id= #{houseId}
  127. </if>
  128. <if test="checkDate !=null">
  129. and check_date = #{checkDate}
  130. </if>
  131. <if test="taskName !=null">
  132. and task_name = #{taskName}
  133. </if>
  134. <if test="status !=null">
  135. and status = #{status}
  136. </if>
  137. <if test="uuid !=null">
  138. and uuid = #{uuid}
  139. </if>
  140. <if test="cId !=null">
  141. and c_id = #{cId}
  142. </if>
  143. <if test="cTime !=null">
  144. and c_time = #{cTime}
  145. </if>
  146. <if test="uId !=null">
  147. and u_id = #{uId}
  148. </if>
  149. <if test="uTime !=null">
  150. and u_time = #{uTime}
  151. </if>
  152. <if test="version !=null">
  153. and version = #{version}
  154. </if>
  155. <if test="syncFlag !=null">
  156. and sync_flag = #{syncFlag}
  157. </if>
  158. </where>
  159. </select>
  160. <select id="getAllTaskName" resultMap="baseMap">
  161. SELECT
  162. task_name
  163. FROM grain_status_check
  164. <where>
  165. <if test="type !=null">
  166. and `type` = #{type}
  167. </if>
  168. <if test="grainId !=null">
  169. and grain_id = #{grainId}
  170. </if>
  171. </where>
  172. </select>
  173. <insert id="insert" keyColumn="id" keyProperty="id" useGeneratedKeys="true"
  174. parameterType="cn.ourwill.module.house.entity.intelcontrol.GrainStatusCheck">
  175. INSERT INTO grain_status_check
  176. <trim prefix="(" suffix=")" suffixOverrides=",">
  177. <if test="id !=null">
  178. id,
  179. </if>
  180. <if test="type !=null">
  181. `type`,
  182. </if>
  183. <if test="cityId !=null">
  184. cityId,
  185. </if>
  186. <if test="grainId !=null">
  187. grain_id,
  188. </if>
  189. <if test="houseId !=null">
  190. house_id,
  191. </if>
  192. <if test="checkDate !=null">
  193. check_date,
  194. </if>
  195. <if test="taskName !=null">
  196. task_name,
  197. </if>
  198. <if test="status !=null">
  199. status,
  200. </if>
  201. <if test="uuid !=null">
  202. uuid,
  203. </if>
  204. <if test="cId !=null">
  205. c_id,
  206. </if>
  207. <if test="cTime !=null">
  208. c_time,
  209. </if>
  210. <if test="uId !=null">
  211. u_id,
  212. </if>
  213. <if test="uTime !=null">
  214. u_time,
  215. </if>
  216. <if test="version !=null">
  217. version,
  218. </if>
  219. <if test="syncFlag !=null">
  220. sync_flag
  221. </if>
  222. </trim>
  223. <trim prefix="values (" suffix=")" suffixOverrides=",">
  224. <if test="id !=null">
  225. #{id},
  226. </if>
  227. <if test="type !=null">
  228. #{type},
  229. </if>
  230. <if test="cityId !=null">
  231. #{cityId},
  232. </if>
  233. <if test="grainId !=null">
  234. #{grainId},
  235. </if>
  236. <if test="houseId !=null">
  237. #{houseId},
  238. </if>
  239. <if test="checkDate !=null">
  240. #{checkDate},
  241. </if>
  242. <if test="taskName !=null">
  243. #{taskName},
  244. </if>
  245. <if test="status !=null">
  246. #{status},
  247. </if>
  248. <if test="uuid !=null">
  249. #{uuid},
  250. </if>
  251. <if test="cId !=null">
  252. #{cId},
  253. </if>
  254. <if test="cTime !=null">
  255. #{cTime},
  256. </if>
  257. <if test="uId !=null">
  258. #{uId},
  259. </if>
  260. <if test="uTime !=null">
  261. #{uTime},
  262. </if>
  263. <if test="version !=null">
  264. #{version},
  265. </if>
  266. <if test="syncFlag !=null">
  267. #{syncFlag}
  268. </if>
  269. </trim>
  270. </insert>
  271. <update id="update" parameterType="cn.ourwill.module.house.entity.intelcontrol.GrainStatusCheck">
  272. UPDATE grain_status_check <set>
  273. <if test="id !=null">
  274. id = #{id},
  275. </if>
  276. <if test="type !=null">
  277. `type` = #{type},
  278. </if>
  279. <if test="cityId !=null">
  280. cityId = #{cityId},
  281. </if>
  282. <if test="grainId !=null">
  283. grain_id = #{grainId},
  284. </if>
  285. <if test="houseId !=null">
  286. house_id= #{houseId},
  287. </if>
  288. <if test="checkDate !=null">
  289. check_date = #{checkDate},
  290. </if>
  291. <if test="taskName !=null">
  292. task_name = #{taskName},
  293. </if>
  294. <if test="status !=null">
  295. status = #{status},
  296. </if>
  297. <if test="uuid !=null">
  298. uuid = #{uuid},
  299. </if>
  300. <if test="cId !=null">
  301. c_id = #{cId},
  302. </if>
  303. <if test="cTime !=null">
  304. c_time = #{cTime},
  305. </if>
  306. <if test="uId !=null">
  307. u_id = #{uId},
  308. </if>
  309. <if test="uTime !=null">
  310. u_time = #{uTime},
  311. </if>
  312. <if test="version !=null">
  313. version = #{version},
  314. </if>
  315. <if test="syncFlag !=null">
  316. sync_flag = #{syncFlag}
  317. </if>
  318. </set>
  319. WHERE id = #{id}
  320. </update>
  321. <delete id="deleteById" parameterType="java.lang.Long">
  322. DELETE FROM grain_status_check WHERE id = #{id}
  323. </delete>
  324. <delete id="deleteByIds" parameterType="java.util.List">
  325. DELETE FROM grain_status_check WHERE id IN
  326. <foreach collection="list" index="index" item="item" open="(" separator="," close=")">
  327. #{item}
  328. </foreach>
  329. </delete>
  330. <update id="deleteByIdOpen" parameterType="cn.ourwill.module.house.entity.intelcontrol.GrainStatusCheck">
  331. UPDATE grain_status_check <set>
  332. <if test="id != null">
  333. status= #{status} ,
  334. </if>
  335. </set>
  336. WHERE id = #{id}
  337. </update>
  338. </mapper>