BusWjcxcMapper.xml 7.2 KB

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