QwPushCountMapper.xml 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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.fs.qw.mapper.QwPushCountMapper">
  6. <resultMap type="QwPushCount" id="QwPushCountResult">
  7. <result property="id" column="id" />
  8. <result property="type" column="type" />
  9. <result property="pushCount" column="push_count" />
  10. <result property="companyId" column="company_id" />
  11. <result property="status" column="status" />
  12. </resultMap>
  13. <sql id="selectQwPushCountVo">
  14. select id, type, push_count, company_id, status from qw_push_count
  15. </sql>
  16. <select id="selectQwPushCountList" parameterType="QwPushCount" resultMap="QwPushCountResult">
  17. <include refid="selectQwPushCountVo"/>
  18. <where>
  19. <if test="type != null "> and type = #{type}</if>
  20. <if test="pushCount != null "> and push_count = #{pushCount}</if>
  21. <if test="companyId != null "> and company_id = #{companyId}</if>
  22. <if test="status != null "> and status = #{status}</if>
  23. </where>
  24. </select>
  25. <select id="selectQwPushCountById" parameterType="Long" resultMap="QwPushCountResult">
  26. <include refid="selectQwPushCountVo"/>
  27. where id = #{id}
  28. </select>
  29. <insert id="insertQwPushCount" parameterType="QwPushCount" useGeneratedKeys="true" keyProperty="id">
  30. insert into qw_push_count
  31. <trim prefix="(" suffix=")" suffixOverrides=",">
  32. <if test="type != null">type,</if>
  33. <if test="pushCount != null">push_count,</if>
  34. <if test="companyId != null">company_id,</if>
  35. <if test="status != null">status,</if>
  36. </trim>
  37. <trim prefix="values (" suffix=")" suffixOverrides=",">
  38. <if test="type != null">#{type},</if>
  39. <if test="pushCount != null">#{pushCount},</if>
  40. <if test="companyId != null">#{companyId},</if>
  41. <if test="status != null">#{status},</if>
  42. </trim>
  43. </insert>
  44. <update id="updateQwPushCount" parameterType="QwPushCount">
  45. update qw_push_count
  46. <trim prefix="SET" suffixOverrides=",">
  47. <if test="type != null">type = #{type},</if>
  48. <if test="pushCount != null">push_count = #{pushCount},</if>
  49. <if test="companyId != null">company_id = #{companyId},</if>
  50. <if test="status != null">status = #{status},</if>
  51. </trim>
  52. where id = #{id}
  53. </update>
  54. <delete id="deleteQwPushCountById" parameterType="Long">
  55. delete from qw_push_count where id = #{id}
  56. </delete>
  57. <delete id="deleteQwPushCountByIds" parameterType="String">
  58. delete from qw_push_count where id in
  59. <foreach item="id" collection="array" open="(" separator="," close=")">
  60. #{id}
  61. </foreach>
  62. </delete>
  63. </mapper>