287 lines
10 KiB
XML
287 lines
10 KiB
XML
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||
|
<!DOCTYPE mapper
|
||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||
|
<mapper namespace="com.zhwl.wcsc.mapper.ZdyWcscDispatchExpressMapper">
|
||
|
|
||
|
<resultMap type="ZdyWcscDispatchExpress" id="ZdyWcscDispatchExpressResult">
|
||
|
<result property="id" column="id"/>
|
||
|
<result property="name" column="name"/>
|
||
|
<result property="type" column="type"/>
|
||
|
<result property="weigh" column="weigh"/>
|
||
|
<result property="firstNum" column="first_num"/>
|
||
|
<result property="firstPrice" column="first_price"/>
|
||
|
<result property="additionalNum" column="additional_num"/>
|
||
|
<result property="additionalPrice" column="additional_price"/>
|
||
|
<result property="provinceIds" column="province_ids"/>
|
||
|
<result property="cityIds" column="city_ids"/>
|
||
|
<result property="areaIds" column="area_ids"/>
|
||
|
<result property="createTime" column="create_time"/>
|
||
|
<result property="updateTime" column="update_time"/>
|
||
|
<result property="deletetime" column="deletetime"/>
|
||
|
<result property="areaData" column="area_data"/>
|
||
|
<result property="createBy" column="create_by"/>
|
||
|
<result property="updateBy" column="update_by"/>
|
||
|
<result property="deptId" column="dept_id"/>
|
||
|
<result property="deliveryTimeType" column="delivery_time_type"/>
|
||
|
<result property="isExemption" column="is_exemption"/>
|
||
|
</resultMap>
|
||
|
|
||
|
<sql id="selectZdyWcscDispatchExpressVo">
|
||
|
select wde.id,
|
||
|
wde.name,
|
||
|
wde.type,
|
||
|
wde.weigh,
|
||
|
wde.first_num,
|
||
|
wde.first_price,
|
||
|
wde.additional_num,
|
||
|
wde.additional_price,
|
||
|
wde.province_ids,
|
||
|
wde.city_ids,
|
||
|
wde.area_ids,
|
||
|
wde.create_time,
|
||
|
wde.update_time,
|
||
|
wde.deletetime,
|
||
|
wde.area_data,
|
||
|
wde.create_by,
|
||
|
wde.update_by,
|
||
|
wde.delivery_time_type,
|
||
|
wde.is_exemption,
|
||
|
wde.dept_id
|
||
|
from zdy_wcsc_dispatch_express wde
|
||
|
</sql>
|
||
|
|
||
|
<select id="selectZdyWcscDispatchExpressList" parameterType="ZdyWcscDispatchExpress"
|
||
|
resultMap="ZdyWcscDispatchExpressResult">
|
||
|
<include refid="selectZdyWcscDispatchExpressVo"/>
|
||
|
LEFT JOIN sys_dept d ON d.dept_id = wde.dept_id
|
||
|
<where>
|
||
|
ISNULL(wde.deletetime)
|
||
|
<if test="name != null and name != ''">
|
||
|
and wde.name like concat('%', #{name}, '%')
|
||
|
</if>
|
||
|
<if test="type != null and type != ''">
|
||
|
and wde.type = #{type}
|
||
|
</if>
|
||
|
<if test="weigh != null ">
|
||
|
and wde.weigh = #{weigh}
|
||
|
</if>
|
||
|
<if test="firstNum != null ">
|
||
|
and wde.first_num = #{firstNum}
|
||
|
</if>
|
||
|
<if test="firstPrice != null ">
|
||
|
and wde.first_price = #{firstPrice}
|
||
|
</if>
|
||
|
<if test="additionalNum != null ">
|
||
|
and wde.additional_num = #{additionalNum}
|
||
|
</if>
|
||
|
<if test="additionalPrice != null ">
|
||
|
and wde.additional_price = #{additionalPrice}
|
||
|
</if>
|
||
|
<if test="provinceIds != null and provinceIds != ''">
|
||
|
and wde.province_ids = #{provinceIds}
|
||
|
</if>
|
||
|
<if test="cityIds != null and cityIds != ''">
|
||
|
and wde.city_ids = #{cityIds}
|
||
|
</if>
|
||
|
<if test="areaIds != null and areaIds != ''">
|
||
|
and wde.area_ids = #{areaIds}
|
||
|
</if>
|
||
|
<if test="deliveryTimeType != null and deliveryTimeType != ''">
|
||
|
and delivery_time_type = #{deliveryTimeType}
|
||
|
</if>
|
||
|
<if test="isExemption != null and isExemption != ''">
|
||
|
and wde.is_exemption = #{isExemption}
|
||
|
</if>
|
||
|
${params.dataScope}
|
||
|
</where>
|
||
|
order by wde.weigh asc
|
||
|
</select>
|
||
|
|
||
|
<select id="selectZdyWcscDispatchExpressById" parameterType="Long"
|
||
|
resultMap="ZdyWcscDispatchExpressResult">
|
||
|
<include refid="selectZdyWcscDispatchExpressVo"/>
|
||
|
where id = #{id}
|
||
|
</select>
|
||
|
|
||
|
<insert id="insertZdyWcscDispatchExpress" parameterType="ZdyWcscDispatchExpress" useGeneratedKeys="true"
|
||
|
keyProperty="id">
|
||
|
insert into zdy_wcsc_dispatch_express
|
||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||
|
<if test="name != null">name,
|
||
|
</if>
|
||
|
<if test="type != null">type,
|
||
|
</if>
|
||
|
<if test="weigh != null">weigh,
|
||
|
</if>
|
||
|
<if test="firstNum != null">first_num,
|
||
|
</if>
|
||
|
<if test="firstPrice != null">first_price,
|
||
|
</if>
|
||
|
<if test="additionalNum != null">additional_num,
|
||
|
</if>
|
||
|
<if test="additionalPrice != null">additional_price,
|
||
|
</if>
|
||
|
<if test="provinceIds != null">province_ids,
|
||
|
</if>
|
||
|
<if test="cityIds != null">city_ids,
|
||
|
</if>
|
||
|
<if test="areaIds != null">area_ids,
|
||
|
</if>
|
||
|
create_time,
|
||
|
<if test="deletetime != null">deletetime,
|
||
|
</if>
|
||
|
<if test="areaData != null">area_data,
|
||
|
</if>
|
||
|
<if test="createBy != null">create_by,
|
||
|
</if>
|
||
|
<if test="updateBy != null">update_by,
|
||
|
</if>
|
||
|
<if test="deptId != null">dept_id,
|
||
|
</if>
|
||
|
<if test="deliveryTimeType != null">delivery_time_type,
|
||
|
</if>
|
||
|
<if test="isExemption != null">is_exemption,
|
||
|
</if>
|
||
|
</trim>
|
||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||
|
<if test="name != null">#{name},
|
||
|
</if>
|
||
|
<if test="type != null">#{type},
|
||
|
</if>
|
||
|
<if test="weigh != null">#{weigh},
|
||
|
</if>
|
||
|
<if test="firstNum != null">#{firstNum},
|
||
|
</if>
|
||
|
<if test="firstPrice != null">#{firstPrice},
|
||
|
</if>
|
||
|
<if test="additionalNum != null">#{additionalNum},
|
||
|
</if>
|
||
|
<if test="additionalPrice != null">#{additionalPrice},
|
||
|
</if>
|
||
|
<if test="provinceIds != null">#{provinceIds},
|
||
|
</if>
|
||
|
<if test="cityIds != null">#{cityIds},
|
||
|
</if>
|
||
|
<if test="areaIds != null">#{areaIds},
|
||
|
</if>
|
||
|
sysdate(),
|
||
|
<if test="deletetime != null">#{deletetime},
|
||
|
</if>
|
||
|
<if test="areaData != null">#{areaData},
|
||
|
</if>
|
||
|
<if test="createBy != null">#{createBy},
|
||
|
</if>
|
||
|
<if test="updateBy != null">#{updateBy},
|
||
|
</if>
|
||
|
<if test="deptId != null">#{deptId},
|
||
|
</if>
|
||
|
<if test="deliveryTimeType != null">#{deliveryTimeType},
|
||
|
</if>
|
||
|
<if test="isExemption != null">#{isExemption},
|
||
|
</if>
|
||
|
</trim>
|
||
|
</insert>
|
||
|
|
||
|
<update id="updateZdyWcscDispatchExpress" parameterType="ZdyWcscDispatchExpress">
|
||
|
update zdy_wcsc_dispatch_express
|
||
|
<trim prefix="SET" suffixOverrides=",">
|
||
|
<if test="name != null">name =
|
||
|
#{name},
|
||
|
</if>
|
||
|
type = #{type},
|
||
|
<if test="weigh != null">weigh =
|
||
|
#{weigh},
|
||
|
</if>
|
||
|
<if test="firstNum != null">first_num =
|
||
|
#{firstNum},
|
||
|
</if>
|
||
|
<if test="firstPrice != null">first_price =
|
||
|
#{firstPrice},
|
||
|
</if>
|
||
|
<if test="additionalNum != null">additional_num =
|
||
|
#{additionalNum},
|
||
|
</if>
|
||
|
<if test="additionalPrice != null">additional_price =
|
||
|
#{additionalPrice},
|
||
|
</if>
|
||
|
<if test="provinceIds != null">province_ids =
|
||
|
#{provinceIds},
|
||
|
</if>
|
||
|
<if test="cityIds != null">city_ids =
|
||
|
#{cityIds},
|
||
|
</if>
|
||
|
<if test="areaIds != null">area_ids =
|
||
|
#{areaIds},
|
||
|
</if>
|
||
|
update_time = sysdate(),
|
||
|
<if test="deletetime != null">deletetime = #{deletetime},</if>
|
||
|
<if test="areaData != null">area_data =
|
||
|
#{areaData},
|
||
|
</if>
|
||
|
<if test="createBy != null">create_by =
|
||
|
#{createBy},
|
||
|
</if>
|
||
|
<if test="updateBy != null">update_by =
|
||
|
#{updateBy},
|
||
|
</if>
|
||
|
<if test="deptId != null">dept_id =
|
||
|
#{deptId},
|
||
|
</if>
|
||
|
<if test="deliveryTimeType != null">delivery_time_type =
|
||
|
#{deliveryTimeType},
|
||
|
</if>
|
||
|
<if test="isExemption != null">is_exemption =
|
||
|
#{isExemption},
|
||
|
</if>
|
||
|
</trim>
|
||
|
where id = #{id}
|
||
|
</update>
|
||
|
|
||
|
<delete id="deleteZdyWcscDispatchExpressById" parameterType="Long">
|
||
|
update zdy_wcsc_dispatch_express
|
||
|
set deletetime = sysdate()
|
||
|
where id = #{id}
|
||
|
</delete>
|
||
|
|
||
|
<delete id="deleteZdyWcscDispatchExpressByIds" parameterType="String">
|
||
|
update zdy_wcsc_dispatch_express
|
||
|
set deletetime = sysdate() where id in
|
||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||
|
#{id}
|
||
|
</foreach>
|
||
|
</delete>
|
||
|
|
||
|
<select id="selectAreaListByExpressId" resultType="Long">
|
||
|
SELECT
|
||
|
a.area_code
|
||
|
FROM
|
||
|
zdy_area a
|
||
|
LEFT JOIN zdy_express_area ea ON a.area_code = ea.area_code
|
||
|
WHERE
|
||
|
ea.express_id = #{expressId}
|
||
|
ORDER BY
|
||
|
a.parent_code
|
||
|
</select>
|
||
|
|
||
|
<select id="selectAreaListInExpressIds" resultType="Long">
|
||
|
SELECT
|
||
|
a.area_code
|
||
|
FROM
|
||
|
zdy_area a
|
||
|
LEFT JOIN zdy_express_area ea ON a.area_code = ea.area_code
|
||
|
WHERE
|
||
|
find_in_set(ea.express_id, #{expressId})
|
||
|
ORDER BY
|
||
|
a.parent_code
|
||
|
</select>
|
||
|
|
||
|
<update id="deleteByDeptIds" parameterType="String">
|
||
|
update zdy_wcsc_dispatch_express
|
||
|
set deletetime = sysdate() where dept_id in
|
||
|
<foreach item="deptId" collection="list" open="(" separator="," close=")">
|
||
|
#{deptId}
|
||
|
</foreach>
|
||
|
</update>
|
||
|
</mapper>
|