BasePreventForeignMapper.xml 11 KB

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