|
@@ -570,10 +570,16 @@
|
|
|
</select>
|
|
|
<select id="getCodeByTypeId" resultType="java.lang.String">
|
|
|
select
|
|
|
- CONCAT(IFNULL(b.bigTypeCode,''), IFNULL(s.smallTypeCode,''), IFNULL(t.tinyTypeCode,''))
|
|
|
+ CONCAT(IFNULL(b.bigTypeCode,''),
|
|
|
+ IFNULL(<if test="smallTypeId != null">s.smallTypeCode</if><if test="smallTypeId == null">''</if>,''),
|
|
|
+ IFNULL(<if test="tinyTypeId != null">t.tinyTypeCode</if><if test="tinyTypeId == null">''</if>,''))
|
|
|
from bigtype b
|
|
|
- left join smalltype s on s.bigTypeID = b.bigTypeID
|
|
|
- left join tinytype t on t.smallTypeID = s.smallTypeID
|
|
|
+ <if test="smallTypeId != null">
|
|
|
+ left join smalltype s on s.bigTypeID = b.bigTypeID
|
|
|
+ </if>
|
|
|
+ <if test="tinyTypeId != null">
|
|
|
+ left join tinytype t on t.smallTypeID = s.smallTypeID
|
|
|
+ </if>
|
|
|
<where>
|
|
|
<if test="bigTypeId != null">
|
|
|
b.bigTypeID = #{bigTypeId}
|
|
@@ -649,14 +655,14 @@
|
|
|
|
|
|
<select id="getCity" resultType="com.caimei365.commodity.model.vo.CityVo">
|
|
|
SELECT c.provinceID AS provinceId, c.cityID AS cityId, name ,
|
|
|
- <if test="ruleId != null">
|
|
|
+ <if test="freightId != null">
|
|
|
ifnull(cf.type, 0) as type
|
|
|
</if>
|
|
|
- <if test="ruleId == null">
|
|
|
+ <if test="freightId == null">
|
|
|
0 as type
|
|
|
</if>
|
|
|
FROM city c
|
|
|
- <if test="ruleId != null">
|
|
|
+ <if test="freightId != null">
|
|
|
left join
|
|
|
(
|
|
|
SELECT cfa.type, cfa.cityId FROM cm_freight_area cfa
|
|
@@ -711,6 +717,17 @@
|
|
|
where id = #{id}
|
|
|
</update>
|
|
|
|
|
|
+ <delete id="deleteRule">
|
|
|
+ delete from cm_freight_rule
|
|
|
+ where freightId = #{freightId}
|
|
|
+ <if test="ruleIds.size() > 0">
|
|
|
+ and id not in
|
|
|
+ <foreach collection="ruleIds" item="id" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ </delete>
|
|
|
+
|
|
|
<delete id="deleteArea">
|
|
|
delete from cm_freight_area
|
|
|
where ruleId = #{ruleId}
|
|
@@ -722,6 +739,10 @@
|
|
|
</if>
|
|
|
</delete>
|
|
|
|
|
|
+ <select id="getProductNum" resultType="java.lang.Integer">
|
|
|
+ select count(productId) from product where freightTemplateId = #{freightTemplateId}
|
|
|
+ </select>
|
|
|
+
|
|
|
<update id="deleteTemplate">
|
|
|
update cm_freight_template
|
|
|
set delFlag = 1
|