地址删除修改为逻辑删除,避免订单信息中的地址查找不到
This commit is contained in:
parent
efcd5f274e
commit
4ee556fbd2
|
|
@ -29,6 +29,7 @@
|
|||
<select id="getCustomerAddressList" resultMap="CustomerAddressResult">
|
||||
<include refid="selectCustomerAddress" />
|
||||
<where>
|
||||
deleted = 0
|
||||
<if test="customerId != null">
|
||||
AND customer_id = #{customerId}
|
||||
</if>
|
||||
|
|
@ -36,19 +37,20 @@
|
|||
</select>
|
||||
|
||||
<delete id="deleteByIds">
|
||||
DELETE FROM customer_address WHERE customer_address_id IN
|
||||
UPDATE customer_address SET deleted = 1 WHERE customer_address_id IN
|
||||
<foreach collection="array" item="customerIds" open="(" separator="," close=")">
|
||||
#{customerAddressIds}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id="deleteByCustomerAddressId" parameterType="Long">
|
||||
DELETE FROM customer_address WHERE customer_address_id = #{customerAddressId}
|
||||
UPDATE customer_address SET deleted = 1 WHERE customer_address_id = #{customerAddressId}
|
||||
</delete>
|
||||
|
||||
<select id="selectByCustomerId" resultMap="CustomerAddressResult">
|
||||
<include refid="selectCustomerAddress"/>
|
||||
<where>
|
||||
deleted = 0
|
||||
<if test="customerId != null and customerId != 0">
|
||||
AND customer_id = #{customerId}
|
||||
</if>
|
||||
|
|
@ -77,6 +79,7 @@
|
|||
<if test="isDefault != null">is_default,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
<if test="remark != null and remark != ''">remark,</if>
|
||||
deleted,
|
||||
create_time
|
||||
)values(
|
||||
<if test="customerId != null and customerId != 0">#{customerId},</if>
|
||||
|
|
@ -90,6 +93,7 @@
|
|||
<if test="isDefault != null">#{isDefault},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
<if test="remark != null and remark != ''">#{remark},</if>
|
||||
0,
|
||||
sysdate()
|
||||
)
|
||||
</insert>
|
||||
|
|
|
|||
Loading…
Reference in New Issue