BusJcebXsjcjlMapper.xml 11 KB

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