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

103 lines
5.6 KiB
XML
Raw Normal View History

<?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" />
</resultMap>
<sql id="selectVendorInfoVo">
select vendor_id, vendor_code, vendor_name, vendor_address, vendor_user, vendor_email, vendor_phone, vendor_status, create_by, update_by, create_time, update_time from vendor_info
</sql>
<select id="selectVendorInfoList" parameterType="VendorInfo" resultMap="VendorInfoResult">
<include refid="selectVendorInfoVo"/>
<where>
<if test="vendorCode != null and vendorCode != ''"> and vendor_code like concat('%', #{vendorCode}, '%')</if>
<if test="vendorName != null and vendorName != ''"> and vendor_name like concat('%', #{vendorName}, '%')</if>
<if test="vendorAddress != null and vendorAddress != ''"> and vendor_address like concat('%', #{vendorAddress}, '%')</if>
<if test="vendorUser != null and vendorUser != ''"> and vendor_user = #{vendorUser}</if>
<if test="vendorStatus != null and vendorStatus != ''"> and vendor_status = #{vendorStatus}</if>
</where>
</select>
<select id="selectVendorInfoByVendorId" parameterType="Long" resultMap="VendorInfoResult">
<include refid="selectVendorInfoVo"/>
where vendor_id = #{vendorId}
</select>
<insert id="insertVendorInfo" parameterType="VendorInfo">
insert into 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="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>
</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="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>
</trim>
</insert>
<update id="updateVendorInfo" parameterType="VendorInfo">
update 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="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>
</trim>
where vendor_id = #{vendorId}
</update>
<delete id="deleteVendorInfoByVendorId" parameterType="Long">
delete from vendor_info where vendor_id = #{vendorId}
</delete>
<delete id="deleteVendorInfoByVendorIds" parameterType="String">
delete from vendor_info where vendor_id in
<foreach item="vendorId" collection="array" open="(" separator="," close=")">
#{vendorId}
</foreach>
</delete>
</mapper>