后台服务
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

68 行
2.4 KiB

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.iformall.mapper.TtUserCollectMapper">
  4. <resultMap id="BaseResultMap" type="com.iformall.domain.po.tt.TtUserCollect">
  5. <id column="id" jdbcType="BIGINT" property="id"/>
  6. <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
  7. <result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" />
  8. <result column="user_id" jdbcType="BIGINT" property="userId"/>
  9. <result column="coupon_id" jdbcType="BIGINT" property="couponId"/>
  10. <result column="create_date" jdbcType="TIMESTAMP" property="createDate"/>
  11. <result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/>
  12. </resultMap>
  13. <sql id="allColumns">
  14. `id`, `tenant_id`, `parent_tenant_id`, `user_id`, `coupon_id`, `create_date`, `update_date`
  15. </sql>
  16. <sql id="dynamicWhereConditions">
  17. where `is_del` = 0
  18. <if test=" null != id ">
  19. and `id` = #{id}
  20. </if>
  21. <if test=" null != tenantId and '' != tenantId">
  22. and `tenant_id` = #{tenantId}
  23. </if>
  24. <if test=" null != parentTenantId and '' != parentTenantId">
  25. and `parent_tenant_id` = #{parentTenantId}
  26. </if>
  27. <if test=" null != userId ">
  28. and `user_id` = #{userId}
  29. </if>
  30. <if test=" null != couponId ">
  31. and `coupon_id` = #{couponId}
  32. </if>
  33. <if test="startdate != null">
  34. and `create_date` &gt;= #{startdate}
  35. </if>
  36. <if test="enddate != null">
  37. and `create_date` &lt;= #{enddate}
  38. </if>
  39. <if test=" null != ids ">
  40. and id in
  41. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  42. #{idItem}
  43. </foreach>
  44. </if>
  45. <if test=" null != sortColumns">order by ${sortColumns}</if>
  46. </sql>
  47. <select id="findList" parameterType="com.iformall.domain.po.tt.TtUserCollect" resultMap="BaseResultMap">
  48. select
  49. <include refid="allColumns"/>
  50. from tt_user_collect
  51. <include refid="dynamicWhereConditions"/>
  52. </select>
  53. <delete id="deleteById" parameterType="Long">
  54. update tt_user_collect set is_del = 1,update_date=now() where id = #{id}
  55. </delete>
  56. </mapper>