BusJcebJyzqsjlMapper.xml 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273
  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.BusJcebJyzqsjlMapper">
  5. <resultMap id="BaseResultMap" type="com.railway.business.catenary.domain.BusJcebJyzqsjl">
  6. <result column="id" property="id"/>
  7. <result column="jybjmc" property="jybjmc"/>
  8. <result column="zq" property="zq"/>
  9. <result column="dept_id" property="deptId"/>
  10. <result column="dept_name" property="deptName"/>
  11. <result column="line_id" property="lineId"/>
  12. <result column="line_name" property="lineName"/>
  13. <result column="station_id" property="stationId"/>
  14. <result column="station_name" property="stationName"/>
  15. <result column="pillar_code" property="pillarCode"/>
  16. <result column="sl" property="sl"/>
  17. <result column="operation_date" property="operationDate"/>
  18. <result column="operator" property="operator"/>
  19. <result column="remark" property="remark"/>
  20. <result column="submit_state" property="submitState"/>
  21. <result column="del_flag" property="delFlag"/>
  22. <result column="create_by" property="createBy"/>
  23. <result column="create_time" property="createTime"/>
  24. <result column="update_by" property="updateBy"/>
  25. <result column="update_time" property="updateTime"/>
  26. </resultMap>
  27. <sql id="Base_Column_List">
  28. t.id,
  29. v.dept_id,
  30. v.dept_name,
  31. v.line_id,
  32. v.line_name,
  33. v.station_name as station_name,
  34. t.station_id,
  35. t.xingbie,
  36. t.pillar_code,
  37. t.jybjmc,
  38. t.zq,
  39. t.sl,
  40. t.operation_date,
  41. t.operator,
  42. t.remark,
  43. t.submit_state,
  44. t.del_flag,
  45. t.create_by,
  46. t.create_time,
  47. t.update_by,
  48. t.update_time
  49. </sql>
  50. <insert id="insert" parameterType="com.railway.business.catenary.domain.BusJcebJyzqsjl">
  51. <selectKey keyProperty="id" order="BEFORE" resultType="String">
  52. select replace(uuid(), '-', '') from dual
  53. </selectKey>
  54. INSERT INTO bus_jceb_jyzqsjl
  55. <trim prefix="(" suffix=")" suffixOverrides=",">
  56. <if test='null != jybjmc'>
  57. jybjmc,
  58. </if>
  59. <if test='null != zq'>
  60. zq,
  61. </if>
  62. <if test='null != stationId'>
  63. station_id,
  64. </if>
  65. <if test='null != xingbie'>
  66. xingbie,
  67. </if>
  68. <if test='null != pillarCode'>
  69. pillar_code,
  70. </if>
  71. <if test='null != sl'>
  72. sl,
  73. </if>
  74. <if test='null != operationDate'>
  75. operation_date,
  76. </if>
  77. <if test='null != operator'>
  78. operator,
  79. </if>
  80. <if test='null != remark'>
  81. remark,
  82. </if>
  83. <if test='null != submitState'>
  84. submit_state,
  85. </if>
  86. <if test='null != delFlag'>
  87. del_flag,
  88. </if>
  89. <if test='null != createBy'>
  90. create_by,
  91. </if>
  92. <if test='null != createTime'>
  93. create_time,
  94. </if>
  95. <if test='null != updateBy'>
  96. update_by,
  97. </if>
  98. <if test='null != updateTime'>
  99. update_time
  100. </if>
  101. </trim>
  102. <trim prefix="values (" suffix=")" suffixOverrides=",">
  103. <if test='null != jybjmc'>
  104. #{jybjmc},
  105. </if>
  106. <if test='null != zq'>
  107. #{zq},
  108. </if>
  109. <if test='null != stationId'>
  110. #{stationId},
  111. </if>
  112. <if test='null != xingbie'>
  113. #{xingbie},
  114. </if>
  115. <if test='null != pillarCode'>
  116. #{pillarCode},
  117. </if>
  118. <if test='null != sl'>
  119. #{sl},
  120. </if>
  121. <if test='null != operationDate'>
  122. #{operationDate},
  123. </if>
  124. <if test='null != operator'>
  125. #{operator},
  126. </if>
  127. <if test='null != remark'>
  128. #{remark},
  129. </if>
  130. <if test='null != submitState'>
  131. #{submitState},
  132. </if>
  133. <if test='null != delFlag'>
  134. #{delFlag},
  135. </if>
  136. <if test='null != createBy'>
  137. #{createBy},
  138. </if>
  139. <if test='null != createTime'>
  140. #{createTime},
  141. </if>
  142. <if test='null != updateBy'>
  143. #{updateBy},
  144. </if>
  145. <if test='null != updateTime'>
  146. #{updateTime}
  147. </if>
  148. </trim>
  149. </insert>
  150. <delete id="delete">
  151. UPDATE bus_jceb_jyzqsjl
  152. set del_flag='1'
  153. WHERE id = #{id}
  154. </delete>
  155. <update id="update" parameterType="com.railway.business.catenary.domain.BusJcebJyzqsjl">
  156. UPDATE bus_jceb_jyzqsjl
  157. <set>
  158. <if test='null != jybjmc'>jybjmc = #{jybjmc},</if>
  159. <if test='null != zq'>zq = #{zq},</if>
  160. <if test='null != stationId'>station_id = #{stationId},</if>
  161. <if test='null != xingbie'>xingbie = #{xingbie},</if>
  162. <if test='null != pillarCode'>pillar_code = #{pillarCode},</if>
  163. <if test='null != sl'>sl = #{sl},</if>
  164. <if test='null != operationDate'>operation_date = #{operationDate},</if>
  165. <if test='null != operator'>operator = #{operator},</if>
  166. <if test='null != remark'>remark = #{remark},</if>
  167. <if test='null != submitState'>submit_state = #{submitState},</if>
  168. <if test='null != delFlag'>del_flag = #{delFlag},</if>
  169. <if test='null != createBy'>create_by = #{createBy},</if>
  170. <if test='null != createTime'>create_time = #{createTime},</if>
  171. <if test='null != updateBy'>update_by = #{updateBy},</if>
  172. <if test='null != updateTime'>update_time = #{updateTime}</if>
  173. </set>
  174. WHERE id = #{id}
  175. </update>
  176. <select id="getInfo" resultMap="BaseResultMap">
  177. SELECT
  178. <include refid="Base_Column_List"/>
  179. FROM bus_jceb_jyzqsjl t
  180. LEFT JOIN v_station v on t.station_id = v.station_id
  181. WHERE t.del_flag='0' and t.id = #{id}
  182. </select>
  183. <select id="getList" resultMap="BaseResultMap">
  184. SELECT
  185. <include refid="Base_Column_List"/>
  186. FROM bus_jceb_jyzqsjl t
  187. LEFT JOIN v_station v on t.station_id = v.station_id
  188. <where>
  189. t.del_flag='0'
  190. <if test="zq!=null and zq!=''">
  191. and t.zq=#{zq}
  192. </if>
  193. <if test="lineId!=null and lineId!=''">
  194. and v.line_id=#{lineId}
  195. </if>
  196. <if test="xingbie!=null and xingbie!=''">
  197. and t.xingbie=#{xingbie}
  198. </if>
  199. <if test="stationId!=null and stationId!=''">
  200. and t.station_id=#{stationId}
  201. </if>
  202. <if test="pillarCode!=null and pillarCode!=''">
  203. and t.pillar_code=#{pillarCode}
  204. </if>
  205. <if test="sl!=null and sl!=''">
  206. and t.sl=#{sl}
  207. </if>
  208. <if test="operationDate!=null and operationDate!=''">
  209. and t.operation_date=#{operationDate}
  210. </if>
  211. <if test="operator!=null and operator!=''">
  212. and t.operator=#{operator}
  213. </if>
  214. <if test="remark!=null and remark!=''">
  215. and t.remark=#{remark}
  216. </if>
  217. <if test="submitState!=null and submitState!=''">
  218. and t.submit_state=#{submitState}
  219. </if>
  220. <if test="delFlag!=null and delFlag!=''">
  221. and t.del_flag=#{delFlag}
  222. </if>
  223. <if test="createBy!=null and createBy!=''">
  224. and t.create_by=#{createBy}
  225. </if>
  226. <if test="createTime!=null and createTime!=''">
  227. and t.create_time=#{createTime}
  228. </if>
  229. <if test="updateBy!=null and updateBy!=''">
  230. and t.update_by=#{updateBy}
  231. </if>
  232. <if test="updateTime!=null and updateTime!=''">
  233. and t.update_time=#{updateTime}
  234. </if>
  235. </where>
  236. </select>
  237. <resultMap id="JcebResultMap" type="com.railway.business.catenary.domain.vo.JcebRecordVo">
  238. <result column="dept_name" property="deptName"/>
  239. <result column="station_name" property="stationName"/>
  240. <result column="operation_date" property="operationDate"/>
  241. <result column="operator" property="operator"/>
  242. <result column="jcebType" property="jcebType"/>
  243. </resultMap>
  244. <select id="getListByType" resultMap="JcebResultMap">
  245. SELECT v.dept_name, v.station_name, t.operation_date, t.operator, #{jcebType} as jcebType
  246. FROM bus_jceb_jyzqsjl t
  247. LEFT JOIN v_station v on t.station_id = v.station_id
  248. <where>
  249. t.del_flag='0'
  250. <if test="stationId!=null and stationId!=''">
  251. and t.station_id=#{stationId}
  252. </if>
  253. <if test="pillarCode!=null and pillarCode!=''">
  254. and t.pillar_start=#{pillarCode}
  255. </if>
  256. <if test="operator!=null and operator!=''">
  257. and t.operator=#{operator}
  258. </if>
  259. </where>
  260. </select>
  261. </mapper>