<?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.tms.mapper.TmsCustomerInfoMapper">
|
|
<resultMap type="com.ruoyi.tms.domain.TmsCustomerInfo" id="TmsCustomerInfoResult">
|
<result property="id" column="id" />
|
<result property="customerType" column="customer_type" />
|
<result property="customerShortName" column="customer_short_name" />
|
<result property="customerCode" column="customer_code" />
|
<result property="customerFullName" column="customer_full_name" />
|
<result property="businessLicenseNo" column="business_license_no" />
|
<result property="address" column="address" />
|
<result property="contactName" column="contact_name" />
|
<result property="contactPhone" column="contact_phone" />
|
<result property="contactEmail" column="contact_email" />
|
<result property="signCompany" column="sign_company" />
|
<result property="bizContactName" column="biz_contact_name" />
|
<result property="bizContactPhone" column="biz_contact_phone" />
|
<result property="bizContactEmail" column="biz_contact_email" />
|
<result property="creditRating" column="credit_rating" />
|
<result property="creditAmount" column="credit_amount" />
|
<result property="creditOrderLimit" column="credit_order_limit" />
|
<result property="businessStatus" column="business_status" />
|
<result property="contractStatus" column="contract_status" />
|
<result property="dataStatus" column="data_status" />
|
<result property="createTime" column="create_time" />
|
<result property="updateTime" column="update_time" />
|
<result property="remark" column="remark" />
|
</resultMap>
|
|
<sql id="selectTmsCustomerInfoVo">
|
select thisTab.id, thisTab.customer_type, thisTab.customer_short_name, thisTab.customer_code, thisTab.customer_full_name, thisTab.business_license_no, thisTab.address, thisTab.contact_name, thisTab.contact_phone, thisTab.contact_email, thisTab.sign_company, thisTab.biz_contact_name, thisTab.biz_contact_phone, thisTab.biz_contact_email, thisTab.credit_rating, thisTab.credit_amount, thisTab.credit_order_limit, thisTab.business_status, thisTab.contract_status, thisTab.data_status, thisTab.create_time, thisTab.update_time, thisTab.remark from tms_customer_info AS thisTab
|
</sql>
|
<sql id="selectTmsCustomerInfoVoCount">
|
select count(0) from tms_customer_info as thisTab
|
</sql>
|
|
<sql id="whereCondition">
|
<if test="customerType != null "> and thisTab.customer_type = #{customerType}</if>
|
<if test="customerShortName != null and customerShortName != ''"> and thisTab.customer_short_name like concat('%', #{customerShortName}, '%')</if>
|
<if test="customerCode != null and customerCode != ''"> and thisTab.customer_code = #{customerCode}</if>
|
<if test="contactName != null and contactName != ''"> and thisTab.contact_name like concat('%', #{contactName}, '%')</if>
|
<if test="signCompany != null and signCompany != ''"> and thisTab.sign_company = #{signCompany}</if>
|
<if test="bizContactName != null and bizContactName != ''"> and thisTab.biz_contact_name like concat('%', #{bizContactName}, '%')</if>
|
<if test="creditRating != null "> and thisTab.credit_rating = #{creditRating}</if>
|
<if test="creditAmount != null "> and thisTab.credit_amount = #{creditAmount}</if>
|
<if test="creditOrderLimit != null "> and thisTab.credit_order_limit = #{creditOrderLimit}</if>
|
<if test="businessStatus != null "> and thisTab.business_status = #{businessStatus}</if>
|
<if test="contractStatus != null "> and thisTab.contract_status = #{contractStatus}</if>
|
<if test="dataStatus != null "> and thisTab.data_status = #{dataStatus}</if>
|
</sql>
|
|
<!--查询-->
|
<select id="selectTmsCustomerInfoById" parameterType="Integer" resultMap="TmsCustomerInfoResult">
|
<include refid="selectTmsCustomerInfoVo"/>
|
where id = #{id}
|
</select>
|
|
<select id="selectTmsCustomerInfoCount" parameterType="com.ruoyi.tms.domain.TmsCustomerInfo" resultType="int">
|
<include refid="selectTmsCustomerInfoVoCount"/>
|
<where>
|
<include refid="whereCondition"/>
|
</where>
|
</select>
|
|
<select id="selectTmsCustomerInfoList" parameterType="com.ruoyi.tms.domain.TmsCustomerInfo" resultMap="TmsCustomerInfoResult">
|
<include refid="selectTmsCustomerInfoVo"/>
|
<where>
|
<include refid="whereCondition"/>
|
</where>
|
order by thisTab.id desc
|
</select>
|
|
<!-- 新增 -->
|
<insert id="insertTmsCustomerInfo" parameterType="com.ruoyi.tms.domain.TmsCustomerInfo" useGeneratedKeys="true" keyProperty="id">
|
insert into tms_customer_info
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="customerType != null">customer_type,</if>
|
<if test="customerShortName != null and customerShortName != ''">customer_short_name,</if>
|
<if test="customerCode != null and customerCode != ''">customer_code,</if>
|
<if test="customerFullName != null and customerFullName != ''">customer_full_name,</if>
|
<if test="businessLicenseNo != null and businessLicenseNo != ''">business_license_no,</if>
|
<if test="address != null">address,</if>
|
<if test="contactName != null and contactName != ''">contact_name,</if>
|
<if test="contactPhone != null">contact_phone,</if>
|
<if test="contactEmail != null">contact_email,</if>
|
<if test="signCompany != null and signCompany != ''">sign_company,</if>
|
<if test="bizContactName != null and bizContactName != ''">biz_contact_name,</if>
|
<if test="bizContactPhone != null and bizContactPhone != ''">biz_contact_phone,</if>
|
<if test="bizContactEmail != null">biz_contact_email,</if>
|
<if test="creditRating != null">credit_rating,</if>
|
<if test="creditAmount != null">credit_amount,</if>
|
<if test="creditOrderLimit != null">credit_order_limit,</if>
|
<if test="businessStatus != null">business_status,</if>
|
<if test="contractStatus != null">contract_status,</if>
|
<if test="dataStatus != null">data_status,</if>
|
<if test="createTime != null">create_time,</if>
|
<if test="updateTime != null">update_time,</if>
|
<if test="remark != null">remark,</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="customerType != null">#{customerType},</if>
|
<if test="customerShortName != null and customerShortName != ''">#{customerShortName},</if>
|
<if test="customerCode != null and customerCode != ''">#{customerCode},</if>
|
<if test="customerFullName != null and customerFullName != ''">#{customerFullName},</if>
|
<if test="businessLicenseNo != null and businessLicenseNo != ''">#{businessLicenseNo},</if>
|
<if test="address != null">#{address},</if>
|
<if test="contactName != null and contactName != ''">#{contactName},</if>
|
<if test="contactPhone != null">#{contactPhone},</if>
|
<if test="contactEmail != null">#{contactEmail},</if>
|
<if test="signCompany != null and signCompany != ''">#{signCompany},</if>
|
<if test="bizContactName != null and bizContactName != ''">#{bizContactName},</if>
|
<if test="bizContactPhone != null and bizContactPhone != ''">#{bizContactPhone},</if>
|
<if test="bizContactEmail != null">#{bizContactEmail},</if>
|
<if test="creditRating != null">#{creditRating},</if>
|
<if test="creditAmount != null">#{creditAmount},</if>
|
<if test="creditOrderLimit != null">#{creditOrderLimit},</if>
|
<if test="businessStatus != null">#{businessStatus},</if>
|
<if test="contractStatus != null">#{contractStatus},</if>
|
<if test="dataStatus != null">#{dataStatus},</if>
|
<if test="createTime != null">#{createTime},</if>
|
<if test="updateTime != null">#{updateTime},</if>
|
<if test="remark != null">#{remark},</if>
|
</trim>
|
</insert>
|
|
<insert id="insertTmsCustomerInfoBatch" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
|
insert into tms_customer_info
|
<trim prefix="(" suffix=") values" suffixOverrides=",">
|
id,customer_type,customer_short_name,customer_code,customer_full_name,business_license_no,address,contact_name,contact_phone,contact_email,sign_company,biz_contact_name,biz_contact_phone,biz_contact_email,credit_rating,credit_amount,credit_order_limit,business_status,contract_status,data_status,create_time,update_time,remark,
|
</trim>
|
<foreach item="item" index="index" collection="list" separator=",">
|
<trim prefix="(" suffix=") " suffixOverrides=",">
|
#{item.id},#{item.customerType},#{item.customerShortName},#{item.customerCode},#{item.customerFullName},#{item.businessLicenseNo},#{item.address},#{item.contactName},#{item.contactPhone},#{item.contactEmail},#{item.signCompany},#{item.bizContactName},#{item.bizContactPhone},#{item.bizContactEmail},#{item.creditRating},#{item.creditAmount},#{item.creditOrderLimit},#{item.businessStatus},#{item.contractStatus},#{item.dataStatus},#{item.createTime},#{item.updateTime},#{item.remark},
|
</trim>
|
</foreach>
|
</insert>
|
|
<!-- 修改 -->
|
<update id="updateTmsCustomerInfo" parameterType="com.ruoyi.tms.domain.TmsCustomerInfo">
|
update tms_customer_info
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="customerType != null">customer_type = #{customerType},</if>
|
<if test="customerShortName != null and customerShortName != ''">customer_short_name = #{customerShortName},</if>
|
<if test="customerCode != null and customerCode != ''">customer_code = #{customerCode},</if>
|
<if test="customerFullName != null and customerFullName != ''">customer_full_name = #{customerFullName},</if>
|
<if test="businessLicenseNo != null and businessLicenseNo != ''">business_license_no = #{businessLicenseNo},</if>
|
<if test="address != null">address = #{address},</if>
|
<if test="contactName != null and contactName != ''">contact_name = #{contactName},</if>
|
<if test="contactPhone != null">contact_phone = #{contactPhone},</if>
|
<if test="contactEmail != null">contact_email = #{contactEmail},</if>
|
<if test="signCompany != null and signCompany != ''">sign_company = #{signCompany},</if>
|
<if test="bizContactName != null and bizContactName != ''">biz_contact_name = #{bizContactName},</if>
|
<if test="bizContactPhone != null and bizContactPhone != ''">biz_contact_phone = #{bizContactPhone},</if>
|
<if test="bizContactEmail != null">biz_contact_email = #{bizContactEmail},</if>
|
<if test="creditRating != null">credit_rating = #{creditRating},</if>
|
<if test="creditAmount != null">credit_amount = #{creditAmount},</if>
|
<if test="creditOrderLimit != null">credit_order_limit = #{creditOrderLimit},</if>
|
<if test="businessStatus != null">business_status = #{businessStatus},</if>
|
<if test="contractStatus != null">contract_status = #{contractStatus},</if>
|
<if test="dataStatus != null">data_status = #{dataStatus},</if>
|
<if test="createTime != null">create_time = #{createTime},</if>
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
<if test="remark != null">remark = #{remark},</if>
|
</trim>
|
where id = #{id}
|
</update>
|
<!-- 修改 -->
|
<update id="updateTmsCustomerInfoBatch" parameterType="java.util.List">
|
<foreach collection="list" item="item" index="index" separator=";">
|
update tms_customer_info
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="item.customerType != null">customer_type = #{item.customerType},</if>
|
<if test="item.customerShortName != null and item.customerShortName != ''">customer_short_name = #{item.customerShortName},</if>
|
<if test="item.customerCode != null and item.customerCode != ''">customer_code = #{item.customerCode},</if>
|
<if test="item.customerFullName != null and item.customerFullName != ''">customer_full_name = #{item.customerFullName},</if>
|
<if test="item.businessLicenseNo != null and item.businessLicenseNo != ''">business_license_no = #{item.businessLicenseNo},</if>
|
<if test="item.address != null">address = #{item.address},</if>
|
<if test="item.contactName != null and item.contactName != ''">contact_name = #{item.contactName},</if>
|
<if test="item.contactPhone != null">contact_phone = #{item.contactPhone},</if>
|
<if test="item.contactEmail != null">contact_email = #{item.contactEmail},</if>
|
<if test="item.signCompany != null and item.signCompany != ''">sign_company = #{item.signCompany},</if>
|
<if test="item.bizContactName != null and item.bizContactName != ''">biz_contact_name = #{item.bizContactName},</if>
|
<if test="item.bizContactPhone != null and item.bizContactPhone != ''">biz_contact_phone = #{item.bizContactPhone},</if>
|
<if test="item.bizContactEmail != null">biz_contact_email = #{item.bizContactEmail},</if>
|
<if test="item.creditRating != null">credit_rating = #{item.creditRating},</if>
|
<if test="item.creditAmount != null">credit_amount = #{item.creditAmount},</if>
|
<if test="item.creditOrderLimit != null">credit_order_limit = #{item.creditOrderLimit},</if>
|
<if test="item.businessStatus != null">business_status = #{item.businessStatus},</if>
|
<if test="item.contractStatus != null">contract_status = #{item.contractStatus},</if>
|
<if test="item.dataStatus != null">data_status = #{item.dataStatus},</if>
|
<if test="item.createTime != null">create_time = #{item.createTime},</if>
|
<if test="item.updateTime != null">update_time = #{item.updateTime},</if>
|
<if test="item.remark != null">remark = #{item.remark},</if>
|
</trim>
|
where id = #{item.id}
|
</foreach>
|
</update>
|
|
<!--删除-->
|
<delete id="deleteTmsCustomerInfoById" parameterType="Integer">
|
delete from tms_customer_info where id = #{id}
|
</delete>
|
<delete id="deleteTmsCustomerInfoByIds" parameterType="Integer">
|
delete from tms_customer_info where id in
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</delete>
|
|
</mapper>
|