TNumberWarningMapper.xml 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451
  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.grainNumberMonitor.mapper.TNumberWarningMapper">
  4. <resultMap id="BaseResultMap" type="com.chinaitop.depot.intelligent.grainNumberMonitor.model.TNumberWarning">
  5. <id column="id" property="id" jdbcType="VARCHAR"/>
  6. <result column="vcfcode" property="vcfcode" jdbcType="VARCHAR"/>
  7. <result column="org_id" property="orgId" jdbcType="VARCHAR"/>
  8. <result column="vdevcode" property="vdevcode" jdbcType="VARCHAR"/>
  9. <result column="monitor_number" property="monitorNumber" jdbcType="VARCHAR"/>
  10. <result column="t_volume" property="tVolume" jdbcType="VARCHAR"/>
  11. <result column="t_error" property="tError" jdbcType="VARCHAR"/>
  12. <result column="depot_type" property="depotType" jdbcType="VARCHAR"/>
  13. <result column="depot_long" property="depotLong" jdbcType="VARCHAR"/>
  14. <result column="depot_wide" property="depotWide" jdbcType="VARCHAR"/>
  15. <result column="avg_heightv" property="avgHeightv" jdbcType="VARCHAR"/>
  16. <result column="abnormal_cargo" property="abnormalCargo" jdbcType="VARCHAR"/>
  17. <result column="monitor_time" property="monitorTime" jdbcType="TIMESTAMP"/>
  18. <result column="operator" property="operator" jdbcType="VARCHAR"/>
  19. <result column="updatetime" property="updatetime" jdbcType="TIMESTAMP"/>
  20. </resultMap>
  21. <sql id="Example_Where_Clause">
  22. <where>
  23. <foreach collection="oredCriteria" item="criteria" separator="or">
  24. <if test="criteria.valid">
  25. <trim prefix="(" suffix=")" prefixOverrides="and">
  26. <foreach collection="criteria.criteria" item="criterion">
  27. <choose>
  28. <when test="criterion.noValue">
  29. and ${criterion.condition}
  30. </when>
  31. <when test="criterion.singleValue">
  32. and ${criterion.condition} #{criterion.value}
  33. </when>
  34. <when test="criterion.betweenValue">
  35. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  36. </when>
  37. <when test="criterion.listValue">
  38. and ${criterion.condition}
  39. <foreach collection="criterion.value" item="listItem" open="(" close=")"
  40. separator=",">
  41. #{listItem}
  42. </foreach>
  43. </when>
  44. </choose>
  45. </foreach>
  46. </trim>
  47. </if>
  48. </foreach>
  49. </where>
  50. </sql>
  51. <sql id="Update_By_Example_Where_Clause">
  52. <where>
  53. <foreach collection="example.oredCriteria" item="criteria" separator="or">
  54. <if test="criteria.valid">
  55. <trim prefix="(" suffix=")" prefixOverrides="and">
  56. <foreach collection="criteria.criteria" item="criterion">
  57. <choose>
  58. <when test="criterion.noValue">
  59. and ${criterion.condition}
  60. </when>
  61. <when test="criterion.singleValue">
  62. and ${criterion.condition} #{criterion.value}
  63. </when>
  64. <when test="criterion.betweenValue">
  65. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  66. </when>
  67. <when test="criterion.listValue">
  68. and ${criterion.condition}
  69. <foreach collection="criterion.value" item="listItem" open="(" close=")"
  70. separator=",">
  71. #{listItem}
  72. </foreach>
  73. </when>
  74. </choose>
  75. </foreach>
  76. </trim>
  77. </if>
  78. </foreach>
  79. </where>
  80. </sql>
  81. <sql id="Base_Column_List">
  82. id, vcfcode, org_id, vdevcode, monitor_number, t_volume, t_error, depot_type, depot_long,
  83. depot_wide, avg_heightv, abnormal_cargo, monitor_time, operator, updatetime
  84. </sql>
  85. <select id="selectByExample" resultMap="BaseResultMap"
  86. parameterType="com.chinaitop.depot.intelligent.grainNumberMonitor.model.TNumberWarningExample">
  87. select
  88. <if test="distinct">
  89. distinct
  90. </if>
  91. <include refid="Base_Column_List"/>
  92. from t_number_warning
  93. <if test="_parameter != null">
  94. <include refid="Example_Where_Clause"/>
  95. </if>
  96. <if test="orderByClause != null">
  97. order by ${orderByClause}
  98. </if>
  99. </select>
  100. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String">
  101. select
  102. <include refid="Base_Column_List"/>
  103. from t_number_warning
  104. where id = #{id,jdbcType=VARCHAR}
  105. </select>
  106. <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
  107. delete from t_number_warning
  108. where id = #{id,jdbcType=VARCHAR}
  109. </delete>
  110. <delete id="deleteByExample"
  111. parameterType="com.chinaitop.depot.intelligent.grainNumberMonitor.model.TNumberWarningExample">
  112. delete from t_number_warning
  113. <if test="_parameter != null">
  114. <include refid="Example_Where_Clause"/>
  115. </if>
  116. </delete>
  117. <insert id="insert" parameterType="com.chinaitop.depot.intelligent.grainNumberMonitor.model.TNumberWarning">
  118. insert into t_number_warning (id, vcfcode, org_id,
  119. vdevcode, monitor_number, t_volume,
  120. t_error, depot_type, depot_long,
  121. depot_wide, avg_heightv, abnormal_cargo,
  122. monitor_time, operator, updatetime
  123. )
  124. values (#{id,jdbcType=VARCHAR}, #{vcfcode,jdbcType=VARCHAR}, #{orgId,jdbcType=VARCHAR},
  125. #{vdevcode,jdbcType=VARCHAR}, #{monitorNumber,jdbcType=VARCHAR}, #{tVolume,jdbcType=VARCHAR},
  126. #{tError,jdbcType=VARCHAR}, #{depotType,jdbcType=VARCHAR}, #{depotLong,jdbcType=VARCHAR},
  127. #{depotWide,jdbcType=VARCHAR}, #{avgHeightv,jdbcType=VARCHAR}, #{abnormalCargo,jdbcType=VARCHAR},
  128. #{monitorTime,jdbcType=TIMESTAMP}, #{operator,jdbcType=VARCHAR}, #{updatetime,jdbcType=TIMESTAMP}
  129. )
  130. </insert>
  131. <insert id="insertSelective"
  132. parameterType="com.chinaitop.depot.intelligent.grainNumberMonitor.model.TNumberWarning">
  133. insert into t_number_warning
  134. <trim prefix="(" suffix=")" suffixOverrides=",">
  135. <if test="id != null">
  136. id,
  137. </if>
  138. <if test="vcfcode != null">
  139. vcfcode,
  140. </if>
  141. <if test="orgId != null">
  142. org_id,
  143. </if>
  144. <if test="vdevcode != null">
  145. vdevcode,
  146. </if>
  147. <if test="monitorNumber != null">
  148. monitor_number,
  149. </if>
  150. <if test="tVolume != null">
  151. t_volume,
  152. </if>
  153. <if test="tError != null">
  154. t_error,
  155. </if>
  156. <if test="depotType != null">
  157. depot_type,
  158. </if>
  159. <if test="depotLong != null">
  160. depot_long,
  161. </if>
  162. <if test="depotWide != null">
  163. depot_wide,
  164. </if>
  165. <if test="avgHeightv != null">
  166. avg_heightv,
  167. </if>
  168. <if test="abnormalCargo != null">
  169. abnormal_cargo,
  170. </if>
  171. <if test="monitorTime != null">
  172. monitor_time,
  173. </if>
  174. <if test="operator != null">
  175. operator,
  176. </if>
  177. <if test="updatetime != null">
  178. updatetime,
  179. </if>
  180. </trim>
  181. <trim prefix="values (" suffix=")" suffixOverrides=",">
  182. <if test="id != null">
  183. #{id,jdbcType=VARCHAR},
  184. </if>
  185. <if test="vcfcode != null">
  186. #{vcfcode,jdbcType=VARCHAR},
  187. </if>
  188. <if test="orgId != null">
  189. #{orgId,jdbcType=VARCHAR},
  190. </if>
  191. <if test="vdevcode != null">
  192. #{vdevcode,jdbcType=VARCHAR},
  193. </if>
  194. <if test="monitorNumber != null">
  195. #{monitorNumber,jdbcType=VARCHAR},
  196. </if>
  197. <if test="tVolume != null">
  198. #{tVolume,jdbcType=VARCHAR},
  199. </if>
  200. <if test="tError != null">
  201. #{tError,jdbcType=VARCHAR},
  202. </if>
  203. <if test="depotType != null">
  204. #{depotType,jdbcType=VARCHAR},
  205. </if>
  206. <if test="depotLong != null">
  207. #{depotLong,jdbcType=VARCHAR},
  208. </if>
  209. <if test="depotWide != null">
  210. #{depotWide,jdbcType=VARCHAR},
  211. </if>
  212. <if test="avgHeightv != null">
  213. #{avgHeightv,jdbcType=VARCHAR},
  214. </if>
  215. <if test="abnormalCargo != null">
  216. #{abnormalCargo,jdbcType=VARCHAR},
  217. </if>
  218. <if test="monitorTime != null">
  219. #{monitorTime,jdbcType=TIMESTAMP},
  220. </if>
  221. <if test="operator != null">
  222. #{operator,jdbcType=VARCHAR},
  223. </if>
  224. <if test="updatetime != null">
  225. #{updatetime,jdbcType=TIMESTAMP},
  226. </if>
  227. </trim>
  228. </insert>
  229. <select id="countByExample"
  230. parameterType="com.chinaitop.depot.intelligent.grainNumberMonitor.model.TNumberWarningExample"
  231. resultType="java.lang.Integer">
  232. select count(*) from t_number_warning
  233. <if test="_parameter != null">
  234. <include refid="Example_Where_Clause"/>
  235. </if>
  236. </select>
  237. <update id="updateByExampleSelective" parameterType="map">
  238. update t_number_warning
  239. <set>
  240. <if test="record.id != null">
  241. id = #{record.id,jdbcType=VARCHAR},
  242. </if>
  243. <if test="record.vcfcode != null">
  244. vcfcode = #{record.vcfcode,jdbcType=VARCHAR},
  245. </if>
  246. <if test="record.orgId != null">
  247. org_id = #{record.orgId,jdbcType=VARCHAR},
  248. </if>
  249. <if test="record.vdevcode != null">
  250. vdevcode = #{record.vdevcode,jdbcType=VARCHAR},
  251. </if>
  252. <if test="record.monitorNumber != null">
  253. monitor_number = #{record.monitorNumber,jdbcType=VARCHAR},
  254. </if>
  255. <if test="record.tVolume != null">
  256. t_volume = #{record.tVolume,jdbcType=VARCHAR},
  257. </if>
  258. <if test="record.tError != null">
  259. t_error = #{record.tError,jdbcType=VARCHAR},
  260. </if>
  261. <if test="record.depotType != null">
  262. depot_type = #{record.depotType,jdbcType=VARCHAR},
  263. </if>
  264. <if test="record.depotLong != null">
  265. depot_long = #{record.depotLong,jdbcType=VARCHAR},
  266. </if>
  267. <if test="record.depotWide != null">
  268. depot_wide = #{record.depotWide,jdbcType=VARCHAR},
  269. </if>
  270. <if test="record.avgHeightv != null">
  271. avg_heightv = #{record.avgHeightv,jdbcType=VARCHAR},
  272. </if>
  273. <if test="record.abnormalCargo != null">
  274. abnormal_cargo = #{record.abnormalCargo,jdbcType=VARCHAR},
  275. </if>
  276. <if test="record.monitorTime != null">
  277. monitor_time = #{record.monitorTime,jdbcType=TIMESTAMP},
  278. </if>
  279. <if test="record.operator != null">
  280. operator = #{record.operator,jdbcType=VARCHAR},
  281. </if>
  282. <if test="record.updatetime != null">
  283. updatetime = #{record.updatetime,jdbcType=TIMESTAMP},
  284. </if>
  285. </set>
  286. <if test="_parameter != null">
  287. <include refid="Update_By_Example_Where_Clause"/>
  288. </if>
  289. </update>
  290. <update id="updateByExample" parameterType="map">
  291. update t_number_warning
  292. set id = #{record.id,jdbcType=VARCHAR},
  293. vcfcode = #{record.vcfcode,jdbcType=VARCHAR},
  294. org_id = #{record.orgId,jdbcType=VARCHAR},
  295. vdevcode = #{record.vdevcode,jdbcType=VARCHAR},
  296. monitor_number = #{record.monitorNumber,jdbcType=VARCHAR},
  297. t_volume = #{record.tVolume,jdbcType=VARCHAR},
  298. t_error = #{record.tError,jdbcType=VARCHAR},
  299. depot_type = #{record.depotType,jdbcType=VARCHAR},
  300. depot_long = #{record.depotLong,jdbcType=VARCHAR},
  301. depot_wide = #{record.depotWide,jdbcType=VARCHAR},
  302. avg_heightv = #{record.avgHeightv,jdbcType=VARCHAR},
  303. abnormal_cargo = #{record.abnormalCargo,jdbcType=VARCHAR},
  304. monitor_time = #{record.monitorTime,jdbcType=TIMESTAMP},
  305. operator = #{record.operator,jdbcType=VARCHAR},
  306. updatetime = #{record.updatetime,jdbcType=TIMESTAMP}
  307. <if test="_parameter != null">
  308. <include refid="Update_By_Example_Where_Clause"/>
  309. </if>
  310. </update>
  311. <update id="updateByPrimaryKeySelective"
  312. parameterType="com.chinaitop.depot.intelligent.grainNumberMonitor.model.TNumberWarning">
  313. update t_number_warning
  314. <set>
  315. <if test="vcfcode != null">
  316. vcfcode = #{vcfcode,jdbcType=VARCHAR},
  317. </if>
  318. <if test="orgId != null">
  319. org_id = #{orgId,jdbcType=VARCHAR},
  320. </if>
  321. <if test="vdevcode != null">
  322. vdevcode = #{vdevcode,jdbcType=VARCHAR},
  323. </if>
  324. <if test="monitorNumber != null">
  325. monitor_number = #{monitorNumber,jdbcType=VARCHAR},
  326. </if>
  327. <if test="tVolume != null">
  328. t_volume = #{tVolume,jdbcType=VARCHAR},
  329. </if>
  330. <if test="tError != null">
  331. t_error = #{tError,jdbcType=VARCHAR},
  332. </if>
  333. <if test="depotType != null">
  334. depot_type = #{depotType,jdbcType=VARCHAR},
  335. </if>
  336. <if test="depotLong != null">
  337. depot_long = #{depotLong,jdbcType=VARCHAR},
  338. </if>
  339. <if test="depotWide != null">
  340. depot_wide = #{depotWide,jdbcType=VARCHAR},
  341. </if>
  342. <if test="avgHeightv != null">
  343. avg_heightv = #{avgHeightv,jdbcType=VARCHAR},
  344. </if>
  345. <if test="abnormalCargo != null">
  346. abnormal_cargo = #{abnormalCargo,jdbcType=VARCHAR},
  347. </if>
  348. <if test="monitorTime != null">
  349. monitor_time = #{monitorTime,jdbcType=TIMESTAMP},
  350. </if>
  351. <if test="operator != null">
  352. operator = #{operator,jdbcType=VARCHAR},
  353. </if>
  354. <if test="updatetime != null">
  355. updatetime = #{updatetime,jdbcType=TIMESTAMP},
  356. </if>
  357. </set>
  358. where id = #{id,jdbcType=VARCHAR}
  359. </update>
  360. <update id="updateByPrimaryKey"
  361. parameterType="com.chinaitop.depot.intelligent.grainNumberMonitor.model.TNumberWarning">
  362. update t_number_warning
  363. set vcfcode = #{vcfcode,jdbcType=VARCHAR},
  364. org_id = #{orgId,jdbcType=VARCHAR},
  365. vdevcode = #{vdevcode,jdbcType=VARCHAR},
  366. monitor_number = #{monitorNumber,jdbcType=VARCHAR},
  367. t_volume = #{tVolume,jdbcType=VARCHAR},
  368. t_error = #{tError,jdbcType=VARCHAR},
  369. depot_type = #{depotType,jdbcType=VARCHAR},
  370. depot_long = #{depotLong,jdbcType=VARCHAR},
  371. depot_wide = #{depotWide,jdbcType=VARCHAR},
  372. avg_heightv = #{avgHeightv,jdbcType=VARCHAR},
  373. abnormal_cargo = #{abnormalCargo,jdbcType=VARCHAR},
  374. monitor_time = #{monitorTime,jdbcType=TIMESTAMP},
  375. operator = #{operator,jdbcType=VARCHAR},
  376. updatetime = #{updatetime,jdbcType=TIMESTAMP}
  377. where id = #{id,jdbcType=VARCHAR}
  378. </update>
  379. <select id="getThisAndSetList" resultType="java.util.Map" parameterType="java.util.Map">
  380. SELECT
  381. tj.v_jc_code jccode,
  382. tj.v_remark vcfcode,
  383. tj.v_cf_code vcf,
  384. tj.org_id orgid,
  385. tj.v_ws_src ws,
  386. tn.id id,
  387. tn.monitor_number monitorNumber,
  388. tn.t_volume tvolume,
  389. tn.depot_long tlong,
  390. tn.depot_wide twide,
  391. tn.depot_type ttype,
  392. tn.t_error terror,
  393. tn.avg_heightv avgheightv,
  394. tn.abnormal_cargo tcargo,
  395. tn.monitor_time monitorTime,
  396. tn.operator operator
  397. FROM
  398. t_jctable tj
  399. LEFT JOIN t_number_warning tn ON tj.v_jc_code = tn.vdevcode AND tj.org_id = tn.org_id
  400. <where>
  401. tj.v_ws_src IS NOT NULL
  402. <if test="vcfcode != null">
  403. AND tj.v_cf_code = #{vcfcode}
  404. </if>
  405. </where>
  406. ORDER BY
  407. tn.monitor_time DESC
  408. </select>
  409. <select id="getVideoInfo" resultType="java.util.Map">
  410. SELECT
  411. id id,
  412. org_id orgId,
  413. v_cf_code vCfCode,
  414. v_vedio_ip vVedioIp,
  415. i_vedio_port iVedioPort,
  416. v_vedio_user vVedioUser,
  417. v_vedio_pwd vVedioPwd,
  418. v_vedio_tdh vVedioTdh,
  419. v_jcpp vJcpp
  420. FROM
  421. t_jctable
  422. <where>
  423. v_vedio_ip IS NOT NULL
  424. AND del_flag = 1
  425. AND i_vedio_port IS NOT NULL
  426. AND v_vedio_user IS NOT NULL
  427. AND v_vedio_pwd IS NOT NULL
  428. AND v_vedio_tdh IS NOT NULL
  429. </where>
  430. </select>
  431. <select id="getCfName" resultType="java.util.Map" parameterType="java.lang.String">
  432. SELECT
  433. storehouse_name cfname,
  434. storehouse_code cfcode
  435. FROM
  436. basic_storehouse
  437. WHERE
  438. storehouse_code = (
  439. SELECT
  440. v_remark
  441. FROM
  442. t_jctable
  443. WHERE
  444. v_cf_code = #{cfname}
  445. )
  446. </select>
  447. </mapper>