Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 
 
 
 

68 righe
2.7 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.WxCouponBatchMapper">
  4. <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxCouponBatch">
  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="name" jdbcType="VARCHAR" property="name" />
  9. <result column="status" jdbcType="INTEGER" property="status"/>
  10. <result column="create_date" jdbcType="TIMESTAMP" property="createDate"/>
  11. <result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/>
  12. <result column="allow_count" jdbcType="INTEGER" property="allowCount"/>
  13. </resultMap>
  14. <sql id="allColumns">
  15. `id`, `tenant_id`, `parent_tenant_id`, `name`, `status`, `create_date`,`update_date`,`allow_count`
  16. </sql>
  17. <sql id="dynamicWhereConditions">
  18. where `tenant_id` = #{tenantId}
  19. <if test=" null != id ">
  20. and `id` = #{id}
  21. </if>
  22. <if test=" null != parentTenantId and '' != parentTenantId">
  23. and `parent_tenant_id` = #{parentTenantId}
  24. </if>
  25. <if test=" null != status">
  26. and `status` = #{status}
  27. </if>
  28. <if test=" null != name and '' != name">
  29. and `name` like concat('%', #{name},'%')
  30. </if>
  31. <if test=" null != ids ">
  32. and `id` in
  33. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  34. #{idItem}
  35. </foreach>
  36. </if>
  37. </sql>
  38. <select id="findList" parameterType="com.iformall.domain.po.WxCouponBatch" resultMap="BaseResultMap">
  39. select
  40. <include refid="allColumns"/>
  41. from wx_coupon_batch
  42. <include refid="dynamicWhereConditions"/>
  43. <if test=" null != sortColumns">order by ${sortColumns}</if>
  44. </select>
  45. <select id="getById" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  46. select <include refid="allColumns"/> from wx_coupon_batch where `id` = #{id} and tenant_id=#{tenantId}
  47. </select>
  48. <update id="updateWxCouponBatchStatus" parameterType="com.iformall.domain.po.WxCouponBatch" >
  49. update wx_coupon_batch set status = #{status} where `id` = #{id} and tenant_id=#{tenantId}
  50. </update>
  51. <delete id="deleteById" parameterType="java.util.HashMap" >
  52. delete from wx_coupon_batch where `id` = #{id} and tenant_id=#{tenantId}
  53. </delete>
  54. </mapper>