BusJcxcMapper.xml 8.1 KB

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