ShowYdtsMapper.xml 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  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.bi.mapper.ShowYdtsMapper">
  5. <resultMap id="BaseResultMap" type="com.railway.business.bi.domain.ShowYdts">
  6. <result column="id" property="id"/>
  7. <result column="branch_name" property="branchName"/>
  8. <result column="dept_name" property="deptName"/>
  9. <result column="line_sddj" property="lineSddj"/>
  10. <result column="line_name" property="lineName"/>
  11. <result column="station_name" property="stationName"/>
  12. <result column="line_xz" property="lineXz"/>
  13. <result column="substation_name" property="substationName"/>
  14. <result column="switch_high" property="switchHigh"/>
  15. <result column="switch_low" property="switchLow"/>
  16. <result column="last_year" property="lastYear"/>
  17. <result column="plan_month" property="planMonth"/>
  18. <result column="overdue_reminder" property="overdueReminder"/>
  19. <result column="completion_date" property="completionDate"/>
  20. <result column="jhtzjy" property="jhtzjy"/>
  21. <result column="overdue_reason" property="overdueReason"/>
  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. <result column="file_id" property="fileId"/>
  27. <result column="del_flag" property="delFlag"/>
  28. </resultMap>
  29. <sql id="Base_Column_List">
  30. id,
  31. branch_name,
  32. dept_name,
  33. line_sddj,
  34. line_name,
  35. station_name,
  36. line_xz,
  37. substation_name,
  38. switch_high,
  39. switch_low,
  40. last_year,
  41. plan_month,
  42. overdue_reminder,
  43. completion_date,
  44. jhtzjy,
  45. overdue_reason,
  46. create_by,
  47. create_time,
  48. update_by,
  49. update_time,
  50. del_flag,
  51. file_id
  52. </sql>
  53. <insert id="insert" parameterType="com.railway.business.bi.domain.ShowYdts">
  54. INSERT INTO show_ydts
  55. <trim prefix="(" suffix=")" suffixOverrides=",">
  56. <if test='null != branchName'>
  57. branch_name,
  58. </if>
  59. <if test='null != deptName'>
  60. dept_name,
  61. </if>
  62. <if test='null != lineSddj'>
  63. line_sddj,
  64. </if>
  65. <if test='null != lineName'>
  66. line_name,
  67. </if>
  68. <if test='null != stationName'>
  69. station_name,
  70. </if>
  71. <if test='null != lineXz'>
  72. line_xz,
  73. </if>
  74. <if test='null != substationName'>
  75. substation_name,
  76. </if>
  77. <if test='null != switchHigh'>
  78. switch_high,
  79. </if>
  80. <if test='null != switchLow'>
  81. switch_low,
  82. </if>
  83. <if test='null != lastYear'>
  84. last_year,
  85. </if>
  86. <if test='null != planMonth'>
  87. plan_month,
  88. </if>
  89. <if test='null != overdueReminder'>
  90. overdue_reminder,
  91. </if>
  92. <if test='null != completionDate'>
  93. completion_date,
  94. </if>
  95. <if test='null != jhtzjy'>
  96. jhtzjy,
  97. </if>
  98. <if test='null != overdueReason'>
  99. overdue_reason,
  100. </if>
  101. <if test='null != createBy'>
  102. create_by,
  103. </if>
  104. <if test='null != createTime'>
  105. create_time,
  106. </if>
  107. <if test='null != fileId'>
  108. file_id,
  109. </if>
  110. <if test='null != delFlag'>
  111. del_flag
  112. </if>
  113. </trim>
  114. <trim prefix="values (" suffix=")" suffixOverrides=",">
  115. <if test='null != branchName'>
  116. #{branchName},
  117. </if>
  118. <if test='null != deptName'>
  119. #{deptName},
  120. </if>
  121. <if test='null != lineSddj'>
  122. #{lineSddj},
  123. </if>
  124. <if test='null != lineName'>
  125. #{lineName},
  126. </if>
  127. <if test='null != stationName'>
  128. #{stationName},
  129. </if>
  130. <if test='null != lineXz'>
  131. #{lineXz},
  132. </if>
  133. <if test='null != substationName'>
  134. #{substationName},
  135. </if>
  136. <if test='null != switchHigh'>
  137. #{switchHigh},
  138. </if>
  139. <if test='null != switchLow'>
  140. #{switchLow},
  141. </if>
  142. <if test='null != lastYear'>
  143. #{lastYear},
  144. </if>
  145. <if test='null != planMonth'>
  146. #{planMonth},
  147. </if>
  148. <if test='null != overdueReminder'>
  149. #{overdueReminder},
  150. </if>
  151. <if test='null != completionDate'>
  152. #{completionDate},
  153. </if>
  154. <if test='null != jhtzjy'>
  155. #{jhtzjy},
  156. </if>
  157. <if test='null != overdueReason'>
  158. #{overdueReason},
  159. </if>
  160. <if test='null != createBy'>
  161. #{createBy},
  162. </if>
  163. <if test='null != createTime'>
  164. #{createTime},
  165. </if>
  166. <if test='null != fileId'>
  167. #{fileId},
  168. </if>
  169. <if test='null != delFlag'>
  170. #{delFlag}
  171. </if>
  172. </trim>
  173. </insert>
  174. <delete id="delete">
  175. UPDATE show_ydts
  176. set del_flag='1'
  177. WHERE id = #{id}
  178. </delete>
  179. <update id="update" parameterType="com.railway.business.bi.domain.ShowYdts">
  180. UPDATE show_ydts
  181. <set>
  182. <if test='null != branchName'>branch_name = #{branchName},</if>
  183. <if test='null != deptName'>dept_name = #{deptName},</if>
  184. <if test='null != lineSddj'>line_sddj = #{lineSddj},</if>
  185. <if test='null != lineName'>line_name = #{lineName},</if>
  186. <if test='null != stationName'>station_name = #{stationName},</if>
  187. <if test='null != lineXz'>line_xz = #{lineXz},</if>
  188. <if test='null != substationName'>substation_name = #{substationName},</if>
  189. <if test='null != switchHigh'>switch_high = #{switchHigh},</if>
  190. <if test='null != switchLow'>switch_low = #{switchLow},</if>
  191. <if test='null != lastYear'>last_year = #{lastYear},</if>
  192. <if test='null != planMonth'>plan_month = #{planMonth},</if>
  193. <if test='null != overdueReminder'>overdue_reminder = #{overdueReminder},</if>
  194. <if test='null != completionDate'>completion_date = #{completionDate},</if>
  195. <if test='null != jhtzjy'>jhtzjy = #{jhtzjy},</if>
  196. <if test='null != overdueReason'>overdue_reason = #{overdueReason},</if>
  197. <if test='null != updateBy'>update_by = #{updateBy},</if>
  198. <if test='null != updateTime'>update_time = #{updateTime},</if>
  199. <if test='null != fileId'>file_id = #{fileId},</if>
  200. <if test='null != delFlag'>del_flag = #{delFlag}</if>
  201. </set>
  202. WHERE id = #{id}
  203. </update>
  204. <select id="getInfo" resultMap="BaseResultMap">
  205. SELECT
  206. <include refid="Base_Column_List"/>
  207. FROM show_ydts
  208. WHERE del_flag='0' and id = #{id}
  209. </select>
  210. <select id="getList" resultMap="BaseResultMap">
  211. SELECT
  212. <include refid="Base_Column_List"/>
  213. FROM show_ydts
  214. <where>
  215. del_flag='0'
  216. and file_id = (select max(id) from show_file where data_type = 'scrw' and imp_result = '1')
  217. <if test="lineName!=null and lineName!=''">
  218. and line_name like concat('%', #{lineName}, '%')
  219. </if>
  220. <if test="planMonth!=null and planMonth!=''">
  221. and plan_month like concat('%', #{planMonth})
  222. </if>
  223. </where>
  224. </select>
  225. <select id="getLineList" resultType="java.lang.String">
  226. SELECT distinct line_name
  227. FROM show_ydts
  228. <where>
  229. del_flag='0'
  230. and file_id = (select max(id) from show_file where data_type = 'scrw' and imp_result = '1')
  231. </where>
  232. </select>
  233. </mapper>