puzhibing
2023-11-25 7fe6d026bcc8f993ce76437d01607e591cc671fe
cloud-server-activity/src/main/resources/mapper/CouponMapper.xml
@@ -7,12 +7,12 @@
    <select id="queryConponRuleOfJson" resultType="java.util.Map">
        SELECT JSON_EXTRACT(content, "$.conditionalAmount") as conditionalAmount,
               JSON_EXTRACT(content, "$.deductionAmount")   as deductionAmount,
               JSON_EXTRACT(content, "$.experienceName")   as experienceName
        JSON_EXTRACT(content, "$.deductionAmount") as deductionAmount,
        JSON_EXTRACT(content, "$.experienceName") as experienceName
        FROM t_coupon
        where 1=1
        <if test="id != null">
            and  `id` = #{id}
            and `id` = #{id}
        </if>
    </select>
    <select id="queryCouponListOfSearch" resultType="java.util.Map">
@@ -38,7 +38,7 @@
        </if>
        <if test="cityCode != null">
           and id in(
            and id in(
            SELECT DISTINCT couponId FROM
            (SELECT DISTINCT couponId
@@ -69,7 +69,7 @@
            and `state` = #{state}
        </if>
        and auditStatus = 2
          order by insertTime desc
        order by insertTime desc
    </select>
    <select id="queryCouponListOfSearch1" resultType="java.util.Map">
        SELECT id,
@@ -86,9 +86,9 @@
        state,
        illustrate
        from t_coupon
        where 1 = 1     and distributionMethod = 4
        where 1 = 1 and distributionMethod = 4
        and auditStatus = 2
        and startTime  &lt; now()
        and startTime &lt; now()
        <if test="cityCode != null">
            and id in(
            SELECT DISTINCT couponId FROM
@@ -134,9 +134,9 @@
        state,
        illustrate
        from t_coupon
        where 1 = 1     and distributionMethod = 4  and useScope = 1
        where 1 = 1 and distributionMethod = 4 and useScope = 1
        and auditStatus = 2
        and startTime  &lt; now()
        and startTime &lt; now()
        <if test="name != null">
            and `name` like concat('%', #{name}, '%')
        </if>
@@ -157,16 +157,16 @@
    </select>
    <select id="queryCouponExamineList" resultType="java.util.Map">
        SELECT id,
               `name`,
               useScope,
               `type`,
               distributionMethod,
               date_format(startTime ,'%Y-%m-%d') as startTime,
               date_format(endTime ,'%Y-%m-%d') as endTime,
               userPopulation,
               quantityIssued,
               pickUpQuantity,
               auditStatus,
        `name`,
        useScope,
        `type`,
        distributionMethod,
        date_format(startTime ,'%Y-%m-%d') as startTime,
        date_format(endTime ,'%Y-%m-%d') as endTime,
        userPopulation,
        quantityIssued,
        pickUpQuantity,
        auditStatus,
        publisherType,
        cityManagerId
        from t_coupon
@@ -189,13 +189,14 @@
        order by insertTime desc
    </select>
    <select id="listRecord" resultType="java.util.Map">
        select id,userId,status  from t_user_coupon where couponId =#{id}
        and userId in <foreach collection="ids" separator="," open="(" item="i" close=")">
        #{i}
    </foreach>
    <if test="type !=null">
        and status =#{type}
    </if>
        select id,userId,status from t_user_coupon where couponId =#{id}
        and userId in
        <foreach collection="ids" separator="," open="(" item="i" close=")">
            #{i}
        </foreach>
        <if test="type !=null">
            and status =#{type}
        </if>
    </select>