BusJcebQmjcjlMapper.xml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  3. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  4. <mapper namespace="com.railway.business.catenary.mapper.BusJcebQmjcjlMapper">
  5. <resultMap id="BaseResultMap" type="com.railway.business.catenary.domain.BusJcebQmjcjl">
  6. <result column="id" property="id"/>
  7. <result column="station_id" property="stationId"/>
  8. <result column="station_name" property="stationName"/>
  9. <result column="dept_station_id" property="deptStationId"/>
  10. <result column="pillar_code" property="pillarCode"/>
  11. <result column="qxly" property="qxly"/>
  12. <result column="wz" property="wz"/>
  13. <result column="qxnr" property="qxnr"/>
  14. <result column="qxdj" property="qxdj"/>
  15. <result column="clcs" property="clcs"/>
  16. <result column="xhzt" property="xhzt"/>
  17. <result column="whby" property="whby"/>
  18. <result column="jyqs" property="jyqs"/>
  19. <result column="sbzt" property="sbzt"/>
  20. <result column="operator" property="operator"/>
  21. <result column="gzldr" property="gzldr"/>
  22. <result column="confirm_user" property="confirmUser"/>
  23. <result column="operation_date" property="operationDate"/>
  24. <result column="remark" property="remark"/>
  25. <result column="submit_state" property="submitState"/>
  26. <result column="del_flag" property="delFlag"/>
  27. <result column="create_by" property="createBy"/>
  28. <result column="create_time" property="createTime"/>
  29. <result column="update_by" property="updateBy"/>
  30. <result column="update_time" property="updateTime"/>
  31. </resultMap>
  32. <sql id="Base_Column_List">
  33. t.id,
  34. v.station_id,
  35. t.dept_station_id,
  36. v.station_name,
  37. t.pillar_code,
  38. t.qxly,
  39. t.wz,
  40. t.qxnr,
  41. t.qxdj,
  42. t.clcs,
  43. t.xhzt,
  44. t.whby,
  45. t.jyqs,
  46. t.sbzt,
  47. t.operator,
  48. t.gzldr,
  49. t.confirm_user,
  50. t.operation_date,
  51. t.remark,
  52. t.submit_state,
  53. t.del_flag,
  54. t.create_by,
  55. t.create_time,
  56. t.update_by,
  57. t.update_time
  58. </sql>
  59. <insert id="insert" parameterType="com.railway.business.catenary.domain.BusJcebQmjcjl">
  60. <selectKey keyProperty="id" order="AFTER" resultType="Long">
  61. select @@IDENTITY as id
  62. </selectKey>
  63. INSERT INTO bus_jceb_qmjcjl
  64. <trim prefix="(" suffix=")" suffixOverrides=",">
  65. <if test='null != deptStationId'>
  66. dept_station_id,
  67. </if>
  68. <if test='null != pillarCode'>
  69. pillar_code,
  70. </if>
  71. <if test='null != qxly'>
  72. qxly,
  73. </if>
  74. <if test='null != wz'>
  75. wz,
  76. </if>
  77. <if test='null != qxnr'>
  78. qxnr,
  79. </if>
  80. <if test='null != qxdj'>
  81. qxdj,
  82. </if>
  83. <if test='null != clcs'>
  84. clcs,
  85. </if>
  86. <if test='null != xhzt'>
  87. xhzt,
  88. </if>
  89. <if test='null != whby'>
  90. whby,
  91. </if>
  92. <if test='null != jyqs'>
  93. jyqs,
  94. </if>
  95. <if test='null != sbzt'>
  96. sbzt,
  97. </if>
  98. <if test='null != operator'>
  99. operator,
  100. </if>
  101. <if test='null != gzldr'>
  102. gzldr,
  103. </if>
  104. <if test='null != confirmUser'>
  105. confirm_user,
  106. </if>
  107. <if test='null != operationDate'>
  108. operation_date,
  109. </if>
  110. <if test='null != remark'>
  111. remark,
  112. </if>
  113. <if test='null != submitState'>
  114. submit_state,
  115. </if>
  116. <if test='null != delFlag'>
  117. del_flag,
  118. </if>
  119. <if test='null != createBy'>
  120. create_by,
  121. </if>
  122. <if test='null != createTime'>
  123. create_time,
  124. </if>
  125. <if test='null != updateBy'>
  126. update_by,
  127. </if>
  128. <if test='null != updateTime'>
  129. update_time
  130. </if>
  131. </trim>
  132. <trim prefix="values (" suffix=")" suffixOverrides=",">
  133. <if test='null != deptStationId'>
  134. #{deptStationId},
  135. </if>
  136. <if test='null != pillarCode'>
  137. #{pillarCode},
  138. </if>
  139. <if test='null != qxly'>
  140. #{qxly},
  141. </if>
  142. <if test='null != wz'>
  143. #{wz},
  144. </if>
  145. <if test='null != qxnr'>
  146. #{qxnr},
  147. </if>
  148. <if test='null != qxdj'>
  149. #{qxdj},
  150. </if>
  151. <if test='null != clcs'>
  152. #{clcs},
  153. </if>
  154. <if test='null != xhzt'>
  155. #{xhzt},
  156. </if>
  157. <if test='null != whby'>
  158. #{whby},
  159. </if>
  160. <if test='null != jyqs'>
  161. #{jyqs},
  162. </if>
  163. <if test='null != sbzt'>
  164. #{sbzt},
  165. </if>
  166. <if test='null != operator'>
  167. #{operator},
  168. </if>
  169. <if test='null != gzldr'>
  170. #{gzldr},
  171. </if>
  172. <if test='null != confirmUser'>
  173. #{confirmUser},
  174. </if>
  175. <if test='null != operationDate'>
  176. #{operationDate},
  177. </if>
  178. <if test='null != remark'>
  179. #{remark},
  180. </if>
  181. <if test='null != submitState'>
  182. #{submitState},
  183. </if>
  184. <if test='null != delFlag'>
  185. #{delFlag},
  186. </if>
  187. <if test='null != createBy'>
  188. #{createBy},
  189. </if>
  190. <if test='null != createTime'>
  191. #{createTime},
  192. </if>
  193. <if test='null != updateBy'>
  194. #{updateBy},
  195. </if>
  196. <if test='null != updateTime'>
  197. #{updateTime}
  198. </if>
  199. </trim>
  200. </insert>
  201. <delete id="delete">
  202. UPDATE bus_jceb_qmjcjl
  203. set del_flag='1'
  204. WHERE id = #{id}
  205. </delete>
  206. <update id="update" parameterType="com.railway.business.catenary.domain.BusJcebQmjcjl">
  207. UPDATE bus_jceb_qmjcjl
  208. <set>
  209. <if test='null != deptStationId'>dept_station_id = #{deptStationId},</if>
  210. <if test='null != pillarCode'>pillar_code = #{pillarCode},</if>
  211. <if test='null != qxly'>qxly = #{qxly},</if>
  212. <if test='null != wz'>wz = #{wz},</if>
  213. <if test='null != qxnr'>qxnr = #{qxnr},</if>
  214. <if test='null != qxdj'>qxdj = #{qxdj},</if>
  215. <if test='null != clcs'>clcs = #{clcs},</if>
  216. <if test='null != xhzt'>xhzt = #{xhzt},</if>
  217. <if test='null != whby'>whby = #{whby},</if>
  218. <if test='null != jyqs'>jyqs = #{jyqs},</if>
  219. <if test='null != sbzt'>sbzt = #{sbzt},</if>
  220. <if test='null != operator'>operator = #{operator},</if>
  221. <if test='null != gzldr'>gzldr = #{gzldr},</if>
  222. <if test='null != confirmUser'>confirm_user = #{confirmUser},</if>
  223. <if test='null != operationDate'>operation_date = #{operationDate},</if>
  224. <if test='null != remark'>remark = #{remark},</if>
  225. <if test='null != submitState'>submit_state = #{submitState},</if>
  226. <if test='null != delFlag'>del_flag = #{delFlag},</if>
  227. <if test='null != updateBy'>update_by = #{updateBy},</if>
  228. <if test='null != updateTime'>update_time = #{updateTime}</if>
  229. </set>
  230. WHERE id = #{id}
  231. </update>
  232. <select id="getInfo" resultMap="BaseResultMap">
  233. SELECT
  234. <include refid="Base_Column_List"/>
  235. FROM bus_jceb_qmjcjl t
  236. LEFT JOIN v_station v on t.dept_station_id = v.dept_station_id
  237. WHERE t.del_flag = '0' AND t.id = #{id}
  238. </select>
  239. <select id="getList" resultMap="BaseResultMap">
  240. SELECT
  241. <include refid="Base_Column_List"/>
  242. FROM bus_jceb_qmjcjl t
  243. LEFT JOIN v_station v on t.dept_station_id = v.dept_station_id
  244. <where>
  245. t.del_flag = '0'
  246. <if test="stationId!=null and stationId!=''">
  247. and v.station_id=#{stationId}
  248. </if>
  249. <if test="pillarCode!=null and pillarCode!=''">
  250. and t.pillar_code=#{pillarCode}
  251. </if>
  252. <if test="qxly!=null and qxly!=''">
  253. and t.qxly=#{qxly}
  254. </if>
  255. <if test="wz!=null and wz!=''">
  256. and t.wz=#{wz}
  257. </if>
  258. <if test="qxnr!=null and qxnr!=''">
  259. and t.qxnr=#{qxnr}
  260. </if>
  261. <if test="qxdj!=null and qxdj!=''">
  262. and t.qxdj=#{qxdj}
  263. </if>
  264. <if test="clcs!=null and clcs!=''">
  265. and t.clcs=#{clcs}
  266. </if>
  267. <if test="xhzt!=null and xhzt!=''">
  268. and t.xhzt=#{xhzt}
  269. </if>
  270. <if test="whby!=null and whby!=''">
  271. and t.whby=#{whby}
  272. </if>
  273. <if test="jyqs!=null and jyqs!=''">
  274. and t.jyqs=#{jyqs}
  275. </if>
  276. <if test="sbzt!=null and sbzt!=''">
  277. and t.sbzt=#{sbzt}
  278. </if>
  279. <if test="operator!=null and operator!=''">
  280. and t.operator=#{operator}
  281. </if>
  282. <if test="gzldr!=null and gzldr!=''">
  283. and t.gzldr=#{gzldr}
  284. </if>
  285. <if test="confirmUser!=null and confirmUser!=''">
  286. and t.confirm_user=#{confirmUser}
  287. </if>
  288. <if test="operationDate!=null and operationDate!=''">
  289. and t.operation_date=#{operationDate}
  290. </if>
  291. <if test="remark!=null and remark!=''">
  292. and t.remark=#{remark}
  293. </if>
  294. <if test="submitState!=null and submitState!=''">
  295. and t.submit_state <![CDATA[ >= ]]> #{submitState}
  296. </if>
  297. <if test="delFlag!=null and delFlag!=''">
  298. and t.del_flag=#{delFlag}
  299. </if>
  300. <if test="createBy!=null and createBy!=''">
  301. and t.create_by=#{createBy}
  302. </if>
  303. <if test="createTime!=null and createTime!=''">
  304. and t.create_time=#{createTime}
  305. </if>
  306. <if test="updateBy!=null and updateBy!=''">
  307. and t.update_by=#{updateBy}
  308. </if>
  309. <if test="updateTime!=null and updateTime!=''">
  310. and t.update_time=#{updateTime}
  311. </if>
  312. </where>
  313. <if test="orderBy!=null and orderBy!=''">
  314. order by t.${orderBy}
  315. </if>
  316. <if test="isAsc!=null and isAsc!=''">
  317. <if test="isAsc == '1'.toString()">
  318. asc
  319. </if>
  320. <if test="isAsc == '0'.toString()">
  321. desc
  322. </if>
  323. </if>
  324. </select>
  325. <resultMap id="JcebResultMap" type="com.railway.business.catenary.domain.vo.JcebRecordVo">
  326. <result column="id" property="id"/>
  327. <result column="dept_name" property="deptName"/>
  328. <result column="station_name" property="stationName"/>
  329. <result column="operation_date" property="operationDate"/>
  330. <result column="operator" property="operator"/>
  331. <result column="jcebType" property="jcebType"/>
  332. </resultMap>
  333. <select id="getListByType" resultMap="JcebResultMap">
  334. SELECT t.id, v.dept_name, v.station_name, t.operation_date, t.operator, #{jcebType} as jcebType
  335. FROM bus_jceb_qmjcjl t
  336. LEFT JOIN v_station v on t.dept_station_id = v.dept_station_id
  337. <where>
  338. t.del_flag='0'
  339. <if test="stationId!=null and stationId!=''">
  340. and v.station_id=#{stationId}
  341. </if>
  342. <if test="pillarCode!=null and pillarCode!=''">
  343. and t.pillar_start=#{pillarCode}
  344. </if>
  345. <if test="operator!=null and operator!=''">
  346. and t.operator=#{operator}
  347. </if>
  348. <if test="createBy!=null and createBy!=''">
  349. and t.create_by=#{createBy}
  350. </if>
  351. </where>
  352. </select>
  353. <resultMap id="JcebCountResultMap" type="com.railway.business.catenary.domain.vo.JcebRecordVo">
  354. <result column="c" property="count"/>
  355. <result column="operation_date" property="operationDate"/>
  356. </resultMap>
  357. <select id="getCountByType" resultMap="JcebCountResultMap">
  358. SELECT count(*) c, max(t.operation_date) as operation_date
  359. FROM bus_jceb_qmjcjl t
  360. LEFT JOIN v_station v on t.dept_station_id = v.dept_station_id
  361. <where>
  362. t.del_flag='0'
  363. <if test="stationId!=null and stationId!=''">
  364. and v.station_id=#{stationId}
  365. </if>
  366. <if test="pillarCode!=null and pillarCode!=''">
  367. and t.pillar_start=#{pillarCode}
  368. </if>
  369. <if test="operator!=null and operator!=''">
  370. and t.operator=#{operator}
  371. </if>
  372. <if test="createBy!=null and createBy!=''">
  373. and t.create_by=#{createBy}
  374. </if>
  375. </where>
  376. </select>
  377. </mapper>