You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

89 lines
5.0 KiB

2 years ago
2 years ago
  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.spring.modules.cdc.mapper.CollectMapper">
  6. <resultMap type="com.spring.modules.cdc.entity.Collect" id="CollectResult">
  7. <result property="collectId" column="collect_id" />
  8. <result property="site" column="site" />
  9. <result property="collectDesc" column="collect_desc" />
  10. <result property="maxValue" column="max_value" />
  11. <result property="minValue" column="min_value" />
  12. <result property="phoneInfoFlag" column="phone_info_flag" />
  13. <result property="mailInfoFlag" column="mail_info_flag" />
  14. <result property="remark" column="remark" />
  15. <result property="active" column="active" />
  16. <result property="createBy" column="create_by" />
  17. <result property="createTime" column="create_time" />
  18. </resultMap>
  19. <sql id="selectCollectVo">
  20. select collect_id, site, collect_desc, max_value, min_value, phone_info_flag, mail_info_flag, remark, active, create_by, create_time from cdc_collect_data
  21. </sql>
  22. <select id="selectCollectList" parameterType="com.spring.modules.cdc.entity.Collect" resultMap="CollectResult">
  23. <include refid="selectCollectVo"/>
  24. <where>
  25. <if test="collectId != null and collectId != ''"> and collect_id like #{collectId}</if>
  26. <if test="site != null and site != ''"> and site = #{site}</if>
  27. <if test="collectDesc != null and collectDesc != ''"> and collect_desc like #{collectDesc}</if>
  28. <if test="active != null and active != ''"> and active = #{active}</if>
  29. </where>
  30. </select>
  31. <select id="selectCollectByCollectId" parameterType="String" resultMap="CollectResult">
  32. <include refid="selectCollectVo"/>
  33. where collect_id = #{collectId}
  34. </select>
  35. <insert id="insertCollect" parameterType="com.spring.modules.cdc.entity.Collect">
  36. insert into cdc_collect_data
  37. <trim prefix="(" suffix=")" suffixOverrides=",">
  38. <if test="collectId != null and collectId != ''">collect_id,</if>
  39. <if test="site != null and site != ''">site,</if>
  40. <if test="collectDesc != null and collectDesc != ''">collect_desc,</if>
  41. <if test="maxValue != null">max_value,</if>
  42. <if test="minValue != null">min_value,</if>
  43. <if test="phoneInfoFlag != null and phoneInfoFlag != ''">phone_info_flag,</if>
  44. <if test="mailInfoFlag != null and mailInfoFlag != ''">mail_info_flag,</if>
  45. <if test="remark != null">remark,</if>
  46. <if test="active != null and active != ''">active,</if>
  47. <if test="createBy != null">create_by,</if>
  48. <if test="createTime != null">create_time,</if>
  49. </trim>
  50. <trim prefix="values (" suffix=")" suffixOverrides=",">
  51. <if test="collectId != null and collectId != ''">#{collectId},</if>
  52. <if test="site != null and site != ''">#{site},</if>
  53. <if test="collectDesc != null and collectDesc != ''">#{collectDesc},</if>
  54. <if test="maxValue != null">#{maxValue},</if>
  55. <if test="minValue != null">#{minValue},</if>
  56. <if test="phoneInfoFlag != null and phoneInfoFlag != ''">#{phoneInfoFlag},</if>
  57. <if test="mailInfoFlag != null and mailInfoFlag != ''">#{mailInfoFlag},</if>
  58. <if test="remark != null">#{remark},</if>
  59. <if test="active != null and active != ''">#{active},</if>
  60. <if test="createBy != null">#{createBy},</if>
  61. <if test="createTime != null">#{createTime},</if>
  62. </trim>
  63. </insert>
  64. <update id="updateCollect" parameterType="com.spring.modules.cdc.entity.Collect">
  65. update cdc_collect_data
  66. <trim prefix="SET" suffixOverrides=",">
  67. <if test="collectDesc != null and collectDesc != ''">collect_desc = #{collectDesc},</if>
  68. <if test="maxValue != null">max_value = #{maxValue},</if>
  69. <if test="minValue != null">min_value = #{minValue},</if>
  70. <if test="phoneInfoFlag != null and phoneInfoFlag != ''">phone_info_flag = #{phoneInfoFlag},</if>
  71. <if test="mailInfoFlag != null and mailInfoFlag != ''">mail_info_flag = #{mailInfoFlag},</if>
  72. <if test="remark != null">remark = #{remark},</if>
  73. <if test="active != null and active != ''">active = #{active},</if>
  74. <if test="createBy != null">create_by = #{createBy},</if>
  75. <if test="createTime != null">create_time = #{createTime},</if>
  76. <if test="lastSendTime != null">last_send_time = #{lastSendTime},</if>
  77. </trim>
  78. where collect_id = #{collectId} and site = #{site}
  79. </update>
  80. <delete id="deleteCollectByCollectId" parameterType="com.spring.modules.cdc.entity.Collect">
  81. delete from cdc_collect_data where collect_id = #{collectId} and site = #{site}
  82. </delete>
  83. </mapper>