unis_sip/ruoyi-sip/src/main/resources/mapper/system/VendorInfoMapper.xml

169 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.ruoyi.sip.mapper.VendorInfoMapper">
<resultMap type="VendorInfo" id="VendorInfoResult">
<result property="vendorId" column="vendor_id" />
<result property="vendorCode" column="vendor_code" />
<result property="vendorName" column="vendor_name" />
<result property="vendorAddress" column="vendor_address" />
<result property="vendorUser" column="vendor_user" />
<result property="vendorEmail" column="vendor_email" />
<result property="vendorPhone" column="vendor_phone" />
<result property="vendorStatus" column="vendor_status" />
<result property="createBy" column="create_by" />
<result property="updateBy" column="update_by" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
<result property="payType" column="pay_type" />
<result property="payConfigDay" column="pay_config_day" />
<result property="socialCredit" column="social_credit" />
<result property="payName" column="pay_name" />
<result property="payBankNumber" column="pay_bank_number" />
<result property="payBankOpenAddress" column="pay_bank_open_address" />
<result property="bankNumber" column="bank_number" />
<result property="province" column="province" />
<result property="city" column="city" />
<result property="generatedAddress" column="generated_address" />
</resultMap>
<sql id="selectVendorInfoVo">
select t1.vendor_id, t1.vendor_code, t1.vendor_name, t1.vendor_address, t1.vendor_user, t1.vendor_email, t1.vendor_phone, t1.vendor_status
, t1.create_by, t1.update_by, t1.create_time, t1.update_time,t1.warehouse_id,t1.own_warehouse_id
, t1.pay_type, t1.pay_config_day, t1.social_credit, t1.pay_name, t1.pay_bank_number, t1.pay_bank_open_address, t1.bank_number
, t1.province, t1.city, t1.generated_address
,t2.warehouse_name
from oms_vendor_info t1
left join oms_warehouse_info t2 on t1.warehouse_id = t2.id
</sql>
<select id="selectVendorInfoList" parameterType="VendorInfo" resultMap="VendorInfoResult">
<include refid="selectVendorInfoVo"/>
<where>
<if test="vendorCode != null and vendorCode != ''"> and t1.vendor_code like concat('%', #{vendorCode}, '%')</if>
<if test="vendorCodeList != null and vendorCodeList.size>0"> and t1.vendor_code in
<foreach item="item" index="index" collection="vendorCodeList" separator="," open="(" close=")">
#{item}
</foreach>
</if>
<if test="vendorName != null and vendorName != ''"> and t1.vendor_name like concat('%', #{vendorName}, '%')</if>
<if test="vendorAddress != null and vendorAddress != ''"> and t1.vendor_address like concat('%', #{vendorAddress}, '%')</if>
<if test="vendorUser != null and vendorUser != ''"> and t1.vendor_user = #{vendorUser}</if>
<if test="vendorStatus != null and vendorStatus != ''"> and t1.vendor_status = #{vendorStatus}</if>
<if test="vendorNameList != null and vendorNameList.size>0"> and t1.vendor_name in
<foreach item="item" index="index" collection="vendorNameList" separator="," open="(" close=")">
#{item}
</foreach>
</if>
</where>
</select>
<select id="selectVendorInfoByVendorId" parameterType="Long" resultMap="VendorInfoResult">
<include refid="selectVendorInfoVo"/>
where t1.vendor_id = #{vendorId}
</select>
<select id="selectVendorInfoByVendorCode" resultType="com.ruoyi.sip.domain.VendorInfo">
<include refid="selectVendorInfoVo"/>
where t1.vendor_code = #{vendorCode}
</select>
<insert id="insertVendorInfo" parameterType="VendorInfo">
insert into oms_vendor_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="vendorId != null">vendor_id,</if>
<if test="vendorCode != null and vendorCode != ''">vendor_code,</if>
<if test="vendorName != null and vendorName != ''">vendor_name,</if>
<if test="vendorAddress != null">vendor_address,</if>
<if test="vendorUser != null and vendorUser != ''">vendor_user,</if>
<if test="vendorEmail != null">vendor_email,</if>
<if test="vendorPhone != null and vendorPhone != ''">vendor_phone,</if>
<if test="warehouseId != null and warehouseId!=''">warehouse_id,</if>
<if test="ownWarehouseId != null and ownWarehouseId!=''">own_warehouse_id,</if>
<if test="vendorStatus != null">vendor_status,</if>
<if test="createBy != null">create_by,</if>
<if test="updateBy != null">update_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if>
<if test="payType != null">pay_type,</if>
<if test="payConfigDay != null">pay_config_day,</if>
<if test="socialCredit != null and socialCredit != ''">social_credit,</if>
<if test="payName != null and payName != ''">pay_name,</if>
<if test="payBankNumber != null and payBankNumber != ''">pay_bank_number,</if>
<if test="payBankOpenAddress != null and payBankOpenAddress != ''">pay_bank_open_address,</if>
<if test="bankNumber != null and bankNumber != ''">bank_number,</if>
<if test="province != null and province != ''">province,</if>
<if test="city != null and city != ''">city,</if>
<if test="generatedAddress != null and generatedAddress != ''">generated_address,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="vendorId != null">#{vendorId},</if>
<if test="vendorCode != null and vendorCode != ''">#{vendorCode},</if>
<if test="vendorName != null and vendorName != ''">#{vendorName},</if>
<if test="vendorAddress != null">#{vendorAddress},</if>
<if test="vendorUser != null and vendorUser != ''">#{vendorUser},</if>
<if test="vendorEmail != null">#{vendorEmail},</if>
<if test="vendorPhone != null and vendorPhone != ''">#{vendorPhone},</if>
<if test="warehouseId != null and warehouseId!=''"> #{warehouseId},</if>
<if test="ownWarehouseId != null and ownWarehouseId!=''">#{ownWarehouseId},</if>
<if test="vendorStatus != null">#{vendorStatus},</if>
<if test="createBy != null">#{createBy},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="payType != null">#{payType},</if>
<if test="payConfigDay != null">#{payConfigDay},</if>
<if test="socialCredit != null and socialCredit != ''">#{socialCredit},</if>
<if test="payName != null and payName != ''">#{payName},</if>
<if test="payBankNumber != null and payBankNumber != ''">#{payBankNumber},</if>
<if test="payBankOpenAddress != null and payBankOpenAddress != ''">#{payBankOpenAddress},</if>
<if test="bankNumber != null and bankNumber != ''">#{bankNumber},</if>
<if test="province != null and province != ''">#{province},</if>
<if test="city != null and city != ''">#{city},</if>
<if test="generatedAddress != null and generatedAddress != ''">#{generatedAddress},</if>
</trim>
</insert>
<update id="updateVendorInfo" parameterType="VendorInfo">
update oms_vendor_info
<trim prefix="SET" suffixOverrides=",">
<if test="vendorCode != null and vendorCode != ''">vendor_code = #{vendorCode},</if>
<if test="vendorName != null and vendorName != ''">vendor_name = #{vendorName},</if>
<if test="vendorAddress != null">vendor_address = #{vendorAddress},</if>
<if test="vendorUser != null and vendorUser != ''">vendor_user = #{vendorUser},</if>
<if test="vendorEmail != null">vendor_email = #{vendorEmail},</if>
<if test="vendorPhone != null and vendorPhone != ''">vendor_phone = #{vendorPhone},</if>
<if test="vendorStatus != null">vendor_status = #{vendorStatus},</if>
<if test="warehouseId != null and warehouseId!=''">warehouse_id = #{warehouseId},</if>
<if test="ownWarehouseId != null and ownWarehouseId!=''">own_warehouse_id=#{ownWarehouseId},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="payType != null">pay_type = #{payType},</if>
<if test="payConfigDay != null">pay_config_day = #{payConfigDay},</if>
<if test="socialCredit != null and socialCredit != ''">social_credit = #{socialCredit},</if>
<if test="payName != null and payName != ''">pay_name = #{payName},</if>
<if test="payBankNumber != null and payBankNumber != ''">pay_bank_number = #{payBankNumber},</if>
<if test="payBankOpenAddress != null and payBankOpenAddress != ''">pay_bank_open_address = #{payBankOpenAddress},</if>
<if test="bankNumber != null and bankNumber != ''">bank_number = #{bankNumber},</if>
<if test="province != null and province != ''">province = #{province},</if>
<if test="city != null and city != ''">city = #{city},</if>
<if test="generatedAddress != null and generatedAddress != ''">generated_address = #{generatedAddress},</if>
</trim>
where vendor_id = #{vendorId}
</update>
<delete id="deleteVendorInfoByVendorId" parameterType="Long">
delete from oms_vendor_info where vendor_id = #{vendorId}
</delete>
<delete id="deleteVendorInfoByVendorIds" parameterType="String">
delete from oms_vendor_info where vendor_id in
<foreach item="vendorId" collection="array" open="(" separator="," close=")">
#{vendorId}
</foreach>
</delete>
</mapper>