万材erp项目
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

105 lines
6.2 KiB

<?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.ruoyi.system.mapper.SysShippingAddressMapper">
<resultMap type="SysShippingAddress" id="SysShippingAddressResult">
<result property="deliveryId" column="delivery_id" />
<result property="enterpriseCode" column="enterprise_code" />
<result property="enterpriseName" column="enterprise_name" />
<result property="customerPhone" column="customer_phone" />
<result property="customerName" column="customer_name" />
<result property="deliveryAddress" column="delivery_address" />
<result property="customerNameTwo" column="customer_name_two" />
<result property="detailedDescription" column="detailed_description" />
<result property="plantArea" column="plant_area" />
<result property="postalCode" column="postal_code" />
<result property="customerFax" column="customer_fax" />
<result property="firstAddTime" column="first_add_time" />
<result property="updateInfoTime" column="update_info_time" />
</resultMap>
<sql id="selectSysShippingAddressVo">
select delivery_id, enterprise_code, enterprise_name, customer_phone, customer_name, delivery_address, customer_name_two, detailed_description, plant_area, postal_code, customer_fax, first_add_time, update_info_time from sys_shipping_address
</sql>
<select id="selectSysShippingAddressList" parameterType="SysShippingAddress" resultMap="SysShippingAddressResult">
<include refid="selectSysShippingAddressVo"/>
<where>
<if test="enterpriseCode != null and enterpriseCode != ''"> and enterprise_code like concat('%', #{enterpriseCode}, '%')</if>
<if test="enterpriseName != null and enterpriseName != ''"> and enterprise_name like concat('%', #{enterpriseName}, '%')</if>
<if test="customerName != null and customerName != ''"> and customer_name like concat('%', #{customerName}, '%')</if>
<if test="deliveryAddress != null and deliveryAddress != ''"> and delivery_address like concat('%', #{deliveryAddress}, '%')</if>
<if test="customerNameTwo != null and customerNameTwo != ''"> and customer_name_two like concat('%', #{customerNameTwo}, '%')</if>
</where>
</select>
<select id="selectSysShippingAddressById" parameterType="Long" resultMap="SysShippingAddressResult">
<include refid="selectSysShippingAddressVo"/>
where delivery_id = #{deliveryId}
</select>
<select id="selectSysShippingAddressByenterpriseCode" parameterType="String" resultMap="SysShippingAddressResult">
<include refid="selectSysShippingAddressVo"/>
where enterprise_code = #{enterpriseCode}
</select>
<insert id="insertSysShippingAddress" parameterType="SysShippingAddress" useGeneratedKeys="true" keyProperty="deliveryId">
insert into sys_shipping_address
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="enterpriseCode != null">enterprise_code,</if>
<if test="enterpriseName != null">enterprise_name,</if>
<if test="customerPhone != null">customer_phone,</if>
<if test="customerName != null">customer_name,</if>
<if test="deliveryAddress != null">delivery_address,</if>
<if test="customerNameTwo != null">customer_name_two,</if>
<if test="detailedDescription != null">detailed_description,</if>
<if test="plantArea != null">plant_area,</if>
<if test="postalCode != null">postal_code,</if>
<if test="customerFax != null">customer_fax,</if>
first_add_time,
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="enterpriseCode != null">#{enterpriseCode},</if>
<if test="enterpriseName != null">#{enterpriseName},</if>
<if test="customerPhone != null">#{customerPhone},</if>
<if test="customerName != null">#{customerName},</if>
<if test="deliveryAddress != null">#{deliveryAddress},</if>
<if test="customerNameTwo != null">#{customerNameTwo},</if>
<if test="detailedDescription != null">#{detailedDescription},</if>
<if test="plantArea != null">#{plantArea},</if>
<if test="postalCode != null">#{postalCode},</if>
<if test="customerFax != null">#{customerFax},</if>
now(),
</trim>
</insert>
<update id="updateSysShippingAddress" parameterType="SysShippingAddress">
update sys_shipping_address
<trim prefix="SET" suffixOverrides=",">
<if test="enterpriseCode != null">enterprise_code = #{enterpriseCode},</if>
<if test="enterpriseName != null">enterprise_name = #{enterpriseName},</if>
<if test="customerPhone != null">customer_phone = #{customerPhone},</if>
<if test="customerName != null">customer_name = #{customerName},</if>
<if test="deliveryAddress != null">delivery_address = #{deliveryAddress},</if>
<if test="customerNameTwo != null">customer_name_two = #{customerNameTwo},</if>
<if test="detailedDescription != null">detailed_description = #{detailedDescription},</if>
<if test="plantArea != null">plant_area = #{plantArea},</if>
<if test="postalCode != null">postal_code = #{postalCode},</if>
<if test="customerFax != null">customer_fax = #{customerFax},</if>
update_info_time = CONCAT_WS(',',NOW(),update_info_time),
</trim>
where delivery_id = #{deliveryId}
</update>
<delete id="deleteSysShippingAddressById" parameterType="Long">
delete from sys_shipping_address where delivery_id = #{deliveryId}
</delete>
<delete id="deleteSysShippingAddressByIds" parameterType="String">
delete from sys_shipping_address where delivery_id in
<foreach item="deliveryId" collection="array" open="(" separator="," close=")">
#{deliveryId}
</foreach>
</delete>
</mapper>