lisy
2023-07-31 9b185b07f035fa8f1b26c19a8eab4784413d4d96
cloud-server-activity/src/main/resources/mapper/CouponMapper.xml
@@ -26,9 +26,22 @@
        `status`,
        state
        from t_coupon
        where 1 = 1
        where 1 = 1SELECT 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
        from t_coupon
        where 1=1
          <if test="name != null">
              and `name` like concat('%', #{}, '%')
              and `name` like concat('%', #{name}, '%')
          </if>
        <if test="type != null">
            and type = #{type}
@@ -47,6 +60,37 @@
        </if>
          order by insertTime desc
    </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
        from t_coupon
        where auditStatus != 2
        <if test="name != null">
            and `name` like concat('%', #{name}, '%')
        </if>
        <if test="type != null">
            and type = #{type}
        </if>
        <if test="distributionMethod != null">
            and distributionMethod = #{distributionMethod}
        </if>
        <if test="userPopulation != null">
            and userPopulation = #{userPopulation}
        </if>
        <if test="auditStatus != null">
            and auditStatus = #{auditStatus}
        </if>
        order by insertTime desc
    </select>
</mapper>