BusJcxcMapper.xml 7.8 KB

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