修改测试
This commit is contained in:
+33
-2
@@ -8,6 +8,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<id property="customerPricesetId" column="customer_priceset_id" />
|
||||
<result property="priceSetId" column="price_set_id" />
|
||||
<result property="customerId" column="customer_id" />
|
||||
<result property="customerCode" column="customer_code" />
|
||||
<result property="customerName" column="customer_name" />
|
||||
<result property="bindPriority" column="bind_priority" />
|
||||
<result property="prBegindate" column="pr_begindate" />
|
||||
@@ -20,7 +21,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectPrcCustomerPriceSetVo">
|
||||
select customer_priceset_id, price_set_id, customer_id, customer_name, bind_priority,
|
||||
select customer_priceset_id, price_set_id, customer_id, customer_code, customer_name, bind_priority,
|
||||
pr_begindate, pr_enddate, price_set_note,
|
||||
created_by, created_at, updated_by, updated_at
|
||||
from prc_customer_price_set
|
||||
@@ -40,6 +41,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="customerId != null">
|
||||
AND customer_id = #{customerId}
|
||||
</if>
|
||||
<if test="customerCode != null and customerCode != ''">
|
||||
AND customer_code = #{customerCode}
|
||||
</if>
|
||||
<if test="customerName != null and customerName != ''">
|
||||
AND customer_name like concat('%', #{customerName}, '%')
|
||||
</if>
|
||||
@@ -62,6 +66,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="countByCustomerCode" resultType="int">
|
||||
select count(1) from prc_customer_price_set
|
||||
where customer_code = #{customerCode}
|
||||
<if test="excludeId != null">
|
||||
AND customer_priceset_id <> #{excludeId}
|
||||
</if>
|
||||
<if test="excludePriceSetId != null">
|
||||
AND price_set_id <> #{excludePriceSetId}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="countOverlap" resultType="int">
|
||||
select count(1)
|
||||
from prc_customer_price_set c
|
||||
@@ -76,7 +91,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</select>
|
||||
|
||||
<select id="selectEffectiveByCustomer" resultMap="PrcCustomerPriceSetResult">
|
||||
select c.customer_priceset_id, c.price_set_id, c.customer_id, c.customer_name, c.bind_priority,
|
||||
select c.customer_priceset_id, c.price_set_id, c.customer_id, c.customer_code, c.customer_name, c.bind_priority,
|
||||
c.pr_begindate, c.pr_enddate, c.price_set_note,
|
||||
c.created_by, c.created_at, c.updated_by, c.updated_at
|
||||
from prc_customer_price_set c
|
||||
@@ -88,10 +103,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
order by c.bind_priority asc, c.pr_begindate desc, c.customer_priceset_id asc
|
||||
</select>
|
||||
|
||||
<select id="selectEffectiveByCustomerCode" resultMap="PrcCustomerPriceSetResult">
|
||||
select c.customer_priceset_id, c.price_set_id, c.customer_id, c.customer_code, c.customer_name, c.bind_priority,
|
||||
c.pr_begindate, c.pr_enddate, c.price_set_note,
|
||||
c.created_by, c.created_at, c.updated_by, c.updated_at
|
||||
from prc_customer_price_set c
|
||||
inner join prc_price_set s on s.price_set_id = c.price_set_id
|
||||
where c.customer_code = #{customerCode}
|
||||
and s.status = 'E'
|
||||
and c.pr_begindate <= #{bizDate}
|
||||
and ifnull(c.pr_enddate, '9999-12-31') >= #{bizDate}
|
||||
order by c.bind_priority asc, c.pr_begindate desc, c.customer_priceset_id asc
|
||||
</select>
|
||||
|
||||
<insert id="insertPrcCustomerPriceSet" parameterType="PrcCustomerPriceSet" useGeneratedKeys="true" keyProperty="customerPricesetId">
|
||||
insert into prc_customer_price_set (
|
||||
<if test="priceSetId != null">price_set_id,</if>
|
||||
<if test="customerId != null">customer_id,</if>
|
||||
<if test="customerCode != null and customerCode != ''">customer_code,</if>
|
||||
<if test="customerName != null">customer_name,</if>
|
||||
<if test="bindPriority != null">bind_priority,</if>
|
||||
<if test="prBegindate != null">pr_begindate,</if>
|
||||
@@ -102,6 +131,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
) values (
|
||||
<if test="priceSetId != null">#{priceSetId},</if>
|
||||
<if test="customerId != null">#{customerId},</if>
|
||||
<if test="customerCode != null and customerCode != ''">#{customerCode},</if>
|
||||
<if test="customerName != null">#{customerName},</if>
|
||||
<if test="bindPriority != null">#{bindPriority},</if>
|
||||
<if test="prBegindate != null">#{prBegindate},</if>
|
||||
@@ -116,6 +146,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
update prc_customer_price_set
|
||||
<set>
|
||||
<if test="customerId != null">customer_id = #{customerId},</if>
|
||||
<if test="customerCode != null">customer_code = #{customerCode},</if>
|
||||
<if test="customerName != null">customer_name = #{customerName},</if>
|
||||
<if test="bindPriority != null">bind_priority = #{bindPriority},</if>
|
||||
<if test="prBegindate != null">pr_begindate = #{prBegindate},</if>
|
||||
|
||||
Reference in New Issue
Block a user