BusJcebQmjcjlMapper.xml 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351
  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="pillar_code" property="pillarCode"/>
  10. <result column="qxly" property="qxly"/>
  11. <result column="wz" property="wz"/>
  12. <result column="qxnr" property="qxnr"/>
  13. <result column="qxdj" property="qxdj"/>
  14. <result column="clcs" property="clcs"/>
  15. <result column="xhzt" property="xhzt"/>
  16. <result column="whby" property="whby"/>
  17. <result column="jyqs" property="jyqs"/>
  18. <result column="sbzt" property="sbzt"/>
  19. <result column="operator" property="operator"/>
  20. <result column="gzldr" property="gzldr"/>
  21. <result column="confirm_user" property="confirmUser"/>
  22. <result column="operation_date" property="operationDate"/>
  23. <result column="remark" property="remark"/>
  24. <result column="submit_state" property="submitState"/>
  25. <result column="del_flag" property="delFlag"/>
  26. <result column="create_by" property="createBy"/>
  27. <result column="create_time" property="createTime"/>
  28. <result column="update_by" property="updateBy"/>
  29. <result column="update_time" property="updateTime"/>
  30. </resultMap>
  31. <sql id="Base_Column_List">
  32. t.id,
  33. t.station_id,
  34. v.station_name,
  35. t.pillar_code,
  36. t.qxly,
  37. t.wz,
  38. t.qxnr,
  39. t.qxdj,
  40. t.clcs,
  41. t.xhzt,
  42. t.whby,
  43. t.jyqs,
  44. t.sbzt,
  45. t.operator,
  46. t.gzldr,
  47. t.confirm_user,
  48. t.operation_date,
  49. t.remark,
  50. t.submit_state,
  51. t.del_flag,
  52. t.create_by,
  53. t.create_time,
  54. t.update_by,
  55. t.update_time
  56. </sql>
  57. <insert id="insert" parameterType="com.railway.business.catenary.domain.BusJcebQmjcjl">
  58. <selectKey keyProperty="id" order="BEFORE" resultType="String">
  59. select replace(uuid(), '-', '') from dual
  60. </selectKey>
  61. INSERT INTO bus_jceb_qmjcjl
  62. <trim prefix="(" suffix=")" suffixOverrides=",">
  63. <if test='null != stationId'>
  64. station_id,
  65. </if>
  66. <if test='null != pillarCode'>
  67. pillar_code,
  68. </if>
  69. <if test='null != qxly'>
  70. qxly,
  71. </if>
  72. <if test='null != wz'>
  73. wz,
  74. </if>
  75. <if test='null != qxnr'>
  76. qxnr,
  77. </if>
  78. <if test='null != qxdj'>
  79. qxdj,
  80. </if>
  81. <if test='null != clcs'>
  82. clcs,
  83. </if>
  84. <if test='null != xhzt'>
  85. xhzt,
  86. </if>
  87. <if test='null != whby'>
  88. whby,
  89. </if>
  90. <if test='null != jyqs'>
  91. jyqs,
  92. </if>
  93. <if test='null != sbzt'>
  94. sbzt,
  95. </if>
  96. <if test='null != operator'>
  97. operator,
  98. </if>
  99. <if test='null != gzldr'>
  100. gzldr,
  101. </if>
  102. <if test='null != confirmUser'>
  103. confirm_user,
  104. </if>
  105. <if test='null != operationDate'>
  106. operation_date,
  107. </if>
  108. <if test='null != remark'>
  109. remark,
  110. </if>
  111. <if test='null != submitState'>
  112. submit_state,
  113. </if>
  114. <if test='null != delFlag'>
  115. del_flag,
  116. </if>
  117. <if test='null != createBy'>
  118. create_by,
  119. </if>
  120. <if test='null != createTime'>
  121. create_time,
  122. </if>
  123. <if test='null != updateBy'>
  124. update_by,
  125. </if>
  126. <if test='null != updateTime'>
  127. update_time
  128. </if>
  129. </trim>
  130. <trim prefix="values (" suffix=")" suffixOverrides=",">
  131. <if test='null != stationId'>
  132. #{stationId},
  133. </if>
  134. <if test='null != pillarCode'>
  135. #{pillarCode},
  136. </if>
  137. <if test='null != qxly'>
  138. #{qxly},
  139. </if>
  140. <if test='null != wz'>
  141. #{wz},
  142. </if>
  143. <if test='null != qxnr'>
  144. #{qxnr},
  145. </if>
  146. <if test='null != qxdj'>
  147. #{qxdj},
  148. </if>
  149. <if test='null != clcs'>
  150. #{clcs},
  151. </if>
  152. <if test='null != xhzt'>
  153. #{xhzt},
  154. </if>
  155. <if test='null != whby'>
  156. #{whby},
  157. </if>
  158. <if test='null != jyqs'>
  159. #{jyqs},
  160. </if>
  161. <if test='null != sbzt'>
  162. #{sbzt},
  163. </if>
  164. <if test='null != operator'>
  165. #{operator},
  166. </if>
  167. <if test='null != gzldr'>
  168. #{gzldr},
  169. </if>
  170. <if test='null != confirmUser'>
  171. #{confirmUser},
  172. </if>
  173. <if test='null != operationDate'>
  174. #{operationDate},
  175. </if>
  176. <if test='null != remark'>
  177. #{remark},
  178. </if>
  179. <if test='null != submitState'>
  180. #{submitState},
  181. </if>
  182. <if test='null != delFlag'>
  183. #{delFlag},
  184. </if>
  185. <if test='null != createBy'>
  186. #{createBy},
  187. </if>
  188. <if test='null != createTime'>
  189. #{createTime},
  190. </if>
  191. <if test='null != updateBy'>
  192. #{updateBy},
  193. </if>
  194. <if test='null != updateTime'>
  195. #{updateTime}
  196. </if>
  197. </trim>
  198. </insert>
  199. <delete id="delete">
  200. UPDATE bus_jceb_qmjcjl
  201. set del_flag='1'
  202. WHERE id = #{id}
  203. </delete>
  204. <update id="update" parameterType="com.railway.business.catenary.domain.BusJcebQmjcjl">
  205. UPDATE bus_jceb_qmjcjl
  206. <set>
  207. <if test='null != stationId'>station_id = #{stationId},</if>
  208. <if test='null != pillarCode'>pillar_code = #{pillarCode},</if>
  209. <if test='null != qxly'>qxly = #{qxly},</if>
  210. <if test='null != wz'>wz = #{wz},</if>
  211. <if test='null != qxnr'>qxnr = #{qxnr},</if>
  212. <if test='null != qxdj'>qxdj = #{qxdj},</if>
  213. <if test='null != clcs'>clcs = #{clcs},</if>
  214. <if test='null != xhzt'>xhzt = #{xhzt},</if>
  215. <if test='null != whby'>whby = #{whby},</if>
  216. <if test='null != jyqs'>jyqs = #{jyqs},</if>
  217. <if test='null != sbzt'>sbzt = #{sbzt},</if>
  218. <if test='null != operator'>operator = #{operator},</if>
  219. <if test='null != gzldr'>gzldr = #{gzldr},</if>
  220. <if test='null != confirmUser'>confirm_user = #{confirmUser},</if>
  221. <if test='null != operationDate'>operation_date = #{operationDate},</if>
  222. <if test='null != remark'>remark = #{remark},</if>
  223. <if test='null != submitState'>submit_state = #{submitState},</if>
  224. <if test='null != delFlag'>del_flag = #{delFlag},</if>
  225. <if test='null != createBy'>create_by = #{createBy},</if>
  226. <if test='null != createTime'>create_time = #{createTime},</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.station_id = v.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.station_id = v.station_id
  244. <where>
  245. t.del_flag = '0'
  246. <if test="stationId!=null and stationId!=''">
  247. and t.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=#{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. order by str_to_date(t.operation_date,'%Y-%m-%d') desc
  314. </select>
  315. <resultMap id="JcebResultMap" type="com.railway.business.catenary.domain.vo.JcebRecordVo">
  316. <result column="dept_name" property="deptName"/>
  317. <result column="station_name" property="stationName"/>
  318. <result column="operation_date" property="operationDate"/>
  319. <result column="operator" property="operator"/>
  320. <result column="jcebType" property="jcebType"/>
  321. </resultMap>
  322. <select id="getListByType" resultMap="JcebResultMap">
  323. SELECT v.dept_name, v.station_name, t.operation_date, t.operator, #{jcebType} as jcebType
  324. FROM bus_jceb_qmjcjl t
  325. LEFT JOIN v_station v on t.station_id = v.station_id
  326. <where>
  327. t.del_flag='0'
  328. <if test="stationId!=null and stationId!=''">
  329. and t.station_id=#{stationId}
  330. </if>
  331. <if test="pillarCode!=null and pillarCode!=''">
  332. and t.pillar_start=#{pillarCode}
  333. </if>
  334. <if test="operator!=null and operator!=''">
  335. and t.operator=#{operator}
  336. </if>
  337. </where>
  338. </select>
  339. </mapper>