| | |
| | | <?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"> |
| | | 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="contactName" column="contact_name" /> |
| | | <result property="contactPhone" column="contact_phone" /> |
| | | <result property="contactEmail" column="contact_email" /> |
| | | <result property="signCompany" column="sign_company" /> |
| | | <result property="signCompanyId" column="sign_company_id" /> |
| | | <result property="bizContactName" column="biz_contact_name" /> |
| | | <result property="signCompanyName" column="sign_company_name" /> |
| | | <result property="bizContactPhone" column="biz_contact_phone" /> |
| | | <result property="bizContactEmail" column="biz_contact_email" /> |
| | | <result property="creditRating" column="credit_rating" /> |
| | |
| | | </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 |
| | | 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_id, thisTab.biz_contact_name, thisTab.sign_company_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 |
| | |
| | | <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="signCompanyId != null "> and thisTab.sign_company_id = #{signCompanyId}</if> |
| | | <if test="bizContactName != null and bizContactName != ''"> and thisTab.biz_contact_name like concat('%', #{bizContactName}, '%')</if> |
| | | <if test="signCompanyName != null and signCompanyName != ''"> and thisTab.sign_company_name like concat('%', #{signCompanyName}, '%')</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> |
| | | <if test="updateTime != null "> and thisTab.update_time = #{updateTime}</if> |
| | | </sql> |
| | | |
| | | <!--查询--> |
| | |
| | | <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="signCompanyId != null">sign_company_id,</if> |
| | | <if test="bizContactName != null and bizContactName != ''">biz_contact_name,</if> |
| | | <if test="signCompanyName != null and signCompanyName != ''">sign_company_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="createTime != null">create_time,</if> |
| | | <if test="updateTime != null">update_time,</if> |
| | | <if test="remark != null">remark,</if> |
| | | </trim> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="customerType != null">#{customerType},</if> |
| | | <if test="customerShortName != null and customerShortName != ''">#{customerShortName},</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="signCompanyId != null">#{signCompanyId},</if> |
| | | <if test="bizContactName != null and bizContactName != ''">#{bizContactName},</if> |
| | | <if test="signCompanyName != null and signCompanyName != ''">#{signCompanyName},</if> |
| | | <if test="bizContactPhone != null and bizContactPhone != ''">#{bizContactPhone},</if> |
| | | <if test="bizContactEmail != null">#{bizContactEmail},</if> |
| | | <if test="creditRating != null">#{creditRating},</if> |
| | |
| | | <if test="createTime != null">#{createTime},</if> |
| | | <if test="updateTime != null">#{updateTime},</if> |
| | | <if test="remark != null">#{remark},</if> |
| | | </trim> |
| | | </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, |
| | | id,customer_type,customer_short_name,customer_code,customer_full_name,business_license_no,address,contact_name,contact_phone,contact_email,sign_company_id,biz_contact_name,sign_company_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}, |
| | | #{item.id},#{item.customerType},#{item.customerShortName},#{item.customerCode},#{item.customerFullName},#{item.businessLicenseNo},#{item.address},#{item.contactName},#{item.contactPhone},#{item.contactEmail},#{item.signCompanyId},#{item.bizContactName},#{item.signCompanyName},#{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> |
| | |
| | | <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="signCompanyId != null">sign_company_id = #{signCompanyId},</if> |
| | | <if test="bizContactName != null and bizContactName != ''">biz_contact_name = #{bizContactName},</if> |
| | | <if test="signCompanyName != null and signCompanyName != ''">sign_company_name = #{signCompanyName},</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="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.signCompanyId != null">sign_company_id = #{item.signCompanyId},</if> |
| | | <if test="item.bizContactName != null and item.bizContactName != ''">biz_contact_name = #{item.bizContactName},</if> |
| | | <if test="item.signCompanyName != null and item.signCompanyName != ''">sign_company_name = #{item.signCompanyName},</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.updateTime != null">update_time = #{item.updateTime},</if> |
| | | <if test="item.remark != null">remark = #{item.remark},</if> |
| | | </trim> |
| | | where id = #{item.id} |
| | | where id = #{item.id} |
| | | </foreach> |
| | | </update> |
| | | |