BasePreventIceMapper.xml 9.0 KB

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