From d68f16d615c5d7926760c01d6a0b3b17eed9a70d Mon Sep 17 00:00:00 2001 From: 陶杰 <1378534974@qq.com> Date: 星期六, 21 九月 2024 23:52:10 +0800 Subject: [PATCH] 1.优惠券-所有使用条件和优惠券面额最小值设置为0.01 --- src/main/resources/mapper/flower/FlowerMarkupSpMapper.xml | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 58 insertions(+), 2 deletions(-) diff --git a/src/main/resources/mapper/flower/FlowerMarkupSpMapper.xml b/src/main/resources/mapper/flower/FlowerMarkupSpMapper.xml index 7e14ac5..cf640fa 100644 --- a/src/main/resources/mapper/flower/FlowerMarkupSpMapper.xml +++ b/src/main/resources/mapper/flower/FlowerMarkupSpMapper.xml @@ -16,7 +16,7 @@ join t_flower_markup_sp sp on sp.flower_id = f.id and sp.partner_id = #{partnerId} left join t_supplier_info s on s.id = f.supplier_id left join t_flower_category c on f.category = c.id - WHERE f.deleted = 0 + WHERE f.deleted = 0 AND sp.fee > 0 <if test="condition.name != null and condition.name != ''"> AND f.name LIKE concat('%', #{condition.name},'%') </if> @@ -33,8 +33,64 @@ ) ) </if> + <if test="condition.supplierName != null and condition.supplierName != ''"> + AND s.name LIKE concat('%', #{condition.supplierName},'%') + </if> + <if test="condition.isFee != null"> + <choose> + <when test="condition.isFee == 'markup'"> + AND sp.fee > 0 + </when> + <otherwise> + AND (sp.fee is null or sp.fee = 0) + </otherwise> + </choose> + </if> ORDER BY f.id </select> - + <select id="selectMarkupSpFlowerList" resultType="com.mzl.flower.dto.response.flower.FlowerMarkupSpListDTO"> + SELECT f.*, f.id flower_id, sp.fee, s.name supplierName, c.name categoryStr, c.parent_name parentCategoryStr + , (CASE f.level + WHEN 'A' THEN c.weight_a + WHEN 'B' THEN c.weight_b + WHEN 'C' THEN c.weight_c + WHEN 'D' THEN c.weight_d + WHEN 'E' THEN c.weight_e + WHEN 'O' THEN c.weight_o + END + ) weight + FROM t_flower f + left join t_flower_markup_sp sp on sp.flower_id = f.id and sp.partner_id = #{partnerId} + left join t_supplier_info s on s.id = f.supplier_id + left join t_flower_category c on f.category = c.id + WHERE f.deleted = 0 AND f.status = 'UP' + <if test="condition.name != null and condition.name != ''"> + AND f.name LIKE concat('%', #{condition.name},'%') + </if> + <if test="condition.level != null and condition.level != ''"> + AND f.level = #{condition.level} + </if> + <if test="condition.tags != null and condition.tags != ''"> + AND f.tags LIKE concat('%', #{condition.tags},'%') + </if> + <if test="condition.category != null"> + AND (f.category = #{condition.category} + or exists ( + select 1 from t_flower_category fc where fc.id = f.category and fc.parent_id = #{condition.category} + ) + ) + </if> + <if test="condition.isFee != null"> + <choose> + <when test="condition.isFee == 'markup'"> + AND sp.fee > 0 + </when> + <otherwise> + AND (sp.fee is null or sp.fee = 0) + </otherwise> + </choose> + </if> + ORDER BY f.id + </select> </mapper> \ No newline at end of file -- Gitblit v1.9.3