新增套餐基本信息编辑功能,包括更新套餐名称和备注,支持客户筛选和绑定客户显示。
This commit is contained in:
@@ -21,6 +21,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="productCount" column="product_count" />
|
||||
<result property="customerCount" column="customer_count" />
|
||||
<result property="boundCustomers" column="bound_customers" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectPrcPriceSetVo">
|
||||
@@ -33,7 +34,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
inner join prc_price_set_version v on v.psv_id = p.psv_id
|
||||
where v.price_set_id = s.price_set_id
|
||||
and ifnull(p.is_del, '0') = '0') as product_count,
|
||||
(select count(1) from prc_customer_price_set c where c.price_set_id = s.price_set_id) as customer_count
|
||||
(select count(1) from prc_customer_price_set c where c.price_set_id = s.price_set_id) as customer_count,
|
||||
(select group_concat(
|
||||
concat(ifnull(c.customer_code, ''),
|
||||
case when ifnull(c.customer_name, '') = '' then '' else concat(' ', c.customer_name) end)
|
||||
order by c.bind_priority asc, c.customer_priceset_id asc
|
||||
separator '、')
|
||||
from prc_customer_price_set c
|
||||
where c.price_set_id = s.price_set_id) as bound_customers
|
||||
from prc_price_set s
|
||||
</sql>
|
||||
|
||||
@@ -47,7 +55,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
s.set_type, s.default_discount, s.default_type, s.calculate_sign,
|
||||
s.status, s.tms_id,
|
||||
s.created_by, s.create_time, s.updated_by, s.update_time,
|
||||
null as product_count, null as customer_count
|
||||
null as product_count, null as customer_count, null as bound_customers
|
||||
from prc_price_set s
|
||||
where s.price_set_id = #{priceSetId}
|
||||
</select>
|
||||
@@ -71,14 +79,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
AND (
|
||||
s.price_set_code like concat('%', #{keyword}, '%')
|
||||
OR s.price_set_name like concat('%', #{keyword}, '%')
|
||||
OR exists (
|
||||
select 1 from prc_customer_price_set c
|
||||
where c.price_set_id = s.price_set_id
|
||||
and (
|
||||
c.customer_name like concat('%', #{keyword}, '%')
|
||||
or concat(c.customer_id, '') like concat('%', #{keyword}, '%')
|
||||
)
|
||||
)
|
||||
)
|
||||
</if>
|
||||
<if test="customerId != null">
|
||||
AND exists (
|
||||
select 1 from prc_customer_price_set c
|
||||
where c.price_set_id = s.price_set_id
|
||||
and c.customer_id = #{customerId}
|
||||
)
|
||||
</if>
|
||||
<!-- Data scope: customer sales / creator / explicit viewer bind.
|
||||
@@ -167,6 +174,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
where price_set_id = #{priceSetId}
|
||||
</update>
|
||||
|
||||
<update id="updateBasicInfo" parameterType="PrcPriceSet">
|
||||
update prc_price_set
|
||||
<set>
|
||||
<if test="priceSetName != null and priceSetName != ''">price_set_name = #{priceSetName},</if>
|
||||
price_set_note = #{priceSetNote},
|
||||
<if test="updateBy != null and updateBy != ''">updated_by = #{updateBy},</if>
|
||||
update_time = sysdate()
|
||||
</set>
|
||||
where price_set_id = #{priceSetId}
|
||||
</update>
|
||||
|
||||
<update id="updatePrcPriceSetStatus" parameterType="PrcPriceSet">
|
||||
update prc_price_set
|
||||
<set>
|
||||
|
||||
Reference in New Issue
Block a user