| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176 |
- <?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.xingxi.web.controller.master.product.mapper.VendorMapper">
- <resultMap type="Vendor" id="VendorResult">
- <result property="vendorId" column="vendorId" />
- <result property="vendorName" column="vendorName" />
- <result property="contact" column="contact" />
- <result property="mobile" column="mobile" />
- <result property="mail" column="mail" />
- <result property="address" column="address" />
- <result property="refundContact" column="refundContact" />
- <result property="refundMobile" column="refundMobile" />
- <result property="refundAddress" column="refundAddress" />
- <result property="delFlag" column="delFlag" />
- <result property="createUser" column="createUser" />
- <result property="createTime" column="createTime" />
- <result property="updateUser" column="updateUser" />
- <result property="updateTime" column="updateTime" />
- </resultMap>
- <sql id="selectVendor">
- select vendorId, vendorName, contact, mobile, mail, address, refundContact, refundMobile, refundAddress, delFlag, createUser, createTime, updateUser, updateTime from m_vendor
- </sql>
- <sql id="selectVendorExt">
- select
- ${tableAlias}.vendorId,
- ${tableAlias}.vendorName,
- ${tableAlias}.contact,
- ${tableAlias}.mobile,
- ${tableAlias}.mail,
- ${tableAlias}.address,
- ${tableAlias}.refundContact,
- ${tableAlias}.refundMobile,
- ${tableAlias}.refundAddress,
- ${tableAlias}.delFlag,
- ${tableAlias}.createUser,
- ${tableAlias}.createTime,
- ${tableAlias}.updateUser,
- ${tableAlias}.updateTime
- from m_vendor ${tableAlias}
- </sql>
- <select id="selectVendorList" parameterType="Vendor" resultMap="VendorResult">
- <include refid="selectVendor"/>
- <where>
- <if test="vendorName != null and vendorName != ''"> and vendorName like concat('%', #{vendorName}, '%')</if>
- <if test="contact != null and contact != ''"> and contact = #{contact}</if>
- <if test="mobile != null and mobile != ''"> and mobile = #{mobile}</if>
- <if test="mail != null and mail != ''"> and mail = #{mail}</if>
- <if test="address != null and address != ''"> and address = #{address}</if>
- <if test="refundContact != null and refundContact != ''"> and refundContact = #{refundContact}</if>
- <if test="refundMobile != null and refundMobile != ''"> and refundMobile = #{refundMobile}</if>
- <if test="refundAddress != null and refundAddress != ''"> and refundAddress = #{refundAddress}</if>
- <if test="delFlag != null and delFlag != ''"> and delFlag = #{delFlag}</if>
- <if test="createUser != null and createUser != ''"> and createUser = #{createUser}</if>
- <if test="createTime != null "> and createTime = #{createTime}</if>
- <if test="updateUser != null and updateUser != ''"> and updateUser = #{updateUser}</if>
- <if test="updateTime != null "> and updateTime = #{updateTime}</if>
- </where>
- </select>
-
- <select id="selectVendorByVendorId" parameterType="Long" resultMap="VendorResult">
- <include refid="selectVendor"/>
- where vendorId = #{vendorId}
- </select>
-
- <insert id="insertVendor" parameterType="Vendor" useGeneratedKeys="true" keyProperty="vendorId">
- insert into m_vendor
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="vendorName != null">vendorName,</if>
- <if test="contact != null">contact,</if>
- <if test="mobile != null">mobile,</if>
- <if test="mail != null">mail,</if>
- <if test="address != null">address,</if>
- <if test="refundContact != null">refundContact,</if>
- <if test="refundMobile != null">refundMobile,</if>
- <if test="refundAddress != null">refundAddress,</if>
- <if test="delFlag != null">delFlag,</if>
- <if test="createUser != null">createUser,</if>
- <if test="createTime != null">createTime,</if>
- <if test="updateUser != null">updateUser,</if>
- <if test="updateTime != null">updateTime,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="vendorName != null">#{vendorName},</if>
- <if test="contact != null">#{contact},</if>
- <if test="mobile != null">#{mobile},</if>
- <if test="mail != null">#{mail},</if>
- <if test="address != null">#{address},</if>
- <if test="refundContact != null">#{refundContact},</if>
- <if test="refundMobile != null">#{refundMobile},</if>
- <if test="refundAddress != null">#{refundAddress},</if>
- <if test="delFlag != null">#{delFlag},</if>
- <if test="createUser != null">#{createUser},</if>
- <if test="createTime != null">#{createTime},</if>
- <if test="updateUser != null">#{updateUser},</if>
- <if test="updateTime != null">#{updateTime},</if>
- </trim>
- </insert>
- <insert id="batchInsertVendor">
- insert into m_vendor( vendorName, contact, mobile, mail, address, refundContact, refundMobile, refundAddress, delFlag, createUser, createTime, updateUser, updateTime) values
- <foreach item="item" index="index" collection="list" separator=",">
- ( #{item.vendorName}, #{item.contact}, #{item.mobile}, #{item.mail}, #{item.address}, #{item.refundContact}, #{item.refundMobile}, #{item.refundAddress}, #{item.delFlag}, #{item.createUser}, #{item.createTime}, #{item.updateUser}, #{item.updateTime})
- </foreach>
- </insert>
- <update id="updateVendor" parameterType="Vendor">
- update m_vendor
- <trim prefix="SET" suffixOverrides=",">
- <if test="vendorName != null">vendorName = #{vendorName},</if>
- <if test="contact != null">contact = #{contact},</if>
- <if test="mobile != null">mobile = #{mobile},</if>
- <if test="mail != null">mail = #{mail},</if>
- <if test="address != null">address = #{address},</if>
- <if test="refundContact != null">refundContact = #{refundContact},</if>
- <if test="refundMobile != null">refundMobile = #{refundMobile},</if>
- <if test="refundAddress != null">refundAddress = #{refundAddress},</if>
- <if test="delFlag != null">delFlag = #{delFlag},</if>
- <if test="createUser != null">createUser = #{createUser},</if>
- <if test="createTime != null">createTime = #{createTime},</if>
- <if test="updateUser != null">updateUser = #{updateUser},</if>
- <if test="updateTime != null">updateTime = #{updateTime},</if>
- </trim>
- where vendorId = #{vendorId}
- </update>
- <delete id="deleteVendorByVendorId" parameterType="Long">
- delete from m_vendor where vendorId = #{vendorId}
- </delete>
- <delete id="deleteVendorByVendorIds" parameterType="String">
- delete from m_vendor where vendorId in
- <foreach item="vendorId" collection="array" open="(" separator="," close=")">
- #{vendorId}
- </foreach>
- </delete>
- <update id="logicDeleteVendorByVendorId" parameterType="Long">
- update m_vendor
- set delFlag = '2'
- where vendorId = #{vendorId}
- </update>
- <update id="logicDeleteVendorByVendorIds" parameterType="String">
- update m_vendor
- set delFlag = '2'
- where vendorId in
- <foreach item="vendorId" collection="array" open="(" separator="," close=")">
- #{vendorId}
- </foreach>
- </update>
- <update id="logicDeleteVendorByCondition" parameterType="Vendor">
- update m_vendor
- set delFlag = '2'
- <where>
- <if test="vendorName != null and vendorName != ''"> and vendorName like concat('%', #{vendorName}, '%')</if>
- <if test="contact != null and contact != ''"> and contact = #{contact}</if>
- <if test="mobile != null and mobile != ''"> and mobile = #{mobile}</if>
- <if test="mail != null and mail != ''"> and mail = #{mail}</if>
- <if test="address != null and address != ''"> and address = #{address}</if>
- <if test="refundContact != null and refundContact != ''"> and refundContact = #{refundContact}</if>
- <if test="refundMobile != null and refundMobile != ''"> and refundMobile = #{refundMobile}</if>
- <if test="refundAddress != null and refundAddress != ''"> and refundAddress = #{refundAddress}</if>
- <if test="delFlag != null and delFlag != ''"> and delFlag = #{delFlag}</if>
- <if test="createUser != null and createUser != ''"> and createUser = #{createUser}</if>
- <if test="createTime != null "> and createTime = #{createTime}</if>
- <if test="updateUser != null and updateUser != ''"> and updateUser = #{updateUser}</if>
- <if test="updateTime != null "> and updateTime = #{updateTime}</if>
- </where>
- </update>
- </mapper>
|