BasePreventThawMapper.xml 8.9 KB

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