ShowTestPlanDtMapper.xml 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  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.ShowTestPlanDtMapper">
  5. <resultMap id="BaseResultMap" type="com.railway.business.bi.domain.ShowTestPlanDt">
  6. <result column="id" property="id"/>
  7. <result column="line_name" property="lineName"/>
  8. <result column="substation_name" property="substationName"/>
  9. <result column="sbmc" property="sbmc"/>
  10. <result column="yxbh" property="yxbh"/>
  11. <result column="test_cycle" property="testCycle"/>
  12. <result column="test_plan_date" property="testPlanDate"/>
  13. <result column="completion_date" property="completionDate"/>
  14. <result column="create_by" property="createBy"/>
  15. <result column="create_time" property="createTime"/>
  16. <result column="update_by" property="updateBy"/>
  17. <result column="update_time" property="updateTime"/>
  18. <result column="del_flag" property="delFlag"/>
  19. <result column="file_id" property="fileId"/>
  20. </resultMap>
  21. <sql id="Base_Column_List">
  22. id,
  23. line_name,
  24. substation_name,
  25. sbmc,
  26. yxbh,
  27. test_cycle,
  28. test_plan_date,
  29. completion_date,
  30. create_by,
  31. create_time,
  32. update_by,
  33. update_time,
  34. del_flag,
  35. file_id
  36. </sql>
  37. <insert id="insert" parameterType="com.railway.business.bi.domain.ShowTestPlanDt">
  38. INSERT INTO show_test_plan_dt
  39. <trim prefix="(" suffix=")" suffixOverrides=",">
  40. <if test='null != lineName'>
  41. line_name,
  42. </if>
  43. <if test='null != substationName'>
  44. substation_name,
  45. </if>
  46. <if test='null != sbmc'>
  47. sbmc,
  48. </if>
  49. <if test='null != yxbh'>
  50. yxbh,
  51. </if>
  52. <if test='null != testCycle'>
  53. test_cycle,
  54. </if>
  55. <if test='null != testPlanDate'>
  56. test_plan_date,
  57. </if>
  58. <if test='null != completionDate'>
  59. completion_date,
  60. </if>
  61. <if test='null != createBy'>
  62. create_by,
  63. </if>
  64. <if test='null != createTime'>
  65. create_time,
  66. </if>
  67. <if test='null != fileId'>
  68. file_id,
  69. </if>
  70. <if test='null != delFlag'>
  71. del_flag
  72. </if>
  73. </trim>
  74. <trim prefix="values (" suffix=")" suffixOverrides=",">
  75. <if test='null != lineName'>
  76. #{lineName},
  77. </if>
  78. <if test='null != substationName'>
  79. #{substationName},
  80. </if>
  81. <if test='null != sbmc'>
  82. #{sbmc},
  83. </if>
  84. <if test='null != yxbh'>
  85. #{yxbh},
  86. </if>
  87. <if test='null != testCycle'>
  88. #{testCycle},
  89. </if>
  90. <if test='null != testPlanDate'>
  91. #{testPlanDate},
  92. </if>
  93. <if test='null != completionDate'>
  94. #{completionDate},
  95. </if>
  96. <if test='null != createBy'>
  97. #{createBy},
  98. </if>
  99. <if test='null != createTime'>
  100. #{createTime},
  101. </if>
  102. <if test='null != fileId'>
  103. #{fileId},
  104. </if>
  105. <if test='null != delFlag'>
  106. #{delFlag}
  107. </if>
  108. </trim>
  109. </insert>
  110. <delete id="delete">
  111. UPDATE show_test_plan_dt
  112. set del_flag='1'
  113. WHERE id = #{id}
  114. </delete>
  115. <update id="update" parameterType="com.railway.business.bi.domain.ShowTestPlanDt">
  116. UPDATE show_test_plan_dt
  117. <set>
  118. <if test='null != lineName'>line_name = #{lineName},</if>
  119. <if test='null != substationName'>substation_name = #{substationName},</if>
  120. <if test='null != sbmc'>sbmc = #{sbmc},</if>
  121. <if test='null != yxbh'>yxbh = #{yxbh},</if>
  122. <if test='null != testCycle'>test_cycle = #{testCycle},</if>
  123. <if test='null != testPlanDate'>test_plan_date = #{testPlanDate},</if>
  124. <if test='null != completionDate'>completion_date = #{completionDate},</if>
  125. <if test='null != updateBy'>update_by = #{updateBy},</if>
  126. <if test='null != updateTime'>update_time = #{updateTime},</if>
  127. <if test='null != fileId'>file_id = #{fileId},</if>
  128. <if test='null != delFlag'>del_flag = #{delFlag}</if>
  129. </set>
  130. WHERE id = #{id}
  131. </update>
  132. <select id="getInfo" resultMap="BaseResultMap">
  133. SELECT
  134. <include refid="Base_Column_List"/>
  135. FROM show_test_plan_dt
  136. WHERE del_flag='0' and id = #{id}
  137. </select>
  138. <select id="getList" resultMap="BaseResultMap">
  139. SELECT
  140. <include refid="Base_Column_List"/>
  141. FROM show_test_plan_dt
  142. <where>
  143. del_flag='0'
  144. <if test="lineName!=null and lineName!=''">
  145. and line_name like concat('%', #{lineName}, '%')
  146. </if>
  147. <if test="substationName!=null and substationName!=''">
  148. and substation_name like concat('%', #{substationName}, '%')
  149. </if>
  150. <if test="sbmc!=null and sbmc!=''">
  151. and sbmc like concat('%', #{sbmc}, '%')
  152. </if>
  153. <if test="testPlanDateStart!=null">
  154. and test_plan_date <![CDATA[ >= ]]> #{testPlanDateStart}
  155. </if>
  156. <if test="testPlanDateEnd!=null">
  157. and test_plan_date <![CDATA[ <= ]]> #{testPlanDateEnd}
  158. </if>
  159. <if test="completionDateStart!=null">
  160. and completion_date <![CDATA[ >= ]]> #{completionDateStart}
  161. </if>
  162. <if test="completionDateEnd!=null">
  163. and completion_date <![CDATA[ <= ]]> #{completionDateEnd}
  164. </if>
  165. <if test="fileId!=null ">
  166. and file_id=#{fileId}
  167. </if>
  168. </where>
  169. </select>
  170. </mapper>