<?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.TmsSettlementEntityMapper">
|
|
<resultMap type="com.ruoyi.tms.domain.TmsSettlementEntity" id="TmsSettlementEntityResult">
|
<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="businessRegistrationNumber" column="business_registration_number" />
|
<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="businessContactName" column="business_contact_name" />
|
<result property="businessContactPhone" column="business_contact_phone" />
|
<result property="businessContactEmail" column="business_contact_email" />
|
<result property="creditRating" column="credit_rating" />
|
<result property="creditLimitAmount" column="credit_limit_amount" />
|
<result property="creditLimitQuantity" column="credit_limit_quantity" />
|
<result property="operatingStatus" column="operating_status" />
|
<result property="contractStatus" column="contract_status" />
|
<result property="dataStatus" column="data_status" />
|
<result property="createBy" column="create_by" />
|
<result property="createTime" column="create_time" />
|
<result property="updateBy" column="update_by" />
|
<result property="updateTime" column="update_time" />
|
<result property="remark" column="remark" />
|
</resultMap>
|
|
<sql id="selectTmsSettlementEntityVo">
|
select thisTab.id, thisTab.customer_type, thisTab.customer_short_name, thisTab.customer_code, thisTab.customer_full_name, thisTab.business_registration_number, thisTab.address, thisTab.contact_name, thisTab.contact_phone, thisTab.contact_email, thisTab.business_contact_name, thisTab.business_contact_phone, thisTab.business_contact_email, thisTab.credit_rating, thisTab.credit_limit_amount, thisTab.credit_limit_quantity, thisTab.operating_status, thisTab.contract_status, thisTab.data_status, thisTab.create_by, thisTab.create_time, thisTab.update_by, thisTab.update_time, thisTab.remark from tms_settlement_entity AS thisTab
|
</sql>
|
<sql id="selectTmsSettlementEntityVoCount">
|
select count(0) from tms_settlement_entity 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="businessContactName != null and businessContactName != ''"> and thisTab.business_contact_name like concat('%', #{businessContactName}, '%')</if>
|
<if test="creditRating != null "> and thisTab.credit_rating = #{creditRating}</if>
|
<if test="creditLimitAmount != null "> and thisTab.credit_limit_amount = #{creditLimitAmount}</if>
|
<if test="creditLimitQuantity != null "> and thisTab.credit_limit_quantity = #{creditLimitQuantity}</if>
|
<if test="operatingStatus != null "> and thisTab.operating_status = #{operatingStatus}</if>
|
<if test="contractStatus != null "> and thisTab.contract_status = #{contractStatus}</if>
|
<if test="dataStatus != null "> and thisTab.data_status = #{dataStatus}</if>
|
</sql>
|
|
<!--查询-->
|
<select id="selectTmsSettlementEntityById" parameterType="Integer" resultMap="TmsSettlementEntityResult">
|
<include refid="selectTmsSettlementEntityVo"/>
|
where id = #{id}
|
</select>
|
|
<select id="selectTmsSettlementEntityCount" parameterType="com.ruoyi.tms.domain.TmsSettlementEntity" resultType="int">
|
<include refid="selectTmsSettlementEntityVoCount"/>
|
<where>
|
<include refid="whereCondition"/>
|
</where>
|
</select>
|
|
<select id="selectTmsSettlementEntityList" parameterType="com.ruoyi.tms.domain.TmsSettlementEntity" resultMap="TmsSettlementEntityResult">
|
<include refid="selectTmsSettlementEntityVo"/>
|
<where>
|
<include refid="whereCondition"/>
|
</where>
|
order by thisTab.id desc
|
</select>
|
|
<!-- 新增 -->
|
<insert id="insertTmsSettlementEntity" parameterType="com.ruoyi.tms.domain.TmsSettlementEntity" useGeneratedKeys="true" keyProperty="id">
|
insert into tms_settlement_entity
|
<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">customer_full_name,</if>
|
<if test="businessRegistrationNumber != null">business_registration_number,</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="businessContactName != null and businessContactName != ''">business_contact_name,</if>
|
<if test="businessContactPhone != null">business_contact_phone,</if>
|
<if test="businessContactEmail != null">business_contact_email,</if>
|
<if test="creditRating != null">credit_rating,</if>
|
<if test="creditLimitAmount != null">credit_limit_amount,</if>
|
<if test="creditLimitQuantity != null">credit_limit_quantity,</if>
|
<if test="operatingStatus != null">operating_status,</if>
|
<if test="contractStatus != null">contract_status,</if>
|
<if test="dataStatus != null">data_status,</if>
|
<if test="createBy != null">create_by,</if>
|
<if test="createTime != null">create_time,</if>
|
<if test="updateBy != null">update_by,</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">#{customerFullName},</if>
|
<if test="businessRegistrationNumber != null">#{businessRegistrationNumber},</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="businessContactName != null and businessContactName != ''">#{businessContactName},</if>
|
<if test="businessContactPhone != null">#{businessContactPhone},</if>
|
<if test="businessContactEmail != null">#{businessContactEmail},</if>
|
<if test="creditRating != null">#{creditRating},</if>
|
<if test="creditLimitAmount != null">#{creditLimitAmount},</if>
|
<if test="creditLimitQuantity != null">#{creditLimitQuantity},</if>
|
<if test="operatingStatus != null">#{operatingStatus},</if>
|
<if test="contractStatus != null">#{contractStatus},</if>
|
<if test="dataStatus != null">#{dataStatus},</if>
|
<if test="createBy != null">#{createBy},</if>
|
<if test="createTime != null">#{createTime},</if>
|
<if test="updateBy != null">#{updateBy},</if>
|
<if test="updateTime != null">#{updateTime},</if>
|
<if test="remark != null">#{remark},</if>
|
</trim>
|
</insert>
|
|
<insert id="insertTmsSettlementEntityBatch" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
|
insert into tms_settlement_entity
|
<trim prefix="(" suffix=") values" suffixOverrides=",">
|
id,customer_type,customer_short_name,customer_code,customer_full_name,business_registration_number,address,contact_name,contact_phone,contact_email,business_contact_name,business_contact_phone,business_contact_email,credit_rating,credit_limit_amount,credit_limit_quantity,operating_status,contract_status,data_status,create_by,create_time,update_by,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.businessRegistrationNumber},#{item.address},#{item.contactName},#{item.contactPhone},#{item.contactEmail},#{item.businessContactName},#{item.businessContactPhone},#{item.businessContactEmail},#{item.creditRating},#{item.creditLimitAmount},#{item.creditLimitQuantity},#{item.operatingStatus},#{item.contractStatus},#{item.dataStatus},#{item.createBy},#{item.createTime},#{item.updateBy},#{item.updateTime},#{item.remark},
|
</trim>
|
</foreach>
|
</insert>
|
|
<!-- 修改 -->
|
<update id="updateTmsSettlementEntity" parameterType="com.ruoyi.tms.domain.TmsSettlementEntity">
|
update tms_settlement_entity
|
<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">customer_full_name = #{customerFullName},</if>
|
<if test="businessRegistrationNumber != null">business_registration_number = #{businessRegistrationNumber},</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="businessContactName != null and businessContactName != ''">business_contact_name = #{businessContactName},</if>
|
<if test="businessContactPhone != null">business_contact_phone = #{businessContactPhone},</if>
|
<if test="businessContactEmail != null">business_contact_email = #{businessContactEmail},</if>
|
<if test="creditRating != null">credit_rating = #{creditRating},</if>
|
<if test="creditLimitAmount != null">credit_limit_amount = #{creditLimitAmount},</if>
|
<if test="creditLimitQuantity != null">credit_limit_quantity = #{creditLimitQuantity},</if>
|
<if test="operatingStatus != null">operating_status = #{operatingStatus},</if>
|
<if test="contractStatus != null">contract_status = #{contractStatus},</if>
|
<if test="dataStatus != null">data_status = #{dataStatus},</if>
|
<if test="createBy != null">create_by = #{createBy},</if>
|
<if test="createTime != null">create_time = #{createTime},</if>
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
<if test="remark != null">remark = #{remark},</if>
|
</trim>
|
where id = #{id}
|
</update>
|
<!-- 修改 -->
|
<update id="updateTmsSettlementEntityBatch" parameterType="java.util.List">
|
<foreach collection="list" item="item" index="index" separator=";">
|
update tms_settlement_entity
|
<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">customer_full_name = #{item.customerFullName},</if>
|
<if test="item.businessRegistrationNumber != null">business_registration_number = #{item.businessRegistrationNumber},</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.businessContactName != null and item.businessContactName != ''">business_contact_name = #{item.businessContactName},</if>
|
<if test="item.businessContactPhone != null">business_contact_phone = #{item.businessContactPhone},</if>
|
<if test="item.businessContactEmail != null">business_contact_email = #{item.businessContactEmail},</if>
|
<if test="item.creditRating != null">credit_rating = #{item.creditRating},</if>
|
<if test="item.creditLimitAmount != null">credit_limit_amount = #{item.creditLimitAmount},</if>
|
<if test="item.creditLimitQuantity != null">credit_limit_quantity = #{item.creditLimitQuantity},</if>
|
<if test="item.operatingStatus != null">operating_status = #{item.operatingStatus},</if>
|
<if test="item.contractStatus != null">contract_status = #{item.contractStatus},</if>
|
<if test="item.dataStatus != null">data_status = #{item.dataStatus},</if>
|
<if test="item.createBy != null">create_by = #{item.createBy},</if>
|
<if test="item.createTime != null">create_time = #{item.createTime},</if>
|
<if test="item.updateBy != null">update_by = #{item.updateBy},</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="deleteTmsSettlementEntityById" parameterType="Integer">
|
delete from tms_settlement_entity where id = #{id}
|
</delete>
|
<delete id="deleteTmsSettlementEntityByIds" parameterType="Integer">
|
delete from tms_settlement_entity where id in
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</delete>
|
|
</mapper>
|