BusDmcgyqMapper.xml 8.8 KB

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