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

63 行
2.3 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.WxCouponPresentMapper">
  4. <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxCouponPresent">
  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="coupon_name" jdbcType="VARCHAR" property="couponName"/>
  11. <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
  12. <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
  13. <result column="send_amount" jdbcType="INTEGER" property="sendAmount"/>
  14. </resultMap>
  15. <sql id="allColumns">
  16. `id`,`tenant_id`,`parent_tenant_id`,`coupon_id`,`coupon_name`,`user_id`,`create_time`,`update_time`,`send_amount`
  17. </sql>
  18. <sql id="dynamicWhereConditions">
  19. where 1 = 1
  20. <if test=" null != id ">
  21. and `id` = #{id}
  22. </if>
  23. <if test=" null != tenantId and '' != tenantId">
  24. and `tenant_id` = #{tenantId}
  25. </if>
  26. <if test=" null != parentTenantId and '' != parentTenantId">
  27. and `parent_tenant_id` = #{parentTenantId}
  28. </if>
  29. <if test=" null != couponId ">
  30. and `coupon_id` = #{couponId}
  31. </if>
  32. <if test=" null != couponName ">
  33. and `coupon_name` like concat('%', #{couponName},'%')
  34. </if>
  35. <if test=" null != phones ">
  36. and `phones` like concat('%', #{phones},'%')
  37. </if>
  38. <if test=" null != sendTimeStart and null!=sendTimeEnd ">
  39. and `create_time` between #{sendTimeStart} and #{sendTimeEnd}
  40. </if>
  41. <if test=" null != updateTime ">
  42. and `update_time` = #{updateTime}
  43. </if>
  44. <if test=" null != ids ">
  45. and id in
  46. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  47. #{idItem}
  48. </foreach>
  49. </if>
  50. <if test=" null != sortColumns">order by ${sortColumns}</if>
  51. </sql>
  52. <select id="findList" parameterType="com.iformall.domain.po.WxCouponPresent" resultMap="BaseResultMap">
  53. select
  54. <include refid="allColumns"/>
  55. from wx_coupon_present
  56. <include refid="dynamicWhereConditions"/>
  57. </select>
  58. </mapper>