TTbDuMapper.xml 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.xlht.xlhtproject.mapper.TTbDuMapper">
  6. <resultMap type="TTbDu" id="TTbDuResult">
  7. <result property="ID" column="ID" />
  8. <result property="c1TjLl" column="C1_TJ_LL" />
  9. <result property="c1TjLlTime" column="C1_TJ_LL_TIME" />
  10. <result property="c2TjLl" column="C2_TJ_LL" />
  11. <result property="c2TjLlTime" column="C2_TJ_LL_TIME" />
  12. <result property="ACTIVE" column="ACTIVE" />
  13. </resultMap>
  14. <sql id="selectTTbDuVo">
  15. select ID, C1_TJ_LL, C1_TJ_LL_TIME, C2_TJ_LL, C2_TJ_LL_TIME, ACTIVE from T_tb_du
  16. </sql>
  17. <select id="selectTTbDuList" parameterType="TTbDu" resultMap="TTbDuResult">
  18. <include refid="selectTTbDuVo"/>
  19. <where>
  20. 1 = 1
  21. <if test="c1TjLl != null "> and C1_TJ_LL = #{c1TjLl}</if>
  22. <if test="c1TjLlTime != null and c1TjLlTime != ''"> and C1_TJ_LL_TIME = #{c1TjLlTime}</if>
  23. <if test="c2TjLl != null "> and C2_TJ_LL = #{c2TjLl}</if>
  24. <if test="c2TjLlTime != null and c2TjLlTime != ''"> and C2_TJ_LL_TIME = #{c2TjLlTime}</if>
  25. <if test="ACTIVE != null "> and ACTIVE = #{ACTIVE}</if>
  26. </where>
  27. order by id desc
  28. </select>
  29. <select id="selectTTbDuByID" parameterType="Long" resultMap="TTbDuResult">
  30. <include refid="selectTTbDuVo"/>
  31. where ID = #{ID}
  32. </select>
  33. <insert id="insertTTbDu" parameterType="TTbDu">
  34. insert into T_tb_du
  35. <trim prefix="(" suffix=")" suffixOverrides=",">
  36. <if test="ID != null">ID,</if>
  37. <if test="c1TjLl != null">C1_TJ_LL,</if>
  38. <if test="c1TjLlTime != null">C1_TJ_LL_TIME,</if>
  39. <if test="c2TjLl != null">C2_TJ_LL,</if>
  40. <if test="c2TjLlTime != null">C2_TJ_LL_TIME,</if>
  41. <if test="ACTIVE != null">ACTIVE,</if>
  42. </trim>
  43. <trim prefix="values (" suffix=")" suffixOverrides=",">
  44. <if test="ID != null">#{ID},</if>
  45. <if test="c1TjLl != null">#{c1TjLl},</if>
  46. <if test="c1TjLlTime != null">#{c1TjLlTime},</if>
  47. <if test="c2TjLl != null">#{c2TjLl},</if>
  48. <if test="c2TjLlTime != null">#{c2TjLlTime},</if>
  49. <if test="ACTIVE != null">#{ACTIVE},</if>
  50. </trim>
  51. </insert>
  52. <update id="updateTTbDu" parameterType="TTbDu">
  53. update T_tb_du
  54. <trim prefix="SET" suffixOverrides=",">
  55. <if test="c1TjLl != null">C1_TJ_LL = #{c1TjLl},</if>
  56. <if test="c1TjLlTime != null">C1_TJ_LL_TIME = #{c1TjLlTime},</if>
  57. <if test="c2TjLl != null">C2_TJ_LL = #{c2TjLl},</if>
  58. <if test="c2TjLlTime != null">C2_TJ_LL_TIME = #{c2TjLlTime},</if>
  59. <if test="ACTIVE != null">ACTIVE = #{ACTIVE},</if>
  60. </trim>
  61. where ID = #{ID}
  62. </update>
  63. <delete id="deleteTTbDuByID" parameterType="Long">
  64. update T_tb_du set del_flag = 2,revision = revision + 1 where del_flag = 0 and ID = #{ID}
  65. </delete>
  66. <delete id="deleteTTbDuByIDs" parameterType="String">
  67. update T_tb_du set del_flag = 2,revision = revision + 1 where del_flag = 0 and ID in
  68. <foreach item="ID" collection="array" open="(" separator="," close=")">
  69. #{ID}
  70. </foreach>
  71. </delete>
  72. </mapper>