DailyRecordGrainregulationDao.xml 14 KB

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