BasePreventThawMapper.xml 11 KB

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