BasePreventThawMapper.xml 13 KB

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