BusDmcgyqMapper.xml 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323
  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.BusDmcgyqMapper">
  5. <resultMap id="BaseResultMap" type="com.railway.business.baseinfo.domain.BusDmcgyq">
  6. <result column="id" property="id"/>
  7. <result column="dept_id" property="deptId"/>
  8. <result column="dept_id" property="deptId"/>
  9. <result column="dept_name" property="deptName"/>
  10. <result column="line_id" property="lineId"/>
  11. <result column="line_name" property="lineName"/>
  12. <result column="station_id" property="stationId"/>
  13. <result column="station_name" property="stationName"/>
  14. <result column="dept_station_id" property="deptStationId"/>
  15. <result column="xingbie" property="xingbie"/>
  16. <result column="xingbie_text" property="xingbieText"/>
  17. <result column="pillar_area" property="pillarArea"/>
  18. <result column="station_track" property="stationTrack"/>
  19. <result column="gxms" property="gxms"/>
  20. <result column="fxcs" property="fxcs"/>
  21. <result column="fxmc" property="fxmc"/>
  22. <result column="mdh" property="mdh"/>
  23. <result column="sbbh" property="sbbh"/>
  24. <result column="gzlx" property="gzlx"/>
  25. <result column="czlc" property="czlc"/>
  26. <result column="fxzxlc" property="fxzxlc"/>
  27. <result column="sccj" property="sccj"/>
  28. <result column="xh" property="xh"/>
  29. <result column="line_id" property="lineId"/>
  30. <result column="station_id" property="stationId"/>
  31. <result column="del_flag" property="delFlag"/>
  32. <result column="create_by" property="createBy"/>
  33. <result column="create_time" property="createTime"/>
  34. <result column="update_by" property="updateBy"/>
  35. <result column="update_time" property="updateTime"/>
  36. <result column="sjbh" property="sjbh"/>
  37. </resultMap>
  38. <sql id="Base_Column_List">
  39. t.id,
  40. v.dept_id,
  41. v.dept_name,
  42. v.line_id,
  43. v.line_name,
  44. v.station_name as station_name,
  45. v.station_id,
  46. t.dept_station_id,
  47. t.xingbie,
  48. t.pillar_area,
  49. t.station_track,
  50. t.gxms,
  51. t.fxcs,
  52. t.fxmc,
  53. t.mdh,
  54. t.sbbh,
  55. t.gzlx,
  56. t.czlc,
  57. t.fxzxlc,
  58. t.sccj,
  59. t.xh,
  60. t.del_flag,
  61. t.create_by,
  62. t.create_time,
  63. t.update_by,
  64. t.update_time,
  65. t.sjbh
  66. </sql>
  67. <insert id="insert" parameterType="com.railway.business.baseinfo.domain.BusDmcgyq">
  68. <selectKey keyProperty="id" order="AFTER" resultType="Long">
  69. select @@IDENTITY as id
  70. </selectKey>
  71. INSERT INTO base_dmcgyq
  72. <trim prefix="(" suffix=")" suffixOverrides=",">
  73. <if test='null != deptStationId'>
  74. dept_station_id,
  75. </if>
  76. <if test='null != xingbie'>
  77. xingbie,
  78. </if>
  79. <if test='null != pillarArea'>
  80. pillar_area,
  81. </if>
  82. <if test='null != stationTrack'>
  83. station_track,
  84. </if>
  85. <if test='null != gxms'>
  86. gxms,
  87. </if>
  88. <if test='null != fxcs'>
  89. fxcs,
  90. </if>
  91. <if test='null != fxmc'>
  92. fxmc,
  93. </if>
  94. <if test='null != mdh'>
  95. mdh,
  96. </if>
  97. <if test='null != sbbh'>
  98. sbbh,
  99. </if>
  100. <if test='null != gzlx'>
  101. gzlx,
  102. </if>
  103. <if test='null != czlc'>
  104. czlc,
  105. </if>
  106. <if test='null != fxzxlc'>
  107. fxzxlc,
  108. </if>
  109. <if test='null != sccj'>
  110. sccj,
  111. </if>
  112. <if test='null != xh'>
  113. xh,
  114. </if>
  115. <if test='null != delFlag'>
  116. del_flag,
  117. </if>
  118. <if test='null != createBy'>
  119. create_by,
  120. </if>
  121. <if test='null != createTime'>
  122. create_time,
  123. </if>
  124. <if test='null != updateBy'>
  125. update_by,
  126. </if>
  127. <if test='null != updateTime'>
  128. update_time,
  129. </if>
  130. <if test='null != sjbh'>
  131. sjbh
  132. </if>
  133. </trim>
  134. <trim prefix="values (" suffix=")" suffixOverrides=",">
  135. <if test='null != stationId'>
  136. #{station_id},
  137. </if>
  138. <if test='null != xingbie'>
  139. #{xingbie},
  140. </if>
  141. <if test='null != pillarArea'>
  142. #{pillarArea},
  143. </if>
  144. <if test='null != stationTrack'>
  145. #{stationTrack},
  146. </if>
  147. <if test='null != gxms'>
  148. #{gxms},
  149. </if>
  150. <if test='null != fxcs'>
  151. #{fxcs},
  152. </if>
  153. <if test='null != fxmc'>
  154. #{fxmc},
  155. </if>
  156. <if test='null != mdh'>
  157. #{mdh},
  158. </if>
  159. <if test='null != sbbh'>
  160. #{sbbh},
  161. </if>
  162. <if test='null != gzlx'>
  163. #{gzlx},
  164. </if>
  165. <if test='null != czlc'>
  166. #{czlc},
  167. </if>
  168. <if test='null != fxzxlc'>
  169. #{fxzxlc},
  170. </if>
  171. <if test='null != sccj'>
  172. #{sccj},
  173. </if>
  174. <if test='null != xh'>
  175. #{xh},
  176. </if>
  177. <if test='null != delFlag'>
  178. #{delFlag},
  179. </if>
  180. <if test='null != createBy'>
  181. #{createBy},
  182. </if>
  183. <if test='null != createTime'>
  184. #{createTime},
  185. </if>
  186. <if test='null != updateBy'>
  187. #{updateBy},
  188. </if>
  189. <if test='null != updateTime'>
  190. #{updateTime},
  191. </if>
  192. <if test='null != sjbh'>
  193. #{sjbh}
  194. </if>
  195. </trim>
  196. </insert>
  197. <delete id="delete">
  198. UPDATE base_dmcgyq
  199. set del_flag='1'
  200. WHERE id = #{id}
  201. </delete>
  202. <update id="update" parameterType="com.railway.business.baseinfo.domain.BusDmcgyq">
  203. UPDATE base_dmcgyq
  204. <set>
  205. <if test='null != deptStationId'>dept_station_id = #{deptStationId},</if>
  206. <if test='null != xingbie'>xingbie = #{xingbie},</if>
  207. <if test='null != pillarArea'>pillar_area = #{pillarArea},</if>
  208. <if test='null != stationTrack'>station_track = #{stationTrack},</if>
  209. <if test='null != gxms'>gxms = #{gxms},</if>
  210. <if test='null != fxcs'>fxcs = #{fxcs},</if>
  211. <if test='null != fxmc'>fxmc = #{fxmc},</if>
  212. <if test='null != mdh'>mdh = #{mdh},</if>
  213. <if test='null != sbbh'>sbbh = #{sbbh},</if>
  214. <if test='null != gzlx'>gzlx = #{gzlx},</if>
  215. <if test='null != czlc'>czlc = #{czlc},</if>
  216. <if test='null != fxzxlc'>fxzxlc = #{fxzxlc},</if>
  217. <if test='null != sccj'>sccj = #{sccj},</if>
  218. <if test='null != xh'>xh = #{xh},</if>
  219. <if test='null != delFlag'>del_flag = #{delFlag},</if>
  220. <if test='null != updateBy'>update_by = #{updateBy},</if>
  221. <if test='null != updateTime'>update_time = #{updateTime},</if>
  222. <if test='null != sjbh'>sjbh = #{sjbh}</if>
  223. </set>
  224. WHERE id = #{id}
  225. </update>
  226. <select id="getInfo" resultMap="BaseResultMap">
  227. SELECT
  228. <include refid="Base_Column_List"/>, dict.dict_label as xingbie_text
  229. FROM base_dmcgyq t
  230. LEFT JOIN v_station v on t.dept_station_id = v.dept_station_id
  231. LEFT JOIN sys_dict_data dict ON (t.xingbie = dict.dict_value AND dict.dict_type = 'xingbie')
  232. WHERE t.del_flag='0' and t.id = #{id}
  233. </select>
  234. <select id="getList" resultMap="BaseResultMap">
  235. SELECT
  236. <include refid="Base_Column_List"/>, dict.dict_label as xingbie_text
  237. FROM base_dmcgyq t
  238. LEFT JOIN v_station v on t.dept_station_id = v.dept_station_id
  239. LEFT JOIN sys_dict_data dict ON (t.xingbie = dict.dict_value AND dict.dict_type = 'xingbie')
  240. <where>
  241. t.del_flag='0'
  242. <if test="deptId!=null and deptId!=''">
  243. and v.dept_id=#{deptId}
  244. </if>
  245. <if test="lineId!=null and lineId!=''">
  246. and v.line_id=#{lineId}
  247. </if>
  248. <if test="stationId!=null and stationId!=''">
  249. and v.station_id=#{stationId}
  250. </if>
  251. <if test="deptStationId!=null and deptStationId!=''">
  252. and t.dept_station_id=#{deptStationId}
  253. </if>
  254. <if test="xingbie!=null and xingbie!=''">
  255. and t.xingbie=#{xingbie}
  256. </if>
  257. <if test="pillarArea!=null and pillarArea!=''">
  258. and t.pillar_area=#{pillarArea}
  259. </if>
  260. <if test="stationTrack!=null and stationTrack!=''">
  261. and t.station_track=#{stationTrack}
  262. </if>
  263. <if test="gxms!=null and gxms!=''">
  264. and t.gxms=#{gxms}
  265. </if>
  266. <if test="fxcs!=null and fxcs!=''">
  267. and t.fxcs=#{fxcs}
  268. </if>
  269. <if test="fxmc!=null and fxmc!=''">
  270. and t.fxmc=#{fxmc}
  271. </if>
  272. <if test="mdh!=null and mdh!=''">
  273. and t.mdh=#{mdh}
  274. </if>
  275. <if test="sbbh!=null and sbbh!=''">
  276. and t.sbbh=#{sbbh}
  277. </if>
  278. <if test="gzlx!=null and gzlx!=''">
  279. and t.gzlx=#{gzlx}
  280. </if>
  281. <if test="czlc!=null and czlc!=''">
  282. and t.czlc=#{czlc}
  283. </if>
  284. <if test="fxzxlc!=null and fxzxlc!=''">
  285. and t.fxzxlc=#{fxzxlc}
  286. </if>
  287. <if test="sccj!=null and sccj!=''">
  288. and t.sccj=#{sccj}
  289. </if>
  290. <if test="xh!=null and xh!=''">
  291. and t.xh=#{xh}
  292. </if>
  293. <if test="delFlag!=null and delFlag!=''">
  294. and t.del_flag=#{delFlag}
  295. </if>
  296. <if test="createBy!=null and createBy!=''">
  297. and t.create_by=#{createBy}
  298. </if>
  299. <if test="createTime!=null">
  300. and DATE_FORMAT(t.create_time, '%Y-%m-%d') = #{createTime}
  301. </if>
  302. <if test="updateBy!=null and updateBy!=''">
  303. and t.update_by=#{updateBy}
  304. </if>
  305. <if test="updateTime!=null">
  306. and DATE_FORMAT(t.update_time, '%Y-%m-%d') = #{updateTime}
  307. </if>
  308. <if test="sjbh!=null and sjbh!=''">
  309. and t.sjbh=#{sjbh}
  310. </if>
  311. </where>
  312. </select>
  313. </mapper>