BusinessAgentTemperatureMapper.xml 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749
  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.agent.temperature.mapper.BusinessAgentTemperatureMapper" >
  4. <resultMap id="BaseResultMap" type="com.chinaitop.depot.agent.temperature.model.BusinessAgentTemperature" >
  5. <id column="id" property="id" jdbcType="INTEGER" />
  6. <result column="agent_id" property="agentId" jdbcType="INTEGER" />
  7. <result column="agent_depot_id" property="agentDepotId" jdbcType="INTEGER" />
  8. <result column="storehouse_id" property="storehouseId" jdbcType="INTEGER" />
  9. <result column="weather" property="weather" jdbcType="VARCHAR" />
  10. <result column="actual_amount" property="actualAmount" jdbcType="VARCHAR" />
  11. <result column="lspz" property="lspz" jdbcType="INTEGER" />
  12. <result column="nature" property="nature" jdbcType="VARCHAR" />
  13. <result column="level" property="level" jdbcType="INTEGER" />
  14. <result column="harvest_year" property="harvestYear" jdbcType="INTEGER" />
  15. <result column="enter_time" property="enterTime" jdbcType="TIMESTAMP" />
  16. <result column="keeper" property="keeper" jdbcType="VARCHAR" />
  17. <result column="house_temperature" property="houseTemperature" jdbcType="DECIMAL" />
  18. <result column="house_humidity" property="houseHumidity" jdbcType="DECIMAL" />
  19. <result column="gas_temperature" property="gasTemperature" jdbcType="DECIMAL" />
  20. <result column="gas_humidity" property="gasHumidity" jdbcType="DECIMAL" />
  21. <result column="detection_time" property="detectionTime" jdbcType="TIMESTAMP" />
  22. <result column="max" property="max" jdbcType="DECIMAL" />
  23. <result column="min" property="min" jdbcType="DECIMAL" />
  24. <result column="avg" property="avg" jdbcType="DECIMAL" />
  25. <result column="org_id" property="orgId" jdbcType="INTEGER" />
  26. <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
  27. <result column="updatetime" property="updatetime" jdbcType="TIMESTAMP" />
  28. </resultMap>
  29. <resultMap id="ResultMapWithBLOBs" type="com.chinaitop.depot.agent.temperature.model.BusinessAgentTemperature" extends="BaseResultMap" >
  30. <result column="t_points" property="tPoints" jdbcType="LONGVARCHAR" />
  31. </resultMap>
  32. <sql id="Example_Where_Clause" >
  33. <where >
  34. <foreach collection="oredCriteria" item="criteria" separator="or" >
  35. <if test="criteria.valid" >
  36. <trim prefix="(" suffix=")" prefixOverrides="and" >
  37. <foreach collection="criteria.criteria" item="criterion" >
  38. <choose >
  39. <when test="criterion.noValue" >
  40. and ${criterion.condition}
  41. </when>
  42. <when test="criterion.singleValue" >
  43. and ${criterion.condition} #{criterion.value}
  44. </when>
  45. <when test="criterion.betweenValue" >
  46. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  47. </when>
  48. <when test="criterion.listValue" >
  49. and ${criterion.condition}
  50. <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
  51. #{listItem}
  52. </foreach>
  53. </when>
  54. </choose>
  55. </foreach>
  56. </trim>
  57. </if>
  58. </foreach>
  59. </where>
  60. </sql>
  61. <sql id="Update_By_Example_Where_Clause" >
  62. <where >
  63. <foreach collection="example.oredCriteria" item="criteria" separator="or" >
  64. <if test="criteria.valid" >
  65. <trim prefix="(" suffix=")" prefixOverrides="and" >
  66. <foreach collection="criteria.criteria" item="criterion" >
  67. <choose >
  68. <when test="criterion.noValue" >
  69. and ${criterion.condition}
  70. </when>
  71. <when test="criterion.singleValue" >
  72. and ${criterion.condition} #{criterion.value}
  73. </when>
  74. <when test="criterion.betweenValue" >
  75. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  76. </when>
  77. <when test="criterion.listValue" >
  78. and ${criterion.condition}
  79. <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
  80. #{listItem}
  81. </foreach>
  82. </when>
  83. </choose>
  84. </foreach>
  85. </trim>
  86. </if>
  87. </foreach>
  88. </where>
  89. </sql>
  90. <sql id="Base_Column_List" >
  91. id, agent_id, agent_depot_id, storehouse_id, weather, actual_amount, lspz, nature,
  92. level, harvest_year, enter_time, keeper, house_temperature, house_humidity, gas_temperature,
  93. gas_humidity, detection_time, max, min, avg, org_id, create_time, updatetime
  94. </sql>
  95. <sql id="Blob_Column_List" >
  96. t_points
  97. </sql>
  98. <select id="selectByExampleWithBLOBs" resultMap="ResultMapWithBLOBs" parameterType="com.chinaitop.depot.agent.temperature.model.BusinessAgentTemperatureExample" >
  99. select
  100. <if test="distinct" >
  101. distinct
  102. </if>
  103. <include refid="Base_Column_List" />
  104. ,
  105. <include refid="Blob_Column_List" />
  106. from business_agent_temperature
  107. <if test="_parameter != null" >
  108. <include refid="Example_Where_Clause" />
  109. </if>
  110. <if test="orderByClause != null" >
  111. order by ${orderByClause}
  112. </if>
  113. </select>
  114. <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.chinaitop.depot.agent.temperature.model.BusinessAgentTemperatureExample" >
  115. select
  116. <if test="distinct" >
  117. distinct
  118. </if>
  119. <include refid="Base_Column_List" />
  120. from business_agent_temperature
  121. <if test="_parameter != null" >
  122. <include refid="Example_Where_Clause" />
  123. </if>
  124. <if test="orderByClause != null" >
  125. order by ${orderByClause}
  126. </if>
  127. </select>
  128. <select id="selectByPrimaryKey" resultMap="ResultMapWithBLOBs" parameterType="java.lang.Integer" >
  129. select
  130. <include refid="Base_Column_List" />
  131. ,
  132. <include refid="Blob_Column_List" />
  133. from business_agent_temperature
  134. where id = #{id,jdbcType=INTEGER}
  135. </select>
  136. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
  137. delete from business_agent_temperature
  138. where id = #{id,jdbcType=INTEGER}
  139. </delete>
  140. <delete id="deleteByExample" parameterType="com.chinaitop.depot.agent.temperature.model.BusinessAgentTemperatureExample" >
  141. delete from business_agent_temperature
  142. <if test="_parameter != null" >
  143. <include refid="Example_Where_Clause" />
  144. </if>
  145. </delete>
  146. <insert id="insert" useGeneratedKeys="true" keyProperty="id" parameterType="com.chinaitop.depot.agent.temperature.model.BusinessAgentTemperature" >
  147. insert into business_agent_temperature (id, agent_id, agent_depot_id,
  148. storehouse_id, weather, actual_amount,
  149. lspz, nature, level,
  150. harvest_year, enter_time, keeper,
  151. house_temperature, house_humidity, gas_temperature,
  152. gas_humidity, detection_time, max,
  153. min, avg, org_id, create_time,
  154. updatetime, t_points)
  155. values (#{id,jdbcType=INTEGER}, #{agentId,jdbcType=INTEGER}, #{agentDepotId,jdbcType=INTEGER},
  156. #{storehouseId,jdbcType=INTEGER}, #{weather,jdbcType=VARCHAR}, #{actualAmount,jdbcType=VARCHAR},
  157. #{lspz,jdbcType=INTEGER}, #{nature,jdbcType=VARCHAR}, #{level,jdbcType=INTEGER},
  158. #{harvestYear,jdbcType=INTEGER}, #{enterTime,jdbcType=TIMESTAMP}, #{keeper,jdbcType=VARCHAR},
  159. #{houseTemperature,jdbcType=DECIMAL}, #{houseHumidity,jdbcType=DECIMAL}, #{gasTemperature,jdbcType=DECIMAL},
  160. #{gasHumidity,jdbcType=DECIMAL}, #{detectionTime,jdbcType=TIMESTAMP}, #{max,jdbcType=DECIMAL},
  161. #{min,jdbcType=DECIMAL}, #{avg,jdbcType=DECIMAL}, #{orgId,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
  162. #{updatetime,jdbcType=TIMESTAMP}, #{tPoints,jdbcType=LONGVARCHAR})
  163. </insert>
  164. <insert id="insertSelective" parameterType="com.chinaitop.depot.agent.temperature.model.BusinessAgentTemperature" >
  165. insert into business_agent_temperature
  166. <trim prefix="(" suffix=")" suffixOverrides="," >
  167. <if test="id != null" >
  168. id,
  169. </if>
  170. <if test="agentId != null" >
  171. agent_id,
  172. </if>
  173. <if test="agentDepotId != null" >
  174. agent_depot_id,
  175. </if>
  176. <if test="storehouseId != null" >
  177. storehouse_id,
  178. </if>
  179. <if test="weather != null" >
  180. weather,
  181. </if>
  182. <if test="actualAmount != null" >
  183. actual_amount,
  184. </if>
  185. <if test="lspz != null" >
  186. lspz,
  187. </if>
  188. <if test="nature != null" >
  189. nature,
  190. </if>
  191. <if test="level != null" >
  192. level,
  193. </if>
  194. <if test="harvestYear != null" >
  195. harvest_year,
  196. </if>
  197. <if test="enterTime != null" >
  198. enter_time,
  199. </if>
  200. <if test="keeper != null" >
  201. keeper,
  202. </if>
  203. <if test="houseTemperature != null" >
  204. house_temperature,
  205. </if>
  206. <if test="houseHumidity != null" >
  207. house_humidity,
  208. </if>
  209. <if test="gasTemperature != null" >
  210. gas_temperature,
  211. </if>
  212. <if test="gasHumidity != null" >
  213. gas_humidity,
  214. </if>
  215. <if test="detectionTime != null" >
  216. detection_time,
  217. </if>
  218. <if test="max != null" >
  219. max,
  220. </if>
  221. <if test="min != null" >
  222. min,
  223. </if>
  224. <if test="avg != null" >
  225. avg,
  226. </if>
  227. <if test="orgId != null" >
  228. org_id,
  229. </if>
  230. <if test="createTime != null" >
  231. create_time,
  232. </if>
  233. <if test="updatetime != null" >
  234. updatetime,
  235. </if>
  236. <if test="tPoints != null" >
  237. t_points,
  238. </if>
  239. </trim>
  240. <trim prefix="values (" suffix=")" suffixOverrides="," >
  241. <if test="id != null" >
  242. #{id,jdbcType=INTEGER},
  243. </if>
  244. <if test="agentId != null" >
  245. #{agentId,jdbcType=INTEGER},
  246. </if>
  247. <if test="agentDepotId != null" >
  248. #{agentDepotId,jdbcType=INTEGER},
  249. </if>
  250. <if test="storehouseId != null" >
  251. #{storehouseId,jdbcType=INTEGER},
  252. </if>
  253. <if test="weather != null" >
  254. #{weather,jdbcType=VARCHAR},
  255. </if>
  256. <if test="actualAmount != null" >
  257. #{actualAmount,jdbcType=VARCHAR},
  258. </if>
  259. <if test="lspz != null" >
  260. #{lspz,jdbcType=INTEGER},
  261. </if>
  262. <if test="nature != null" >
  263. #{nature,jdbcType=VARCHAR},
  264. </if>
  265. <if test="level != null" >
  266. #{level,jdbcType=INTEGER},
  267. </if>
  268. <if test="harvestYear != null" >
  269. #{harvestYear,jdbcType=INTEGER},
  270. </if>
  271. <if test="enterTime != null" >
  272. #{enterTime,jdbcType=TIMESTAMP},
  273. </if>
  274. <if test="keeper != null" >
  275. #{keeper,jdbcType=VARCHAR},
  276. </if>
  277. <if test="houseTemperature != null" >
  278. #{houseTemperature,jdbcType=DECIMAL},
  279. </if>
  280. <if test="houseHumidity != null" >
  281. #{houseHumidity,jdbcType=DECIMAL},
  282. </if>
  283. <if test="gasTemperature != null" >
  284. #{gasTemperature,jdbcType=DECIMAL},
  285. </if>
  286. <if test="gasHumidity != null" >
  287. #{gasHumidity,jdbcType=DECIMAL},
  288. </if>
  289. <if test="detectionTime != null" >
  290. #{detectionTime,jdbcType=TIMESTAMP},
  291. </if>
  292. <if test="max != null" >
  293. #{max,jdbcType=DECIMAL},
  294. </if>
  295. <if test="min != null" >
  296. #{min,jdbcType=DECIMAL},
  297. </if>
  298. <if test="avg != null" >
  299. #{avg,jdbcType=DECIMAL},
  300. </if>
  301. <if test="orgId != null" >
  302. #{orgId,jdbcType=INTEGER},
  303. </if>
  304. <if test="createTime != null" >
  305. #{createTime,jdbcType=TIMESTAMP},
  306. </if>
  307. <if test="updatetime != null" >
  308. #{updatetime,jdbcType=TIMESTAMP},
  309. </if>
  310. <if test="tPoints != null" >
  311. #{tPoints,jdbcType=LONGVARCHAR},
  312. </if>
  313. </trim>
  314. </insert>
  315. <select id="countByExample" parameterType="com.chinaitop.depot.agent.temperature.model.BusinessAgentTemperatureExample" resultType="java.lang.Integer" >
  316. select count(*) from business_agent_temperature
  317. <if test="_parameter != null" >
  318. <include refid="Example_Where_Clause" />
  319. </if>
  320. </select>
  321. <update id="updateByExampleSelective" parameterType="map" >
  322. update business_agent_temperature
  323. <set >
  324. <if test="record.id != null" >
  325. id = #{record.id,jdbcType=INTEGER},
  326. </if>
  327. <if test="record.agentId != null" >
  328. agent_id = #{record.agentId,jdbcType=INTEGER},
  329. </if>
  330. <if test="record.agentDepotId != null" >
  331. agent_depot_id = #{record.agentDepotId,jdbcType=INTEGER},
  332. </if>
  333. <if test="record.storehouseId != null" >
  334. storehouse_id = #{record.storehouseId,jdbcType=INTEGER},
  335. </if>
  336. <if test="record.weather != null" >
  337. weather = #{record.weather,jdbcType=VARCHAR},
  338. </if>
  339. <if test="record.actualAmount != null" >
  340. actual_amount = #{record.actualAmount,jdbcType=VARCHAR},
  341. </if>
  342. <if test="record.lspz != null" >
  343. lspz = #{record.lspz,jdbcType=INTEGER},
  344. </if>
  345. <if test="record.nature != null" >
  346. nature = #{record.nature,jdbcType=VARCHAR},
  347. </if>
  348. <if test="record.level != null" >
  349. level = #{record.level,jdbcType=INTEGER},
  350. </if>
  351. <if test="record.harvestYear != null" >
  352. harvest_year = #{record.harvestYear,jdbcType=INTEGER},
  353. </if>
  354. <if test="record.enterTime != null" >
  355. enter_time = #{record.enterTime,jdbcType=TIMESTAMP},
  356. </if>
  357. <if test="record.keeper != null" >
  358. keeper = #{record.keeper,jdbcType=VARCHAR},
  359. </if>
  360. <if test="record.houseTemperature != null" >
  361. house_temperature = #{record.houseTemperature,jdbcType=DECIMAL},
  362. </if>
  363. <if test="record.houseHumidity != null" >
  364. house_humidity = #{record.houseHumidity,jdbcType=DECIMAL},
  365. </if>
  366. <if test="record.gasTemperature != null" >
  367. gas_temperature = #{record.gasTemperature,jdbcType=DECIMAL},
  368. </if>
  369. <if test="record.gasHumidity != null" >
  370. gas_humidity = #{record.gasHumidity,jdbcType=DECIMAL},
  371. </if>
  372. <if test="record.detectionTime != null" >
  373. detection_time = #{record.detectionTime,jdbcType=TIMESTAMP},
  374. </if>
  375. <if test="record.max != null" >
  376. max = #{record.max,jdbcType=DECIMAL},
  377. </if>
  378. <if test="record.min != null" >
  379. min = #{record.min,jdbcType=DECIMAL},
  380. </if>
  381. <if test="record.avg != null" >
  382. avg = #{record.avg,jdbcType=DECIMAL},
  383. </if>
  384. <if test="record.orgId != null" >
  385. org_id = #{record.orgId,jdbcType=INTEGER},
  386. </if>
  387. <if test="record.createTime != null" >
  388. create_time = #{record.createTime,jdbcType=TIMESTAMP},
  389. </if>
  390. <if test="record.updatetime != null" >
  391. updatetime = #{record.updatetime,jdbcType=TIMESTAMP},
  392. </if>
  393. <if test="record.tPoints != null" >
  394. t_points = #{record.tPoints,jdbcType=LONGVARCHAR},
  395. </if>
  396. </set>
  397. <if test="_parameter != null" >
  398. <include refid="Update_By_Example_Where_Clause" />
  399. </if>
  400. </update>
  401. <update id="updateByExampleWithBLOBs" parameterType="map" >
  402. update business_agent_temperature
  403. set id = #{record.id,jdbcType=INTEGER},
  404. agent_id = #{record.agentId,jdbcType=INTEGER},
  405. agent_depot_id = #{record.agentDepotId,jdbcType=INTEGER},
  406. storehouse_id = #{record.storehouseId,jdbcType=INTEGER},
  407. weather = #{record.weather,jdbcType=VARCHAR},
  408. actual_amount = #{record.actualAmount,jdbcType=VARCHAR},
  409. lspz = #{record.lspz,jdbcType=INTEGER},
  410. nature = #{record.nature,jdbcType=VARCHAR},
  411. level = #{record.level,jdbcType=INTEGER},
  412. harvest_year = #{record.harvestYear,jdbcType=INTEGER},
  413. enter_time = #{record.enterTime,jdbcType=TIMESTAMP},
  414. keeper = #{record.keeper,jdbcType=VARCHAR},
  415. house_temperature = #{record.houseTemperature,jdbcType=DECIMAL},
  416. house_humidity = #{record.houseHumidity,jdbcType=DECIMAL},
  417. gas_temperature = #{record.gasTemperature,jdbcType=DECIMAL},
  418. gas_humidity = #{record.gasHumidity,jdbcType=DECIMAL},
  419. detection_time = #{record.detectionTime,jdbcType=TIMESTAMP},
  420. max = #{record.max,jdbcType=DECIMAL},
  421. min = #{record.min,jdbcType=DECIMAL},
  422. avg = #{record.avg,jdbcType=DECIMAL},
  423. org_id = #{record.orgId,jdbcType=INTEGER},
  424. create_time = #{record.createTime,jdbcType=TIMESTAMP},
  425. updatetime = #{record.updatetime,jdbcType=TIMESTAMP},
  426. t_points = #{record.tPoints,jdbcType=LONGVARCHAR}
  427. <if test="_parameter != null" >
  428. <include refid="Update_By_Example_Where_Clause" />
  429. </if>
  430. </update>
  431. <update id="updateByExample" parameterType="map" >
  432. update business_agent_temperature
  433. set id = #{record.id,jdbcType=INTEGER},
  434. agent_id = #{record.agentId,jdbcType=INTEGER},
  435. agent_depot_id = #{record.agentDepotId,jdbcType=INTEGER},
  436. storehouse_id = #{record.storehouseId,jdbcType=INTEGER},
  437. weather = #{record.weather,jdbcType=VARCHAR},
  438. actual_amount = #{record.actualAmount,jdbcType=VARCHAR},
  439. lspz = #{record.lspz,jdbcType=INTEGER},
  440. nature = #{record.nature,jdbcType=VARCHAR},
  441. level = #{record.level,jdbcType=INTEGER},
  442. harvest_year = #{record.harvestYear,jdbcType=INTEGER},
  443. enter_time = #{record.enterTime,jdbcType=TIMESTAMP},
  444. keeper = #{record.keeper,jdbcType=VARCHAR},
  445. house_temperature = #{record.houseTemperature,jdbcType=DECIMAL},
  446. house_humidity = #{record.houseHumidity,jdbcType=DECIMAL},
  447. gas_temperature = #{record.gasTemperature,jdbcType=DECIMAL},
  448. gas_humidity = #{record.gasHumidity,jdbcType=DECIMAL},
  449. detection_time = #{record.detectionTime,jdbcType=TIMESTAMP},
  450. max = #{record.max,jdbcType=DECIMAL},
  451. min = #{record.min,jdbcType=DECIMAL},
  452. avg = #{record.avg,jdbcType=DECIMAL},
  453. org_id = #{record.orgId,jdbcType=INTEGER},
  454. create_time = #{record.createTime,jdbcType=TIMESTAMP},
  455. updatetime = #{record.updatetime,jdbcType=TIMESTAMP}
  456. <if test="_parameter != null" >
  457. <include refid="Update_By_Example_Where_Clause" />
  458. </if>
  459. </update>
  460. <update id="updateByPrimaryKeySelective" parameterType="com.chinaitop.depot.agent.temperature.model.BusinessAgentTemperature" >
  461. update business_agent_temperature
  462. <set >
  463. <if test="agentId != null" >
  464. agent_id = #{agentId,jdbcType=INTEGER},
  465. </if>
  466. <if test="agentDepotId != null" >
  467. agent_depot_id = #{agentDepotId,jdbcType=INTEGER},
  468. </if>
  469. <if test="storehouseId != null" >
  470. storehouse_id = #{storehouseId,jdbcType=INTEGER},
  471. </if>
  472. <if test="weather != null" >
  473. weather = #{weather,jdbcType=VARCHAR},
  474. </if>
  475. <if test="actualAmount != null" >
  476. actual_amount = #{actualAmount,jdbcType=VARCHAR},
  477. </if>
  478. <if test="lspz != null" >
  479. lspz = #{lspz,jdbcType=INTEGER},
  480. </if>
  481. <if test="nature != null" >
  482. nature = #{nature,jdbcType=VARCHAR},
  483. </if>
  484. <if test="level != null" >
  485. level = #{level,jdbcType=INTEGER},
  486. </if>
  487. <if test="harvestYear != null" >
  488. harvest_year = #{harvestYear,jdbcType=INTEGER},
  489. </if>
  490. <if test="enterTime != null" >
  491. enter_time = #{enterTime,jdbcType=TIMESTAMP},
  492. </if>
  493. <if test="keeper != null" >
  494. keeper = #{keeper,jdbcType=VARCHAR},
  495. </if>
  496. <if test="houseTemperature != null" >
  497. house_temperature = #{houseTemperature,jdbcType=DECIMAL},
  498. </if>
  499. <if test="houseHumidity != null" >
  500. house_humidity = #{houseHumidity,jdbcType=DECIMAL},
  501. </if>
  502. <if test="gasTemperature != null" >
  503. gas_temperature = #{gasTemperature,jdbcType=DECIMAL},
  504. </if>
  505. <if test="gasHumidity != null" >
  506. gas_humidity = #{gasHumidity,jdbcType=DECIMAL},
  507. </if>
  508. <if test="detectionTime != null" >
  509. detection_time = #{detectionTime,jdbcType=TIMESTAMP},
  510. </if>
  511. <if test="max != null" >
  512. max = #{max,jdbcType=DECIMAL},
  513. </if>
  514. <if test="min != null" >
  515. min = #{min,jdbcType=DECIMAL},
  516. </if>
  517. <if test="avg != null" >
  518. avg = #{avg,jdbcType=DECIMAL},
  519. </if>
  520. <if test="orgId != null" >
  521. org_id = #{orgId,jdbcType=INTEGER},
  522. </if>
  523. <if test="createTime != null" >
  524. create_time = #{createTime,jdbcType=TIMESTAMP},
  525. </if>
  526. <if test="updatetime != null" >
  527. updatetime = #{updatetime,jdbcType=TIMESTAMP},
  528. </if>
  529. <if test="tPoints != null" >
  530. t_points = #{tPoints,jdbcType=LONGVARCHAR},
  531. </if>
  532. </set>
  533. where id = #{id,jdbcType=INTEGER}
  534. </update>
  535. <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.chinaitop.depot.agent.temperature.model.BusinessAgentTemperature" >
  536. update business_agent_temperature
  537. set agent_id = #{agentId,jdbcType=INTEGER},
  538. agent_depot_id = #{agentDepotId,jdbcType=INTEGER},
  539. storehouse_id = #{storehouseId,jdbcType=INTEGER},
  540. weather = #{weather,jdbcType=VARCHAR},
  541. actual_amount = #{actualAmount,jdbcType=VARCHAR},
  542. lspz = #{lspz,jdbcType=INTEGER},
  543. nature = #{nature,jdbcType=VARCHAR},
  544. level = #{level,jdbcType=INTEGER},
  545. harvest_year = #{harvestYear,jdbcType=INTEGER},
  546. enter_time = #{enterTime,jdbcType=TIMESTAMP},
  547. keeper = #{keeper,jdbcType=VARCHAR},
  548. house_temperature = #{houseTemperature,jdbcType=DECIMAL},
  549. house_humidity = #{houseHumidity,jdbcType=DECIMAL},
  550. gas_temperature = #{gasTemperature,jdbcType=DECIMAL},
  551. gas_humidity = #{gasHumidity,jdbcType=DECIMAL},
  552. detection_time = #{detectionTime,jdbcType=TIMESTAMP},
  553. max = #{max,jdbcType=DECIMAL},
  554. min = #{min,jdbcType=DECIMAL},
  555. avg = #{avg,jdbcType=DECIMAL},
  556. org_id = #{orgId,jdbcType=INTEGER},
  557. create_time = #{createTime,jdbcType=TIMESTAMP},
  558. updatetime = #{updatetime,jdbcType=TIMESTAMP},
  559. t_points = #{tPoints,jdbcType=LONGVARCHAR}
  560. where id = #{id,jdbcType=INTEGER}
  561. </update>
  562. <update id="updateByPrimaryKey" parameterType="com.chinaitop.depot.agent.temperature.model.BusinessAgentTemperature" >
  563. update business_agent_temperature
  564. set agent_id = #{agentId,jdbcType=INTEGER},
  565. agent_depot_id = #{agentDepotId,jdbcType=INTEGER},
  566. storehouse_id = #{storehouseId,jdbcType=INTEGER},
  567. weather = #{weather,jdbcType=VARCHAR},
  568. actual_amount = #{actualAmount,jdbcType=VARCHAR},
  569. lspz = #{lspz,jdbcType=INTEGER},
  570. nature = #{nature,jdbcType=VARCHAR},
  571. level = #{level,jdbcType=INTEGER},
  572. harvest_year = #{harvestYear,jdbcType=INTEGER},
  573. enter_time = #{enterTime,jdbcType=TIMESTAMP},
  574. keeper = #{keeper,jdbcType=VARCHAR},
  575. house_temperature = #{houseTemperature,jdbcType=DECIMAL},
  576. house_humidity = #{houseHumidity,jdbcType=DECIMAL},
  577. gas_temperature = #{gasTemperature,jdbcType=DECIMAL},
  578. gas_humidity = #{gasHumidity,jdbcType=DECIMAL},
  579. detection_time = #{detectionTime,jdbcType=TIMESTAMP},
  580. max = #{max,jdbcType=DECIMAL},
  581. min = #{min,jdbcType=DECIMAL},
  582. avg = #{avg,jdbcType=DECIMAL},
  583. org_id = #{orgId,jdbcType=INTEGER},
  584. create_time = #{createTime,jdbcType=TIMESTAMP},
  585. updatetime = #{updatetime,jdbcType=TIMESTAMP},
  586. t_points = #{tPoints,jdbcType=LONGVARCHAR}
  587. where id = #{id,jdbcType=INTEGER}
  588. </update>
  589. <select id="getDataByExample" parameterType="java.util.Map" resultType="java.util.HashMap">
  590. SELECT
  591. temperAll.*
  592. FROM
  593. (
  594. SELECT DISTINCT
  595. temper.id id,
  596. temper.org_id orgId,
  597. depot.depot_id agentOrgId,
  598. depot.depot_id agentStoreOrgId,
  599. '1' sign,
  600. agent.agent_name agentName,
  601. depot.agent_depot_name agentDepotName,
  602. store.storehouse_name storehouseName,
  603. temper.lspz lspz,
  604. temper.detection_time detectionTime,
  605. temper.house_temperature houseTemperature,
  606. temper.house_humidity houseHumidity,
  607. temper.max max,
  608. temper.min min,
  609. temper.avg avg,
  610. temper.t_points tPoints,
  611. store.storehouse_type storehouseType,
  612. store.design_capacity designCapacity,
  613. temper.enter_time enterTime,
  614. temper.nature nature,
  615. temper.level level,
  616. temper.actual_amount actualAmount,
  617. temper.harvest_year harvestYear,
  618. temper.gas_temperature gasTemperature,
  619. temper.gas_humidity gasHumidity,
  620. temper.keeper keeper,
  621. temper.updatetime updatetime
  622. FROM
  623. business_agent_temperature temper
  624. LEFT JOIN business_agent agent ON agent.id = temper.agent_id
  625. AND agent.org_id = #{orgId,jdbcType=INTEGER}
  626. LEFT JOIN business_agent_depot depot ON depot.id = temper.agent_depot_id
  627. AND depot.org_id = #{orgId,jdbcType=INTEGER}
  628. LEFT JOIN basic_storehouse store ON store.storehouse_id = temper.storehouse_id
  629. AND store.library_type = 1
  630. AND store.org_id = #{orgId,jdbcType=INTEGER}
  631. WHERE temper.org_id = #{orgId,jdbcType=INTEGER}
  632. <if test="agentId != null">
  633. AND temper.agent_id = #{agentId,jdbcType=INTEGER}
  634. </if>
  635. <if test="agentDepotId != null">
  636. AND temper.agent_depot_id = #{agentDepotId,jdbcType=INTEGER}
  637. </if>
  638. <if test="storehouseId != null">
  639. AND temper.storehouse_id = #{storehouseId,jdbcType=INTEGER}
  640. </if>
  641. <if test="startTime != null and endTime != null">
  642. AND temper.detection_time BETWEEN #{startTime} AND #{endTime}
  643. </if>
  644. <if test="temperId != null">
  645. AND temper.id = #{temperId,jdbcType=INTEGER}
  646. </if>
  647. UNION ALL
  648. SELECT DISTINCT
  649. tt.id id,
  650. tt.org_id orgId,
  651. depot.depot_id agentOrgId,
  652. depot.depot_id agentStoreOrgId,
  653. '0' sign,
  654. depot.agent_depot_name agentName,
  655. store.depot_name agentDepotName,
  656. store.storehouse_name storehouseName,
  657. tt.storehouse lspz,
  658. tt.time detectionTime,
  659. tt.inTemp houseTemperature,
  660. tt.inH houseHumidity,
  661. tt.max max,
  662. tt.min min,
  663. tt.avg avg,
  664. tt.t_points tPoints,
  665. store.storehouse_type storehouseType,
  666. store.design_capacity designCapacity,
  667. tt.storehouse enterTime,
  668. tt.storehouse nature,
  669. tt.storehouse level,
  670. tt.storehouse actualAmount,
  671. tt.storehouse harvestYear,
  672. tt.outTemp gasTemperature,
  673. tt.outH gasHumidity,
  674. tt.storehouse keeper,
  675. tt.updatetime updatetime
  676. FROM
  677. business_agent_depot depot
  678. LEFT JOIN business_agent_storehouse agentStore ON depot.id = agentStore.agent_depot_id
  679. AND agentStore.org_id = #{orgId,jdbcType=INTEGER}
  680. LEFT JOIN basic_storehouse store ON store.storehouse_id = agentStore.storehouse_id
  681. AND store.org_id = #{orgId,jdbcType=INTEGER}
  682. LEFT JOIN t_testdata tt ON depot.depot_id = tt.org_id
  683. AND tt.updatetime >= depot.updatetime
  684. WHERE
  685. tt.iLq_yq = '0'
  686. AND depot.org_id = #{orgId,jdbcType=INTEGER}
  687. AND depot.del_flag = 1
  688. <if test="agentId != null">
  689. AND agent.id = #{agentId,jdbcType=INTEGER}
  690. </if>
  691. <if test="agentDepotId != null">
  692. AND depot.id = #{agentDepotId,jdbcType=INTEGER}
  693. </if>
  694. <if test="storehouseId != null">
  695. AND store.storehouse_id = #{storehouseId,jdbcType=INTEGER}
  696. </if>
  697. <if test="startTime != null and endTime != null">
  698. AND tt.time BETWEEN #{startTime} AND #{endTime}
  699. </if>
  700. ) temperAll
  701. WHERE temperAll.orgId IS NOT NULL AND temperAll.id IS NOT NULL
  702. ORDER BY
  703. temperAll.updatetime DESC
  704. </select>
  705. <select id="getById" resultMap="ResultMapWithBLOBs" parameterType="java.lang.String">
  706. SELECT * FROM business_agent_temperature WHERE id = #{id}
  707. </select>
  708. <select id="getTestDataById" resultType="java.lang.String" parameterType="java.lang.String">
  709. SELECT t_points FROM t_testdata WHERE id = #{id}
  710. </select>
  711. <select id="getAgentStoreInfoMap" resultType="java.util.Map" parameterType="java.lang.Integer">
  712. SELECT
  713. t2.storehouse_type,
  714. t2.storehouse_code,
  715. t2.storehouse_name,
  716. t2.design_capacity,
  717. t2.house_doot_position,
  718. t2.storehouse_state,
  719. t2.dutyStoreman,
  720. t1.lkmc,
  721. t1.pz,
  722. t1.hwxz,
  723. t1.dj,
  724. t1.kcsl,
  725. DATE_FORMAT(t1.rq, '%Y') AS rq,
  726. DATE_FORMAT(t1.rq, '%Y-%m-%d') AS rcrq,
  727. DATE_FORMAT(t1.cjsj, '%Y-%m-%d') AS cjsj,
  728. t1.UnitID
  729. FROM
  730. `lsreport_ts`.`data_kcgl_kcsw_default` t1
  731. LEFT JOIN `depot_yunnan`.`basic_storehouse` t2 ON t1.UnitID = t2.org_id
  732. AND t1.ch = t2.storehouse_id
  733. AND t2.del_flag = 1
  734. AND t2.library_type = '0'
  735. WHERE
  736. t2.org_id IN (
  737. SELECT DISTINCT
  738. depot_id
  739. FROM
  740. `depot_yunnan`.`business_agent_depot`
  741. WHERE
  742. org_id = #{orgId,jdbcType=INTEGER}
  743. )
  744. GROUP BY
  745. t2.storehouse_code
  746. </select>
  747. </mapper>