TFumigationPlanMapper.xml 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828
  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="com.chinaitop.depot.intelligent.fumigation.mapper.TFumigationPlanMapper" >
  4. <resultMap id="BaseResultMap" type="com.chinaitop.depot.intelligent.fumigation.model.TFumigationPlan" >
  5. <id column="id" property="id" jdbcType="VARCHAR" />
  6. <result column="house_id" property="houseId" jdbcType="INTEGER" />
  7. <result column="keeper" property="keeper" jdbcType="INTEGER" />
  8. <result column="grain_kind" property="grainKind" jdbcType="INTEGER" />
  9. <result column="grain_count" property="grainCount" jdbcType="DECIMAL" />
  10. <result column="grain_storage_time" property="grainStorageTime" jdbcType="TIMESTAMP" />
  11. <result column="fumigation_type" property="fumigationType" jdbcType="INTEGER" />
  12. <result column="fumigation_number" property="fumigationNumber" jdbcType="INTEGER" />
  13. <result column="fumigation_command" property="fumigationCommand" jdbcType="VARCHAR" />
  14. <result column="fumigation_operation" property="fumigationOperation" jdbcType="VARCHAR" />
  15. <result column="fumiagtion_protective" property="fumiagtionProtective" jdbcType="VARCHAR" />
  16. <result column="expected" property="expected" jdbcType="VARCHAR" />
  17. <result column="points_work" property="pointsWork" jdbcType="VARCHAR" />
  18. <result column="note" property="note" jdbcType="VARCHAR" />
  19. <result column="state" property="state" jdbcType="INTEGER" />
  20. <result column="creater" property="creater" jdbcType="VARCHAR" />
  21. <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
  22. <result column="approve_people" property="approvePeople" jdbcType="VARCHAR" />
  23. <result column="approve_department" property="approveDepartment" jdbcType="VARCHAR" />
  24. <result column="approve_note" property="approveNote" jdbcType="VARCHAR" />
  25. <result column="approve_time" property="approveTime" jdbcType="TIMESTAMP" />
  26. <result column="delete_state" property="deleteState" jdbcType="VARCHAR" />
  27. <result column="org_id" property="orgId" jdbcType="VARCHAR" />
  28. <result column="fumigation_frequency" property="fumigationFrequency" jdbcType="INTEGER" />
  29. <result column="cgxzfs" property="cgxzfs" jdbcType="VARCHAR" />
  30. <result column="hlxzfs" property="hlxzfs" jdbcType="VARCHAR" />
  31. <result column="hlxzynhljsjh" property="hlxzynhljsjh" jdbcType="VARCHAR" />
  32. <result column="xzfazd" property="xzfazd" jdbcType="VARCHAR" />
  33. <result column="xzfaqcr" property="xzfaqcr" jdbcType="VARCHAR" />
  34. <result column="xzfapzr" property="xzfapzr" jdbcType="VARCHAR" />
  35. <result column="xzfabbqk" property="xzfabbqk" jdbcType="VARCHAR" />
  36. <result column="xzfzr" property="xzfzr" jdbcType="VARCHAR" />
  37. <result column="hcjcdh" property="hcjcdh" jdbcType="VARCHAR" />
  38. <result column="updatetime" property="updatetime" jdbcType="TIMESTAMP" />
  39. </resultMap>
  40. <sql id="Example_Where_Clause" >
  41. <where >
  42. <foreach collection="oredCriteria" item="criteria" separator="or" >
  43. <if test="criteria.valid" >
  44. <trim prefix="(" suffix=")" prefixOverrides="and" >
  45. <foreach collection="criteria.criteria" item="criterion" >
  46. <choose >
  47. <when test="criterion.noValue" >
  48. and ${criterion.condition}
  49. </when>
  50. <when test="criterion.singleValue" >
  51. and ${criterion.condition} #{criterion.value}
  52. </when>
  53. <when test="criterion.betweenValue" >
  54. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  55. </when>
  56. <when test="criterion.listValue" >
  57. and ${criterion.condition}
  58. <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
  59. #{listItem}
  60. </foreach>
  61. </when>
  62. </choose>
  63. </foreach>
  64. </trim>
  65. </if>
  66. </foreach>
  67. </where>
  68. </sql>
  69. <sql id="Update_By_Example_Where_Clause" >
  70. <where >
  71. <foreach collection="example.oredCriteria" item="criteria" separator="or" >
  72. <if test="criteria.valid" >
  73. <trim prefix="(" suffix=")" prefixOverrides="and" >
  74. <foreach collection="criteria.criteria" item="criterion" >
  75. <choose >
  76. <when test="criterion.noValue" >
  77. and ${criterion.condition}
  78. </when>
  79. <when test="criterion.singleValue" >
  80. and ${criterion.condition} #{criterion.value}
  81. </when>
  82. <when test="criterion.betweenValue" >
  83. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  84. </when>
  85. <when test="criterion.listValue" >
  86. and ${criterion.condition}
  87. <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
  88. #{listItem}
  89. </foreach>
  90. </when>
  91. </choose>
  92. </foreach>
  93. </trim>
  94. </if>
  95. </foreach>
  96. </where>
  97. </sql>
  98. <sql id="Base_Column_List" >
  99. id, house_id, keeper, grain_kind, grain_count, grain_storage_time, fumigation_type,
  100. fumigation_number, fumigation_command, fumigation_operation, fumiagtion_protective,
  101. expected, points_work, note, state, creater, create_time, approve_people, approve_department,
  102. approve_note, approve_time, delete_state, org_id, fumigation_frequency, cgxzfs, hlxzfs,
  103. hlxzynhljsjh, xzfazd, xzfaqcr, xzfapzr, xzfabbqk, xzfzr, hcjcdh, updatetime
  104. </sql>
  105. <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.chinaitop.depot.intelligent.fumigation.model.TFumigationPlanExample" >
  106. select
  107. <if test="distinct" >
  108. distinct
  109. </if>
  110. <include refid="Base_Column_List" />
  111. from t_fumigation_plan
  112. <if test="_parameter != null" >
  113. <include refid="Example_Where_Clause" />
  114. </if>
  115. <if test="orderByClause != null" >
  116. order by ${orderByClause}
  117. </if>
  118. </select>
  119. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
  120. select
  121. <include refid="Base_Column_List" />
  122. from t_fumigation_plan
  123. where id = #{id,jdbcType=VARCHAR}
  124. </select>
  125. <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
  126. delete from t_fumigation_plan
  127. where id = #{id,jdbcType=VARCHAR}
  128. </delete>
  129. <delete id="deleteByExample" parameterType="com.chinaitop.depot.intelligent.fumigation.model.TFumigationPlanExample" >
  130. delete from t_fumigation_plan
  131. <if test="_parameter != null" >
  132. <include refid="Example_Where_Clause" />
  133. </if>
  134. </delete>
  135. <insert id="insert" useGeneratedKeys="true" keyProperty="id" parameterType="com.chinaitop.depot.intelligent.fumigation.model.TFumigationPlan" >
  136. insert into t_fumigation_plan (id, house_id, keeper,
  137. grain_kind, grain_count, grain_storage_time,
  138. fumigation_type, fumigation_number, fumigation_command,
  139. fumigation_operation, fumiagtion_protective,
  140. expected, points_work, note,
  141. state, creater, create_time,
  142. approve_people, approve_department, approve_note,
  143. approve_time, delete_state, org_id,
  144. fumigation_frequency, cgxzfs, hlxzfs,
  145. hlxzynhljsjh, xzfazd, xzfaqcr,
  146. xzfapzr, xzfabbqk, xzfzr,
  147. hcjcdh, updatetime)
  148. values (#{id,jdbcType=VARCHAR}, #{houseId,jdbcType=INTEGER}, #{keeper,jdbcType=INTEGER},
  149. #{grainKind,jdbcType=INTEGER}, #{grainCount,jdbcType=DECIMAL}, #{grainStorageTime,jdbcType=TIMESTAMP},
  150. #{fumigationType,jdbcType=INTEGER}, #{fumigationNumber,jdbcType=INTEGER}, #{fumigationCommand,jdbcType=VARCHAR},
  151. #{fumigationOperation,jdbcType=VARCHAR}, #{fumiagtionProtective,jdbcType=VARCHAR},
  152. #{expected,jdbcType=VARCHAR}, #{pointsWork,jdbcType=VARCHAR}, #{note,jdbcType=VARCHAR},
  153. #{state,jdbcType=INTEGER}, #{creater,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
  154. #{approvePeople,jdbcType=VARCHAR}, #{approveDepartment,jdbcType=VARCHAR}, #{approveNote,jdbcType=VARCHAR},
  155. #{approveTime,jdbcType=TIMESTAMP}, #{deleteState,jdbcType=VARCHAR}, #{orgId,jdbcType=VARCHAR},
  156. #{fumigationFrequency,jdbcType=INTEGER}, #{cgxzfs,jdbcType=VARCHAR}, #{hlxzfs,jdbcType=VARCHAR},
  157. #{hlxzynhljsjh,jdbcType=VARCHAR}, #{xzfazd,jdbcType=VARCHAR}, #{xzfaqcr,jdbcType=VARCHAR},
  158. #{xzfapzr,jdbcType=VARCHAR}, #{xzfabbqk,jdbcType=VARCHAR}, #{xzfzr,jdbcType=VARCHAR},
  159. #{hcjcdh,jdbcType=VARCHAR}, #{updatetime,jdbcType=TIMESTAMP})
  160. </insert>
  161. <insert id="insertSelective" parameterType="com.chinaitop.depot.intelligent.fumigation.model.TFumigationPlan" >
  162. insert into t_fumigation_plan
  163. <trim prefix="(" suffix=")" suffixOverrides="," >
  164. <if test="id != null" >
  165. id,
  166. </if>
  167. <if test="houseId != null" >
  168. house_id,
  169. </if>
  170. <if test="keeper != null" >
  171. keeper,
  172. </if>
  173. <if test="grainKind != null" >
  174. grain_kind,
  175. </if>
  176. <if test="grainCount != null" >
  177. grain_count,
  178. </if>
  179. <if test="grainStorageTime != null" >
  180. grain_storage_time,
  181. </if>
  182. <if test="fumigationType != null" >
  183. fumigation_type,
  184. </if>
  185. <if test="fumigationNumber != null" >
  186. fumigation_number,
  187. </if>
  188. <if test="fumigationCommand != null" >
  189. fumigation_command,
  190. </if>
  191. <if test="fumigationOperation != null" >
  192. fumigation_operation,
  193. </if>
  194. <if test="fumiagtionProtective != null" >
  195. fumiagtion_protective,
  196. </if>
  197. <if test="expected != null" >
  198. expected,
  199. </if>
  200. <if test="pointsWork != null" >
  201. points_work,
  202. </if>
  203. <if test="note != null" >
  204. note,
  205. </if>
  206. <if test="state != null" >
  207. state,
  208. </if>
  209. <if test="creater != null" >
  210. creater,
  211. </if>
  212. <if test="createTime != null" >
  213. create_time,
  214. </if>
  215. <if test="approvePeople != null" >
  216. approve_people,
  217. </if>
  218. <if test="approveDepartment != null" >
  219. approve_department,
  220. </if>
  221. <if test="approveNote != null" >
  222. approve_note,
  223. </if>
  224. <if test="approveTime != null" >
  225. approve_time,
  226. </if>
  227. <if test="deleteState != null" >
  228. delete_state,
  229. </if>
  230. <if test="orgId != null" >
  231. org_id,
  232. </if>
  233. <if test="fumigationFrequency != null" >
  234. fumigation_frequency,
  235. </if>
  236. <if test="cgxzfs != null" >
  237. cgxzfs,
  238. </if>
  239. <if test="hlxzfs != null" >
  240. hlxzfs,
  241. </if>
  242. <if test="hlxzynhljsjh != null" >
  243. hlxzynhljsjh,
  244. </if>
  245. <if test="xzfazd != null" >
  246. xzfazd,
  247. </if>
  248. <if test="xzfaqcr != null" >
  249. xzfaqcr,
  250. </if>
  251. <if test="xzfapzr != null" >
  252. xzfapzr,
  253. </if>
  254. <if test="xzfabbqk != null" >
  255. xzfabbqk,
  256. </if>
  257. <if test="xzfzr != null" >
  258. xzfzr,
  259. </if>
  260. <if test="hcjcdh != null" >
  261. hcjcdh,
  262. </if>
  263. <if test="updatetime != null" >
  264. updatetime,
  265. </if>
  266. </trim>
  267. <trim prefix="values (" suffix=")" suffixOverrides="," >
  268. <if test="id != null" >
  269. #{id,jdbcType=VARCHAR},
  270. </if>
  271. <if test="houseId != null" >
  272. #{houseId,jdbcType=INTEGER},
  273. </if>
  274. <if test="keeper != null" >
  275. #{keeper,jdbcType=INTEGER},
  276. </if>
  277. <if test="grainKind != null" >
  278. #{grainKind,jdbcType=INTEGER},
  279. </if>
  280. <if test="grainCount != null" >
  281. #{grainCount,jdbcType=DECIMAL},
  282. </if>
  283. <if test="grainStorageTime != null" >
  284. #{grainStorageTime,jdbcType=TIMESTAMP},
  285. </if>
  286. <if test="fumigationType != null" >
  287. #{fumigationType,jdbcType=INTEGER},
  288. </if>
  289. <if test="fumigationNumber != null" >
  290. #{fumigationNumber,jdbcType=INTEGER},
  291. </if>
  292. <if test="fumigationCommand != null" >
  293. #{fumigationCommand,jdbcType=VARCHAR},
  294. </if>
  295. <if test="fumigationOperation != null" >
  296. #{fumigationOperation,jdbcType=VARCHAR},
  297. </if>
  298. <if test="fumiagtionProtective != null" >
  299. #{fumiagtionProtective,jdbcType=VARCHAR},
  300. </if>
  301. <if test="expected != null" >
  302. #{expected,jdbcType=VARCHAR},
  303. </if>
  304. <if test="pointsWork != null" >
  305. #{pointsWork,jdbcType=VARCHAR},
  306. </if>
  307. <if test="note != null" >
  308. #{note,jdbcType=VARCHAR},
  309. </if>
  310. <if test="state != null" >
  311. #{state,jdbcType=INTEGER},
  312. </if>
  313. <if test="creater != null" >
  314. #{creater,jdbcType=VARCHAR},
  315. </if>
  316. <if test="createTime != null" >
  317. #{createTime,jdbcType=TIMESTAMP},
  318. </if>
  319. <if test="approvePeople != null" >
  320. #{approvePeople,jdbcType=VARCHAR},
  321. </if>
  322. <if test="approveDepartment != null" >
  323. #{approveDepartment,jdbcType=VARCHAR},
  324. </if>
  325. <if test="approveNote != null" >
  326. #{approveNote,jdbcType=VARCHAR},
  327. </if>
  328. <if test="approveTime != null" >
  329. #{approveTime,jdbcType=TIMESTAMP},
  330. </if>
  331. <if test="deleteState != null" >
  332. #{deleteState,jdbcType=VARCHAR},
  333. </if>
  334. <if test="orgId != null" >
  335. #{orgId,jdbcType=VARCHAR},
  336. </if>
  337. <if test="fumigationFrequency != null" >
  338. #{fumigationFrequency,jdbcType=INTEGER},
  339. </if>
  340. <if test="cgxzfs != null" >
  341. #{cgxzfs,jdbcType=VARCHAR},
  342. </if>
  343. <if test="hlxzfs != null" >
  344. #{hlxzfs,jdbcType=VARCHAR},
  345. </if>
  346. <if test="hlxzynhljsjh != null" >
  347. #{hlxzynhljsjh,jdbcType=VARCHAR},
  348. </if>
  349. <if test="xzfazd != null" >
  350. #{xzfazd,jdbcType=VARCHAR},
  351. </if>
  352. <if test="xzfaqcr != null" >
  353. #{xzfaqcr,jdbcType=VARCHAR},
  354. </if>
  355. <if test="xzfapzr != null" >
  356. #{xzfapzr,jdbcType=VARCHAR},
  357. </if>
  358. <if test="xzfabbqk != null" >
  359. #{xzfabbqk,jdbcType=VARCHAR},
  360. </if>
  361. <if test="xzfzr != null" >
  362. #{xzfzr,jdbcType=VARCHAR},
  363. </if>
  364. <if test="hcjcdh != null" >
  365. #{hcjcdh,jdbcType=VARCHAR},
  366. </if>
  367. <if test="updatetime != null" >
  368. #{updatetime,jdbcType=TIMESTAMP},
  369. </if>
  370. </trim>
  371. </insert>
  372. <select id="countByExample" parameterType="com.chinaitop.depot.intelligent.fumigation.model.TFumigationPlanExample" resultType="java.lang.Integer" >
  373. select count(*) from t_fumigation_plan
  374. <if test="_parameter != null" >
  375. <include refid="Example_Where_Clause" />
  376. </if>
  377. </select>
  378. <update id="updateByExampleSelective" parameterType="map" >
  379. update t_fumigation_plan
  380. <set >
  381. <if test="record.id != null" >
  382. id = #{record.id,jdbcType=VARCHAR},
  383. </if>
  384. <if test="record.houseId != null" >
  385. house_id = #{record.houseId,jdbcType=INTEGER},
  386. </if>
  387. <if test="record.keeper != null" >
  388. keeper = #{record.keeper,jdbcType=INTEGER},
  389. </if>
  390. <if test="record.grainKind != null" >
  391. grain_kind = #{record.grainKind,jdbcType=INTEGER},
  392. </if>
  393. <if test="record.grainCount != null" >
  394. grain_count = #{record.grainCount,jdbcType=DECIMAL},
  395. </if>
  396. <if test="record.grainStorageTime != null" >
  397. grain_storage_time = #{record.grainStorageTime,jdbcType=TIMESTAMP},
  398. </if>
  399. <if test="record.fumigationType != null" >
  400. fumigation_type = #{record.fumigationType,jdbcType=INTEGER},
  401. </if>
  402. <if test="record.fumigationNumber != null" >
  403. fumigation_number = #{record.fumigationNumber,jdbcType=INTEGER},
  404. </if>
  405. <if test="record.fumigationCommand != null" >
  406. fumigation_command = #{record.fumigationCommand,jdbcType=VARCHAR},
  407. </if>
  408. <if test="record.fumigationOperation != null" >
  409. fumigation_operation = #{record.fumigationOperation,jdbcType=VARCHAR},
  410. </if>
  411. <if test="record.fumiagtionProtective != null" >
  412. fumiagtion_protective = #{record.fumiagtionProtective,jdbcType=VARCHAR},
  413. </if>
  414. <if test="record.expected != null" >
  415. expected = #{record.expected,jdbcType=VARCHAR},
  416. </if>
  417. <if test="record.pointsWork != null" >
  418. points_work = #{record.pointsWork,jdbcType=VARCHAR},
  419. </if>
  420. <if test="record.note != null" >
  421. note = #{record.note,jdbcType=VARCHAR},
  422. </if>
  423. <if test="record.state != null" >
  424. state = #{record.state,jdbcType=INTEGER},
  425. </if>
  426. <if test="record.creater != null" >
  427. creater = #{record.creater,jdbcType=VARCHAR},
  428. </if>
  429. <if test="record.createTime != null" >
  430. create_time = #{record.createTime,jdbcType=TIMESTAMP},
  431. </if>
  432. <if test="record.approvePeople != null" >
  433. approve_people = #{record.approvePeople,jdbcType=VARCHAR},
  434. </if>
  435. <if test="record.approveDepartment != null" >
  436. approve_department = #{record.approveDepartment,jdbcType=VARCHAR},
  437. </if>
  438. <if test="record.approveNote != null" >
  439. approve_note = #{record.approveNote,jdbcType=VARCHAR},
  440. </if>
  441. <if test="record.approveTime != null" >
  442. approve_time = #{record.approveTime,jdbcType=TIMESTAMP},
  443. </if>
  444. <if test="record.deleteState != null" >
  445. delete_state = #{record.deleteState,jdbcType=VARCHAR},
  446. </if>
  447. <if test="record.orgId != null" >
  448. org_id = #{record.orgId,jdbcType=VARCHAR},
  449. </if>
  450. <if test="record.fumigationFrequency != null" >
  451. fumigation_frequency = #{record.fumigationFrequency,jdbcType=INTEGER},
  452. </if>
  453. <if test="record.cgxzfs != null" >
  454. cgxzfs = #{record.cgxzfs,jdbcType=VARCHAR},
  455. </if>
  456. <if test="record.hlxzfs != null" >
  457. hlxzfs = #{record.hlxzfs,jdbcType=VARCHAR},
  458. </if>
  459. <if test="record.hlxzynhljsjh != null" >
  460. hlxzynhljsjh = #{record.hlxzynhljsjh,jdbcType=VARCHAR},
  461. </if>
  462. <if test="record.xzfazd != null" >
  463. xzfazd = #{record.xzfazd,jdbcType=VARCHAR},
  464. </if>
  465. <if test="record.xzfaqcr != null" >
  466. xzfaqcr = #{record.xzfaqcr,jdbcType=VARCHAR},
  467. </if>
  468. <if test="record.xzfapzr != null" >
  469. xzfapzr = #{record.xzfapzr,jdbcType=VARCHAR},
  470. </if>
  471. <if test="record.xzfabbqk != null" >
  472. xzfabbqk = #{record.xzfabbqk,jdbcType=VARCHAR},
  473. </if>
  474. <if test="record.xzfzr != null" >
  475. xzfzr = #{record.xzfzr,jdbcType=VARCHAR},
  476. </if>
  477. <if test="record.hcjcdh != null" >
  478. hcjcdh = #{record.hcjcdh,jdbcType=VARCHAR},
  479. </if>
  480. <if test="record.updatetime != null" >
  481. updatetime = #{record.updatetime,jdbcType=TIMESTAMP},
  482. </if>
  483. </set>
  484. <if test="_parameter != null" >
  485. <include refid="Update_By_Example_Where_Clause" />
  486. </if>
  487. </update>
  488. <update id="updateByExample" parameterType="map" >
  489. update t_fumigation_plan
  490. set id = #{record.id,jdbcType=VARCHAR},
  491. house_id = #{record.houseId,jdbcType=INTEGER},
  492. keeper = #{record.keeper,jdbcType=INTEGER},
  493. grain_kind = #{record.grainKind,jdbcType=INTEGER},
  494. grain_count = #{record.grainCount,jdbcType=DECIMAL},
  495. grain_storage_time = #{record.grainStorageTime,jdbcType=TIMESTAMP},
  496. fumigation_type = #{record.fumigationType,jdbcType=INTEGER},
  497. fumigation_number = #{record.fumigationNumber,jdbcType=INTEGER},
  498. fumigation_command = #{record.fumigationCommand,jdbcType=VARCHAR},
  499. fumigation_operation = #{record.fumigationOperation,jdbcType=VARCHAR},
  500. fumiagtion_protective = #{record.fumiagtionProtective,jdbcType=VARCHAR},
  501. expected = #{record.expected,jdbcType=VARCHAR},
  502. points_work = #{record.pointsWork,jdbcType=VARCHAR},
  503. note = #{record.note,jdbcType=VARCHAR},
  504. state = #{record.state,jdbcType=INTEGER},
  505. creater = #{record.creater,jdbcType=VARCHAR},
  506. create_time = #{record.createTime,jdbcType=TIMESTAMP},
  507. approve_people = #{record.approvePeople,jdbcType=VARCHAR},
  508. approve_department = #{record.approveDepartment,jdbcType=VARCHAR},
  509. approve_note = #{record.approveNote,jdbcType=VARCHAR},
  510. approve_time = #{record.approveTime,jdbcType=TIMESTAMP},
  511. delete_state = #{record.deleteState,jdbcType=VARCHAR},
  512. org_id = #{record.orgId,jdbcType=VARCHAR},
  513. fumigation_frequency = #{record.fumigationFrequency,jdbcType=INTEGER},
  514. cgxzfs = #{record.cgxzfs,jdbcType=VARCHAR},
  515. hlxzfs = #{record.hlxzfs,jdbcType=VARCHAR},
  516. hlxzynhljsjh = #{record.hlxzynhljsjh,jdbcType=VARCHAR},
  517. xzfazd = #{record.xzfazd,jdbcType=VARCHAR},
  518. xzfaqcr = #{record.xzfaqcr,jdbcType=VARCHAR},
  519. xzfapzr = #{record.xzfapzr,jdbcType=VARCHAR},
  520. xzfabbqk = #{record.xzfabbqk,jdbcType=VARCHAR},
  521. xzfzr = #{record.xzfzr,jdbcType=VARCHAR},
  522. hcjcdh = #{record.hcjcdh,jdbcType=VARCHAR},
  523. updatetime = #{record.updatetime,jdbcType=TIMESTAMP}
  524. <if test="_parameter != null" >
  525. <include refid="Update_By_Example_Where_Clause" />
  526. </if>
  527. </update>
  528. <update id="updateByPrimaryKeySelective" parameterType="com.chinaitop.depot.intelligent.fumigation.model.TFumigationPlan" >
  529. update t_fumigation_plan
  530. <set >
  531. <if test="houseId != null" >
  532. house_id = #{houseId,jdbcType=INTEGER},
  533. </if>
  534. <if test="keeper != null" >
  535. keeper = #{keeper,jdbcType=INTEGER},
  536. </if>
  537. <if test="grainKind != null" >
  538. grain_kind = #{grainKind,jdbcType=INTEGER},
  539. </if>
  540. <if test="grainCount != null" >
  541. grain_count = #{grainCount,jdbcType=DECIMAL},
  542. </if>
  543. <if test="grainStorageTime != null" >
  544. grain_storage_time = #{grainStorageTime,jdbcType=TIMESTAMP},
  545. </if>
  546. <if test="fumigationType != null" >
  547. fumigation_type = #{fumigationType,jdbcType=INTEGER},
  548. </if>
  549. <if test="fumigationNumber != null" >
  550. fumigation_number = #{fumigationNumber,jdbcType=INTEGER},
  551. </if>
  552. <if test="fumigationCommand != null" >
  553. fumigation_command = #{fumigationCommand,jdbcType=VARCHAR},
  554. </if>
  555. <if test="fumigationOperation != null" >
  556. fumigation_operation = #{fumigationOperation,jdbcType=VARCHAR},
  557. </if>
  558. <if test="fumiagtionProtective != null" >
  559. fumiagtion_protective = #{fumiagtionProtective,jdbcType=VARCHAR},
  560. </if>
  561. <if test="expected != null" >
  562. expected = #{expected,jdbcType=VARCHAR},
  563. </if>
  564. <if test="pointsWork != null" >
  565. points_work = #{pointsWork,jdbcType=VARCHAR},
  566. </if>
  567. <if test="note != null" >
  568. note = #{note,jdbcType=VARCHAR},
  569. </if>
  570. <if test="state != null" >
  571. state = #{state,jdbcType=INTEGER},
  572. </if>
  573. <if test="creater != null" >
  574. creater = #{creater,jdbcType=VARCHAR},
  575. </if>
  576. <if test="createTime != null" >
  577. create_time = #{createTime,jdbcType=TIMESTAMP},
  578. </if>
  579. <if test="approvePeople != null" >
  580. approve_people = #{approvePeople,jdbcType=VARCHAR},
  581. </if>
  582. <if test="approveDepartment != null" >
  583. approve_department = #{approveDepartment,jdbcType=VARCHAR},
  584. </if>
  585. <if test="approveNote != null" >
  586. approve_note = #{approveNote,jdbcType=VARCHAR},
  587. </if>
  588. <if test="approveTime != null" >
  589. approve_time = #{approveTime,jdbcType=TIMESTAMP},
  590. </if>
  591. <if test="deleteState != null" >
  592. delete_state = #{deleteState,jdbcType=VARCHAR},
  593. </if>
  594. <if test="orgId != null" >
  595. org_id = #{orgId,jdbcType=VARCHAR},
  596. </if>
  597. <if test="fumigationFrequency != null" >
  598. fumigation_frequency = #{fumigationFrequency,jdbcType=INTEGER},
  599. </if>
  600. <if test="cgxzfs != null" >
  601. cgxzfs = #{cgxzfs,jdbcType=VARCHAR},
  602. </if>
  603. <if test="hlxzfs != null" >
  604. hlxzfs = #{hlxzfs,jdbcType=VARCHAR},
  605. </if>
  606. <if test="hlxzynhljsjh != null" >
  607. hlxzynhljsjh = #{hlxzynhljsjh,jdbcType=VARCHAR},
  608. </if>
  609. <if test="xzfazd != null" >
  610. xzfazd = #{xzfazd,jdbcType=VARCHAR},
  611. </if>
  612. <if test="xzfaqcr != null" >
  613. xzfaqcr = #{xzfaqcr,jdbcType=VARCHAR},
  614. </if>
  615. <if test="xzfapzr != null" >
  616. xzfapzr = #{xzfapzr,jdbcType=VARCHAR},
  617. </if>
  618. <if test="xzfabbqk != null" >
  619. xzfabbqk = #{xzfabbqk,jdbcType=VARCHAR},
  620. </if>
  621. <if test="xzfzr != null" >
  622. xzfzr = #{xzfzr,jdbcType=VARCHAR},
  623. </if>
  624. <if test="hcjcdh != null" >
  625. hcjcdh = #{hcjcdh,jdbcType=VARCHAR},
  626. </if>
  627. <if test="updatetime != null" >
  628. updatetime = #{updatetime,jdbcType=TIMESTAMP},
  629. </if>
  630. </set>
  631. where id = #{id,jdbcType=VARCHAR}
  632. </update>
  633. <update id="updateByPrimaryKey" parameterType="com.chinaitop.depot.intelligent.fumigation.model.TFumigationPlan" >
  634. update t_fumigation_plan
  635. set house_id = #{houseId,jdbcType=INTEGER},
  636. keeper = #{keeper,jdbcType=INTEGER},
  637. grain_kind = #{grainKind,jdbcType=INTEGER},
  638. grain_count = #{grainCount,jdbcType=DECIMAL},
  639. grain_storage_time = #{grainStorageTime,jdbcType=TIMESTAMP},
  640. fumigation_type = #{fumigationType,jdbcType=INTEGER},
  641. fumigation_number = #{fumigationNumber,jdbcType=INTEGER},
  642. fumigation_command = #{fumigationCommand,jdbcType=VARCHAR},
  643. fumigation_operation = #{fumigationOperation,jdbcType=VARCHAR},
  644. fumiagtion_protective = #{fumiagtionProtective,jdbcType=VARCHAR},
  645. expected = #{expected,jdbcType=VARCHAR},
  646. points_work = #{pointsWork,jdbcType=VARCHAR},
  647. note = #{note,jdbcType=VARCHAR},
  648. state = #{state,jdbcType=INTEGER},
  649. creater = #{creater,jdbcType=VARCHAR},
  650. create_time = #{createTime,jdbcType=TIMESTAMP},
  651. approve_people = #{approvePeople,jdbcType=VARCHAR},
  652. approve_department = #{approveDepartment,jdbcType=VARCHAR},
  653. approve_note = #{approveNote,jdbcType=VARCHAR},
  654. approve_time = #{approveTime,jdbcType=TIMESTAMP},
  655. delete_state = #{deleteState,jdbcType=VARCHAR},
  656. org_id = #{orgId,jdbcType=VARCHAR},
  657. fumigation_frequency = #{fumigationFrequency,jdbcType=INTEGER},
  658. cgxzfs = #{cgxzfs,jdbcType=VARCHAR},
  659. hlxzfs = #{hlxzfs,jdbcType=VARCHAR},
  660. hlxzynhljsjh = #{hlxzynhljsjh,jdbcType=VARCHAR},
  661. xzfazd = #{xzfazd,jdbcType=VARCHAR},
  662. xzfaqcr = #{xzfaqcr,jdbcType=VARCHAR},
  663. xzfapzr = #{xzfapzr,jdbcType=VARCHAR},
  664. xzfabbqk = #{xzfabbqk,jdbcType=VARCHAR},
  665. xzfzr = #{xzfzr,jdbcType=VARCHAR},
  666. hcjcdh = #{hcjcdh,jdbcType=VARCHAR},
  667. updatetime = #{updatetime,jdbcType=TIMESTAMP}
  668. where id = #{id,jdbcType=VARCHAR}
  669. </update>
  670. <select id="selectPlanQueryList" parameterType="java.util.Map" resultType="java.util.HashMap">
  671. SELECT
  672. 1 AS planType,
  673. plan.id,
  674. plan.house_id AS houseId,
  675. keeper. NAME AS keeperName,
  676. plan.create_time AS createTime,
  677. plan.approve_time AS approveTime,
  678. plan.fumigation_type AS way,
  679. plan.fumigation_operation AS operation,
  680. (
  681. CASE plan.state
  682. WHEN '0' THEN
  683. '待提交'
  684. WHEN '1' THEN
  685. '待审批'
  686. WHEN '2' THEN
  687. '审批驳回'
  688. WHEN '3' THEN
  689. '审批拒绝'
  690. ELSE
  691. '审批通过'
  692. END
  693. ) AS state,
  694. plan.state stateType
  695. FROM
  696. t_fumigation_plan plan
  697. LEFT JOIN basic_keeper keeper ON keeper.id = plan.keeper
  698. WHERE plan.delete_state = 1 AND plan.org_id = #{orgId,jdbcType=INTEGER}
  699. <if test="houseId != null" >
  700. AND plan.house_id = #{houseId,jdbcType=INTEGER}
  701. </if>
  702. UNION ALL
  703. SELECT
  704. 2 AS planType,
  705. pesticide.id,
  706. plan.house_id AS houseId,
  707. keeper. NAME AS keeperName,
  708. pesticide.create_time AS createTime,
  709. pesticide.approve_time AS approveTime,
  710. pesticide.use_drug_type AS way,
  711. pesticide.pesticide_operator AS operator,
  712. (
  713. CASE pesticide.state
  714. WHEN '0' THEN
  715. '施药待提交'
  716. WHEN '1' THEN
  717. '施药待审批'
  718. WHEN '2' THEN
  719. '施药审批驳回'
  720. WHEN '3' THEN
  721. '施药审批拒绝'
  722. ELSE
  723. '施药审批通过'
  724. END
  725. ) AS state,
  726. pesticide.state stateType
  727. FROM
  728. t_fumigation_pesticide pesticide
  729. LEFT JOIN t_fumigation_plan plan ON plan.id = pesticide.fumigation_id
  730. LEFT JOIN basic_keeper keeper ON keeper.id = plan.keeper
  731. WHERE pesticide.delete_state = 1 AND pesticide.org_id = #{orgId,jdbcType=INTEGER}
  732. <if test="houseId != null" >
  733. AND plan.house_id = #{houseId,jdbcType=INTEGER}
  734. </if>
  735. </select>
  736. <select id="getAllQueryList" parameterType="java.util.Map" resultType="java.util.HashMap">
  737. SELECT
  738. plan.id,
  739. plan.house_id AS houseId,
  740. plan.create_time AS createTime,
  741. plan.approve_time AS approveTime,
  742. plan.fumigation_type AS way,
  743. plan.grain_kind,
  744. plan.org_id,
  745. pesticide.drug_name,
  746. (
  747. CASE plan.state
  748. WHEN '0' THEN
  749. '待提交'
  750. WHEN '1' THEN
  751. '待审批'
  752. WHEN '2' THEN
  753. '审批驳回'
  754. WHEN '3' THEN
  755. '审批拒绝'
  756. ELSE
  757. '审批通过'
  758. END
  759. ) AS state
  760. FROM
  761. t_fumigation_plan plan
  762. LEFT JOIN basic_keeper keeper ON keeper.id = plan.keeper
  763. LEFT JOIN t_fumigation_pesticide pesticide ON pesticide.fumigation_id = plan.id
  764. WHERE plan.org_id = #{orgId,jdbcType=INTEGER}
  765. </select>
  766. <select id="getFumigationApproveList" parameterType="java.util.Map" resultType="java.util.HashMap">
  767. SELECT
  768. plan.id,
  769. plan.house_id houseId,
  770. plan.grain_kind grainKind,
  771. pes.drug_name drugName,
  772. plan.fumigation_type fumigationType,
  773. plan.fumigation_command fumigationCommand,
  774. approval.create_time createTime,
  775. plan.state, approval.id auditId,
  776. approval.result result,
  777. approval.task_id taskId,
  778. approval.task_name taskName,
  779. approval.operator operator
  780. FROM
  781. t_fumigation_plan plan
  782. LEFT JOIN t_fumigation_pesticide pes ON pes.fumigation_id = plan.id
  783. LEFT JOIN business_approval approval ON plan.id = approval.task_id
  784. WHERE plan.org_id = #{orgId,jdbcType=INTEGER}
  785. AND (plan.state = 2 OR plan.state = 3)
  786. AND approval.operator = #{userId}
  787. <if test="houseId != null" >
  788. AND plan.house_id = #{houseId,jdbcType=INTEGER}
  789. </if>
  790. </select>
  791. <select id="getProcessList" resultMap="BaseResultMap" parameterType="java.util.Map" >
  792. select
  793. plan.*
  794. FROM t_fumigation_plan plan
  795. LEFT JOIN t_fumigation_process pro ON pro.fumigation_id = plan.id
  796. WHERE 1=1
  797. <if test="houseId != null" >
  798. AND plan.house_id = #{houseId,jdbcType=INTEGER}
  799. </if>
  800. <if test="orgId != null" >
  801. AND plan.org_id = #{orgId,jdbcType=INTEGER}
  802. </if>
  803. <if test="state != null" >
  804. AND plan.state = #{state,jdbcType=INTEGER}
  805. </if>
  806. <if test="deleteState != null" >
  807. AND plan.delete_state = #{deleteState,jdbcType=INTEGER}
  808. </if>
  809. AND pro.id IS NULL
  810. ORDER BY create_time DESC
  811. </select>
  812. <select id="getJcd" parameterType="java.util.Map" resultType="java.util.Map">
  813. SELECT
  814. tc.hcjcdh
  815. FROM
  816. basic_storehouse sh
  817. INNER JOIN t_ccvalue tc ON tc.org_id = sh.org_id AND tc.v_cf_code = sh.storehouse_code
  818. where not exists (SELECT hcjcdh FROM t_fumigation_plan tp
  819. WHERE tp.id != #{fumigationId,jdbcType=VARCHAR} AND tp.hcjcdh = tc.hcjcdh)
  820. <if test="houseId != null">
  821. AND sh.storehouse_id = #{houseId,jdbcType=INTEGER}
  822. </if>
  823. AND tc.hcjcdh is not null
  824. GROUP BY tc.hcjcdh
  825. </select>
  826. </mapper>