<?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.zto.cloudcall.mapper.ZtoSupplierContractDetailMapper"> <!-- 通用查询映射结果 --> <resultMap id="BaseResultMap" type="com.zto.cloudcall.model.ZtoSupplierContractDetail"> <id column="ID" property="id"/> <result column="SUPPLIER_CONTRACT_ID" property="supplierContractId"/> <result column="CONTRACT_NO" property="contractNo"/> <result column="CONTRACT_NAME" property="contractName"/> <result column="BILLING_THEME" property="billingTheme"/> <result column="BILLING_STYLE" property="billingStyle"/> <result column="BILLING_UNIT" property="billingUnit"/> <result column="TAX_RATE" property="taxRate"/> <result column="UNIT_PRICE" property="unitPrice"/> <result column="PURCHASE_PATTERN" property="purchasePattern"/> <result column="CREATOR" property="creator"/> <result column="GMT_CREATE" property="gmtCreate"/> <result column="MODIFIER" property="modifier"/> <result column="GMT_MODIFIED" property="gmtModified"/> <result column="DELETED" property="deleted"/> <result column="VERSION" property="version"/> </resultMap> <!-- 通用查询结果列 --> <sql id="Base_Column_List"> ID, SUPPLIER_CONTRACT_ID, CONTRACT_NO, CONTRACT_NAME, BILLING_THEME, BILLING_STYLE,BILLING_UNIT, TAX_RATE,UNIT_PRICE, PURCHASE_PATTERN, CREATOR, GMT_CREATE, MODIFIER, GMT_MODIFIED, DELETED, VERSION </sql> <sql id="Contract_Detail_Column_List"> ID, SUPPLIER_CONTRACT_ID, CONTRACT_NO, CONTRACT_NAME, BILLING_THEME, BILLING_STYLE,BILLING_UNIT, TAX_RATE,UNIT_PRICE, PURCHASE_PATTERN, CREATOR, GMT_CREATE </sql> <!--值的列表--> <sql id="Supplier_Contract_Detail_Column_List"> -- 合同ID <if test="supplierContractId != null and supplierContractId != ''"> SUPPLIER_CONTRACT_ID, </if> -- 合同编码 <if test="contractNo != null and item.contractNo != ''"> CONTRACT_NO, </if> -- 合同名称 <if test="contractName != null and contractName != ''"> CONTRACT_NAME, </if> -- 计费主题 <if test="billingTheme != null and billingTheme != ''"> BILLING_THEME, </if> <if test="billingStyle != null and billingStyle != ''"> BILLING_STYLE, </if> <if test="billingUnit != null and billingUnit != ''"> BILLING_UNIT, </if> <if test="taxRate != null"> TAX_RATE, </if> <if test="unitPrice != null "> UNIT_PRICE, </if> <if test="item.purchasePattern != null item.purchasePattern !=''"> PURCHASE_PATTERN, </if> <if test="item.creator != null and item.creator != ''"> CREATOR, </if> <if test="item.gmtCreate != null"> GMT_CREATE, </if> </sql> <!--值的列表--> <sql id="Supplier_Contract_Detail_Value_List"> <if test="item.supplierContractId != null and item.supplierContractId != ''"> #{item.supplierContractId,jdbcType=VARCHAR}, </if> -- 合同编码 <if test="item.contractNo != null and item.contractNo != ''"> #{item.contractNo,jdbcType=VARCHAR}, </if> -- 合同名称 <if test="item.contractName != null and item.contractName != ''"> #{item.contractName,jdbcType=VARCHAR}, </if> -- 计费主题 <if test="item.billingTheme != null and item.billingTheme != ''"> #{item.billingThem,jdbcType=VARCHAR}, </if> <if test="item.billingStyle != null and item.billingStyle != ''"> #{item.billingStyle,jdbcType=VARCHAR}, </if> <if test="item.billingUnit != null and item.billingUnit != ''"> #{item.billingUnit,jdbcType=VARCHAR}, </if> <if test="item.taxRate != null"> #{item.taxRate,jdbcType=DECIMAL}, </if> <if test="item.unitPrice != null "> #{item.unitPrice,jdbcType=DECIMAL}, </if> <if test="item.purchasePattern != null and item.purchasePattern !='' "> #{item.purchasePattern,jdbcType=VARCHAR}, </if> <if test="item.creator != null and item.creator != ''"> #{item.creator,jdbcType=VARCHAR}, </if> <if test="item.gmtCreate != null"> #{item.gmtCreate,jdbcType=TIMESTAMP}, </if> </sql> <sql id="Base_Batch_Column_List"> ID, SUPPLIER_CONTRACT_ID, CONTRACT_NO, CONTRACT_NAME, BILLING_THEME, BILLING_STYLE, BILLING_UNIT, TAX_RATE, UNIT_PRICE, PURCHASE_PATTERN, CREATOR,GMT_CREATE, </sql> <!--新增供应商合同信息--> <insert id="addBatchContractDetail" parameterType="java.util.List" useGeneratedKeys="false"> INSERT INTO ZTO_SUPPLIER_CONTRACT_DETAIL <trim prefix="(" suffix=")" suffixOverrides=","> <include refid="Base_Batch_Column_List"/> </trim> <foreach collection="list" item="item" index="index" separator="union all"> ( SELECT (SELECT SYS_GUID() AS id FROM dual), #{item.supplierContractId,jdbcType=VARCHAR}, #{item.contractNo,jdbcType=VARCHAR}, #{item.contractName,jdbcType=VARCHAR}, #{item.billingTheme,jdbcType=VARCHAR}, #{item.billingStyle,jdbcType=VARCHAR}, #{item.billingUnit,jdbcType=VARCHAR}, #{item.taxRate,jdbcType=DECIMAL}, #{item.unitPrice,jdbcType=DECIMAL}, #{item.purchasePattern,jdbcType=VARCHAR}, #{item.creator,jdbcType=VARCHAR}, #{item.gmtCreate,jdbcType=TIMESTAMP} FROM dual ) </foreach> </insert> </mapper>