44323
2023-10-11 6a8b55a2183720ff6106f581695298168896cadc
cloud-server-activity/src/main/resources/mapper/CouponMapper.xml
@@ -64,6 +64,88 @@
        </if>
          order by insertTime desc
    </select>
    <select id="queryCouponListOfSearch1" 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,
        `status`,
        state,
        illustrate
        from t_coupon
        where 1 = 1     and distributionMethod = 4
        <if test="cityCode != null">
            and id in(
            SELECT DISTINCT couponId FROM
            (SELECT DISTINCT couponId
            from t_coupon_store
            WHERE storeId = #{storeId}
            UNION ALL
            SELECT DISTINCT couponId
            from t_coupon_city
            WHERE provinceCode = #{cityCode}) o)
        </if>
        <if test="name != null">
            and `name` like concat('%', #{name}, '%')
        </if>
        <if test="type != null">
            and type = #{type}
        </if>
        <if test="userPopulation != null">
            and userPopulation = #{userPopulation}
        </if>
        <if test="status !=null">
            and `status` = #{status}
        </if>
        <if test="state != null">
            and `state` = #{state}
        </if>
        union all
        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,
        `status`,
        state,
        illustrate
        from t_coupon
        where 1 = 1     and distributionMethod = 4  and useScope = 1
        <if test="name != null">
            and `name` like concat('%', #{name}, '%')
        </if>
        <if test="type != null">
            and type = #{type}
        </if>
        <if test="userPopulation != null">
            and userPopulation = #{userPopulation}
        </if>
        <if test="status !=null">
            and `status` = #{status}
        </if>
        <if test="state != null">
            and `state` = #{state}
        </if>
    </select>
    <select id="queryCouponExamineList" resultType="java.util.Map">
        SELECT id,
               `name`,