BusJcxcMapper.xml 7.1 KB

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