BusStationMapper.xml 7.5 KB

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