lisy
2023-07-27 81932e21cb584b992bdbde80df84eb81f77073d0
cloud-server-activity/src/main/resources/mapper/CouponMapper.xml
@@ -12,5 +12,41 @@
            and  `id` = #{id}
        </if>
    </select>
    <select id="queryCouponListOfSearch" 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
        from t_coupon
        where 1 = 1
          <if test="name != null">
              and `name` like concat('%', #{}, '%')
          </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="status !=null">
            and `status` = #{status}
        </if>
        <if test="state != null">
            and `state` = #{state}
        </if>
          order by insertTime desc
    </select>
</mapper>