TSubmittedMapper.xml 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445
  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.steerinfo.ems.tsubmitted.mapper.TSubmittedMapper">
  4. <resultMap id="BaseResultMap" type="com.steerinfo.ems.tsubmitted.model.TSubmitted">
  5. <id column="CONSTRUID" jdbcType="VARCHAR" property="construid" />
  6. <result column="DEVICENAME" jdbcType="VARCHAR" property="devicename" />
  7. <result column="EQUIPMENT" jdbcType="VARCHAR" property="equipment" />
  8. <result column="CONSTRUCTIONUNITS" jdbcType="VARCHAR" property="constructionunits" />
  9. <result column="CONSTRUPEOPLE" jdbcType="VARCHAR" property="construpeople" />
  10. <result column="CONSTRUDATE" jdbcType="VARCHAR" property="construdate" />
  11. <result column="CONSTRUCONTENT" jdbcType="VARCHAR" property="construcontent" />
  12. <result column="CONSTRUFILE" jdbcType="VARCHAR" property="construfile" />
  13. <result column="SIGNTIME" jdbcType="VARCHAR" property="signtime" />
  14. <result column="BZ" jdbcType="VARCHAR" property="bz" />
  15. <result column="IMAGEURL" jdbcType="VARCHAR" property="imageurl" />
  16. <result column="IMAGENAME" jdbcType="VARCHAR" property="imagename" />
  17. <result column="MAXID" jdbcType="DECIMAL" property="maxid" />
  18. <result column="DECLAREID" jdbcType="VARCHAR" property="declareid" />
  19. </resultMap>
  20. <sql id="columns">
  21. CONSTRUID, DEVICENAME, EQUIPMENT, CONSTRUCTIONUNITS, CONSTRUPEOPLE, CONSTRUDATE,
  22. CONSTRUCONTENT, CONSTRUFILE, SIGNTIME, BZ, IMAGEURL, IMAGENAME, MAXID, DECLAREID
  23. </sql>
  24. <sql id="columns_alias">
  25. t.CONSTRUID, t.DEVICENAME, t.EQUIPMENT, t.CONSTRUCTIONUNITS, t.CONSTRUPEOPLE, t.CONSTRUDATE,
  26. t.CONSTRUCONTENT, t.CONSTRUFILE, t.SIGNTIME, t.BZ, t.IMAGEURL, t.IMAGENAME, t.MAXID,
  27. t.DECLAREID
  28. </sql>
  29. <sql id="select">
  30. SELECT <include refid="columns"/> FROM T_SUBMITTED
  31. </sql>
  32. <sql id="select_alias">
  33. SELECT <include refid="columns_alias"/> FROM T_SUBMITTED t
  34. </sql>
  35. <sql id="where">
  36. <where>
  37. <if test="construid != null and construid != ''">
  38. and CONSTRUID = #{construid}
  39. </if>
  40. <if test="devicename != null and devicename != ''">
  41. and DEVICENAME = #{devicename}
  42. </if>
  43. <if test="equipment != null and equipment != ''">
  44. and EQUIPMENT = #{equipment}
  45. </if>
  46. <if test="constructionunits != null and constructionunits != ''">
  47. and CONSTRUCTIONUNITS = #{constructionunits}
  48. </if>
  49. <if test="construpeople != null and construpeople != ''">
  50. and CONSTRUPEOPLE = #{construpeople}
  51. </if>
  52. <if test="construdate != null and construdate != ''">
  53. and CONSTRUDATE = #{construdate}
  54. </if>
  55. <if test="construcontent != null and construcontent != ''">
  56. and CONSTRUCONTENT = #{construcontent}
  57. </if>
  58. <if test="construfile != null and construfile != ''">
  59. and CONSTRUFILE = #{construfile}
  60. </if>
  61. <if test="signtime != null and signtime != ''">
  62. and SIGNTIME = #{signtime}
  63. </if>
  64. <if test="bz != null and bz != ''">
  65. and BZ = #{bz}
  66. </if>
  67. <if test="imageurl != null and imageurl != ''">
  68. and IMAGEURL = #{imageurl}
  69. </if>
  70. <if test="imagename != null and imagename != ''">
  71. and IMAGENAME = #{imagename}
  72. </if>
  73. <if test="maxid != null">
  74. and MAXID = #{maxid}
  75. </if>
  76. <if test="declareid != null and declareid != ''">
  77. and DECLAREID = #{declareid}
  78. </if>
  79. </where>
  80. </sql>
  81. <sql id="whereLike">
  82. <where>
  83. <if test="construid != null and construid != ''">
  84. and CONSTRUID LIKE '%${construid}%'
  85. </if>
  86. <if test="devicename != null and devicename != ''">
  87. and DEVICENAME LIKE '%${devicename}%'
  88. </if>
  89. <if test="equipment != null and equipment != ''">
  90. and EQUIPMENT LIKE '%${equipment}%'
  91. </if>
  92. <if test="constructionunits != null and constructionunits != ''">
  93. and CONSTRUCTIONUNITS LIKE '%${constructionunits}%'
  94. </if>
  95. <if test="construpeople != null and construpeople != ''">
  96. and CONSTRUPEOPLE LIKE '%${construpeople}%'
  97. </if>
  98. <if test="construdate != null and construdate != ''">
  99. and CONSTRUDATE LIKE '%${construdate}%'
  100. </if>
  101. <if test="construcontent != null and construcontent != ''">
  102. and CONSTRUCONTENT LIKE '%${construcontent}%'
  103. </if>
  104. <if test="construfile != null and construfile != ''">
  105. and CONSTRUFILE LIKE '%${construfile}%'
  106. </if>
  107. <if test="signtime != null and signtime != ''">
  108. and SIGNTIME LIKE '%${signtime}%'
  109. </if>
  110. <if test="bz != null and bz != ''">
  111. and BZ LIKE '%${bz}%'
  112. </if>
  113. <if test="imageurl != null and imageurl != ''">
  114. and IMAGEURL LIKE '%${imageurl}%'
  115. </if>
  116. <if test="imagename != null and imagename != ''">
  117. and IMAGENAME LIKE '%${imagename}%'
  118. </if>
  119. <if test="maxid != null">
  120. and MAXID = #{maxid}
  121. </if>
  122. <if test="declareid != null and declareid != ''">
  123. and DECLAREID LIKE '%${declareid}%'
  124. </if>
  125. </where>
  126. </sql>
  127. <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
  128. delete from T_SUBMITTED
  129. where CONSTRUID = #{construid,jdbcType=VARCHAR}
  130. </delete>
  131. <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
  132. delete from T_SUBMITTED
  133. where 1!=1
  134. <if test="devicename != null and devicename != ''">
  135. or DEVICENAME = #{devicename}
  136. </if>
  137. <if test="equipment != null and equipment != ''">
  138. or EQUIPMENT = #{equipment}
  139. </if>
  140. <if test="constructionunits != null and constructionunits != ''">
  141. or CONSTRUCTIONUNITS = #{constructionunits}
  142. </if>
  143. <if test="construpeople != null and construpeople != ''">
  144. or CONSTRUPEOPLE = #{construpeople}
  145. </if>
  146. <if test="construdate != null and construdate != ''">
  147. or CONSTRUDATE = #{construdate}
  148. </if>
  149. <if test="construcontent != null and construcontent != ''">
  150. or CONSTRUCONTENT = #{construcontent}
  151. </if>
  152. <if test="construfile != null and construfile != ''">
  153. or CONSTRUFILE = #{construfile}
  154. </if>
  155. <if test="signtime != null and signtime != ''">
  156. or SIGNTIME = #{signtime}
  157. </if>
  158. <if test="bz != null and bz != ''">
  159. or BZ = #{bz}
  160. </if>
  161. <if test="imageurl != null and imageurl != ''">
  162. or IMAGEURL = #{imageurl}
  163. </if>
  164. <if test="imagename != null and imagename != ''">
  165. or IMAGENAME = #{imagename}
  166. </if>
  167. <if test="maxid != null">
  168. or MAXID = #{maxid}
  169. </if>
  170. <if test="declareid != null and declareid != ''">
  171. or DECLAREID = #{declareid}
  172. </if>
  173. </delete>
  174. <insert id="insert" parameterType="com.steerinfo.ems.tsubmitted.model.TSubmitted">
  175. insert into T_SUBMITTED (CONSTRUID, DEVICENAME, EQUIPMENT,
  176. CONSTRUCTIONUNITS, CONSTRUPEOPLE, CONSTRUDATE,
  177. CONSTRUCONTENT, CONSTRUFILE, SIGNTIME,
  178. BZ, IMAGEURL, IMAGENAME,
  179. MAXID, DECLAREID)
  180. values (#{construid,jdbcType=VARCHAR}, #{devicename,jdbcType=VARCHAR}, #{equipment,jdbcType=VARCHAR},
  181. #{constructionunits,jdbcType=VARCHAR}, #{construpeople,jdbcType=VARCHAR}, #{construdate,jdbcType=VARCHAR},
  182. #{construcontent,jdbcType=VARCHAR}, #{construfile,jdbcType=VARCHAR}, #{signtime,jdbcType=VARCHAR},
  183. #{bz,jdbcType=VARCHAR}, #{imageurl,jdbcType=VARCHAR}, #{imagename,jdbcType=VARCHAR},
  184. #{maxid,jdbcType=DECIMAL}, #{declareid,jdbcType=VARCHAR})
  185. </insert>
  186. <insert id="insertSelective" parameterType="com.steerinfo.ems.tsubmitted.model.TSubmitted">
  187. insert into T_SUBMITTED
  188. <trim prefix="(" suffix=")" suffixOverrides=",">
  189. <if test="construid != null">
  190. CONSTRUID,
  191. </if>
  192. <if test="devicename != null">
  193. DEVICENAME,
  194. </if>
  195. <if test="equipment != null">
  196. EQUIPMENT,
  197. </if>
  198. <if test="constructionunits != null">
  199. CONSTRUCTIONUNITS,
  200. </if>
  201. <if test="construpeople != null">
  202. CONSTRUPEOPLE,
  203. </if>
  204. <if test="construdate != null">
  205. CONSTRUDATE,
  206. </if>
  207. <if test="construcontent != null">
  208. CONSTRUCONTENT,
  209. </if>
  210. <if test="construfile != null">
  211. CONSTRUFILE,
  212. </if>
  213. <if test="signtime != null">
  214. SIGNTIME,
  215. </if>
  216. <if test="bz != null">
  217. BZ,
  218. </if>
  219. <if test="imageurl != null">
  220. IMAGEURL,
  221. </if>
  222. <if test="imagename != null">
  223. IMAGENAME,
  224. </if>
  225. <if test="maxid != null">
  226. MAXID,
  227. </if>
  228. <if test="declareid != null">
  229. DECLAREID,
  230. </if>
  231. </trim>
  232. <trim prefix="values (" suffix=")" suffixOverrides=",">
  233. <if test="construid != null">
  234. #{construid,jdbcType=VARCHAR},
  235. </if>
  236. <if test="devicename != null">
  237. #{devicename,jdbcType=VARCHAR},
  238. </if>
  239. <if test="equipment != null">
  240. #{equipment,jdbcType=VARCHAR},
  241. </if>
  242. <if test="constructionunits != null">
  243. #{constructionunits,jdbcType=VARCHAR},
  244. </if>
  245. <if test="construpeople != null">
  246. #{construpeople,jdbcType=VARCHAR},
  247. </if>
  248. <if test="construdate != null">
  249. #{construdate,jdbcType=VARCHAR},
  250. </if>
  251. <if test="construcontent != null">
  252. #{construcontent,jdbcType=VARCHAR},
  253. </if>
  254. <if test="construfile != null">
  255. #{construfile,jdbcType=VARCHAR},
  256. </if>
  257. <if test="signtime != null">
  258. #{signtime,jdbcType=VARCHAR},
  259. </if>
  260. <if test="bz != null">
  261. #{bz,jdbcType=VARCHAR},
  262. </if>
  263. <if test="imageurl != null">
  264. #{imageurl,jdbcType=VARCHAR},
  265. </if>
  266. <if test="imagename != null">
  267. #{imagename,jdbcType=VARCHAR},
  268. </if>
  269. <if test="maxid != null">
  270. #{maxid,jdbcType=DECIMAL},
  271. </if>
  272. <if test="declareid != null">
  273. #{declareid,jdbcType=VARCHAR},
  274. </if>
  275. </trim>
  276. </insert>
  277. <update id="updateByPrimaryKey" parameterType="com.steerinfo.ems.tsubmitted.model.TSubmitted">
  278. update T_SUBMITTED
  279. set DEVICENAME = #{devicename,jdbcType=VARCHAR},
  280. EQUIPMENT = #{equipment,jdbcType=VARCHAR},
  281. CONSTRUCTIONUNITS = #{constructionunits,jdbcType=VARCHAR},
  282. CONSTRUPEOPLE = #{construpeople,jdbcType=VARCHAR},
  283. CONSTRUDATE = #{construdate,jdbcType=VARCHAR},
  284. CONSTRUCONTENT = #{construcontent,jdbcType=VARCHAR},
  285. CONSTRUFILE = #{construfile,jdbcType=VARCHAR},
  286. SIGNTIME = #{signtime,jdbcType=VARCHAR},
  287. BZ = #{bz,jdbcType=VARCHAR},
  288. IMAGEURL = #{imageurl,jdbcType=VARCHAR},
  289. IMAGENAME = #{imagename,jdbcType=VARCHAR},
  290. MAXID = #{maxid,jdbcType=DECIMAL},
  291. DECLAREID = #{declareid,jdbcType=VARCHAR}
  292. where CONSTRUID = #{construid,jdbcType=VARCHAR}
  293. </update>
  294. <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.ems.tsubmitted.model.TSubmitted">
  295. update T_SUBMITTED
  296. <set>
  297. <if test="devicename != null">
  298. DEVICENAME = #{devicename,jdbcType=VARCHAR},
  299. </if>
  300. <if test="equipment != null">
  301. EQUIPMENT = #{equipment,jdbcType=VARCHAR},
  302. </if>
  303. <if test="constructionunits != null">
  304. CONSTRUCTIONUNITS = #{constructionunits,jdbcType=VARCHAR},
  305. </if>
  306. <if test="construpeople != null">
  307. CONSTRUPEOPLE = #{construpeople,jdbcType=VARCHAR},
  308. </if>
  309. <if test="construdate != null">
  310. CONSTRUDATE = #{construdate,jdbcType=VARCHAR},
  311. </if>
  312. <if test="construcontent != null">
  313. CONSTRUCONTENT = #{construcontent,jdbcType=VARCHAR},
  314. </if>
  315. <if test="construfile != null">
  316. CONSTRUFILE = #{construfile,jdbcType=VARCHAR},
  317. </if>
  318. <if test="signtime != null">
  319. SIGNTIME = #{signtime,jdbcType=VARCHAR},
  320. </if>
  321. <if test="bz != null">
  322. BZ = #{bz,jdbcType=VARCHAR},
  323. </if>
  324. <if test="imageurl != null">
  325. IMAGEURL = #{imageurl,jdbcType=VARCHAR},
  326. </if>
  327. <if test="imagename != null">
  328. IMAGENAME = #{imagename,jdbcType=VARCHAR},
  329. </if>
  330. <if test="maxid != null">
  331. MAXID = #{maxid,jdbcType=DECIMAL},
  332. </if>
  333. <if test="declareid != null">
  334. DECLAREID = #{declareid,jdbcType=VARCHAR},
  335. </if>
  336. </set>
  337. where CONSTRUID = #{construid,jdbcType=VARCHAR}
  338. </update>
  339. <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
  340. <include refid="select"/>
  341. where CONSTRUID = #{construid,jdbcType=VARCHAR}
  342. </select>
  343. <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  344. <include refid="select"/>
  345. <include refid="where"/>
  346. </select>
  347. <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  348. <include refid="select"/>
  349. <include refid="whereLike"/>
  350. </select>
  351. <insert id="batchInsert" parameterType="java.util.List">
  352. insert into T_SUBMITTED
  353. (CONSTRUID,
  354. DEVICENAME, EQUIPMENT, CONSTRUCTIONUNITS,
  355. CONSTRUPEOPLE, CONSTRUDATE, CONSTRUCONTENT,
  356. CONSTRUFILE, SIGNTIME, BZ,
  357. IMAGEURL, IMAGENAME, MAXID,
  358. DECLAREID)
  359. ( <foreach collection="list" item="item" separator="union all">
  360. select
  361. #{item.construid,jdbcType=VARCHAR},
  362. #{item.devicename,jdbcType=VARCHAR}, #{item.equipment,jdbcType=VARCHAR}, #{item.constructionunits,jdbcType=VARCHAR},
  363. #{item.construpeople,jdbcType=VARCHAR}, #{item.construdate,jdbcType=VARCHAR}, #{item.construcontent,jdbcType=VARCHAR},
  364. #{item.construfile,jdbcType=VARCHAR}, #{item.signtime,jdbcType=VARCHAR}, #{item.bz,jdbcType=VARCHAR},
  365. #{item.imageurl,jdbcType=VARCHAR}, #{item.imagename,jdbcType=VARCHAR}, #{item.maxid,jdbcType=DECIMAL},
  366. #{item.declareid,jdbcType=VARCHAR} from dual
  367. </foreach> )
  368. </insert>
  369. <update id="batchUpdate" parameterType="java.util.List">
  370. update T_SUBMITTED
  371. set
  372. CONSTRUID=
  373. <foreach collection="list" item="item" index="index" separator=" " open="case CONSTRUID" close="end">
  374. when #{item.construid,jdbcType=VARCHAR} then #{item.construid,jdbcType=VARCHAR}
  375. </foreach>
  376. ,DEVICENAME=
  377. <foreach collection="list" item="item" index="index" separator=" " open="case CONSTRUID" close="end">
  378. when #{item.construid,jdbcType=VARCHAR} then #{item.devicename,jdbcType=VARCHAR}
  379. </foreach>
  380. ,EQUIPMENT=
  381. <foreach collection="list" item="item" index="index" separator=" " open="case CONSTRUID" close="end">
  382. when #{item.construid,jdbcType=VARCHAR} then #{item.equipment,jdbcType=VARCHAR}
  383. </foreach>
  384. ,CONSTRUCTIONUNITS=
  385. <foreach collection="list" item="item" index="index" separator=" " open="case CONSTRUID" close="end">
  386. when #{item.construid,jdbcType=VARCHAR} then #{item.constructionunits,jdbcType=VARCHAR}
  387. </foreach>
  388. ,CONSTRUPEOPLE=
  389. <foreach collection="list" item="item" index="index" separator=" " open="case CONSTRUID" close="end">
  390. when #{item.construid,jdbcType=VARCHAR} then #{item.construpeople,jdbcType=VARCHAR}
  391. </foreach>
  392. ,CONSTRUDATE=
  393. <foreach collection="list" item="item" index="index" separator=" " open="case CONSTRUID" close="end">
  394. when #{item.construid,jdbcType=VARCHAR} then #{item.construdate,jdbcType=VARCHAR}
  395. </foreach>
  396. ,CONSTRUCONTENT=
  397. <foreach collection="list" item="item" index="index" separator=" " open="case CONSTRUID" close="end">
  398. when #{item.construid,jdbcType=VARCHAR} then #{item.construcontent,jdbcType=VARCHAR}
  399. </foreach>
  400. ,CONSTRUFILE=
  401. <foreach collection="list" item="item" index="index" separator=" " open="case CONSTRUID" close="end">
  402. when #{item.construid,jdbcType=VARCHAR} then #{item.construfile,jdbcType=VARCHAR}
  403. </foreach>
  404. ,SIGNTIME=
  405. <foreach collection="list" item="item" index="index" separator=" " open="case CONSTRUID" close="end">
  406. when #{item.construid,jdbcType=VARCHAR} then #{item.signtime,jdbcType=VARCHAR}
  407. </foreach>
  408. ,BZ=
  409. <foreach collection="list" item="item" index="index" separator=" " open="case CONSTRUID" close="end">
  410. when #{item.construid,jdbcType=VARCHAR} then #{item.bz,jdbcType=VARCHAR}
  411. </foreach>
  412. ,IMAGEURL=
  413. <foreach collection="list" item="item" index="index" separator=" " open="case CONSTRUID" close="end">
  414. when #{item.construid,jdbcType=VARCHAR} then #{item.imageurl,jdbcType=VARCHAR}
  415. </foreach>
  416. ,IMAGENAME=
  417. <foreach collection="list" item="item" index="index" separator=" " open="case CONSTRUID" close="end">
  418. when #{item.construid,jdbcType=VARCHAR} then #{item.imagename,jdbcType=VARCHAR}
  419. </foreach>
  420. ,MAXID=
  421. <foreach collection="list" item="item" index="index" separator=" " open="case CONSTRUID" close="end">
  422. when #{item.construid,jdbcType=VARCHAR} then #{item.maxid,jdbcType=DECIMAL}
  423. </foreach>
  424. ,DECLAREID=
  425. <foreach collection="list" item="item" index="index" separator=" " open="case CONSTRUID" close="end">
  426. when #{item.construid,jdbcType=VARCHAR} then #{item.declareid,jdbcType=VARCHAR}
  427. </foreach>
  428. where CONSTRUID in
  429. <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
  430. #{item.construid,jdbcType=VARCHAR}
  431. </foreach>
  432. </update>
  433. <delete id="batchDelete" parameterType="java.util.List">
  434. delete from T_SUBMITTED
  435. where CONSTRUID in
  436. <foreach collection="list" item="id" open="(" close=")" separator=",">
  437. #{id}
  438. </foreach>
  439. </delete>
  440. <!-- 友情提示!!!-->
  441. <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
  442. <select id="selectMaxId" resultType="java.lang.Integer" >
  443. SELECT MAX(MAXID) FROM T_SUBMITTED where SIGNTIME LIKE '%${signtime}%'
  444. </select>
  445. </mapper>