171 lines
11 KiB
XML
171 lines
11 KiB
XML
<?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.ktg.mes.md.mapper.HtJczcKehutongjiMapper">
|
|
|
|
<resultMap type="HtJczcKehutongji" id="HtJczcKehutongjiResult">
|
|
<result property="id" column="id" />
|
|
<result property="customerName" column="customer_name" />
|
|
<result property="customerType" column="customer_type" />
|
|
<result property="contactName" column="contact_name" />
|
|
<result property="contactPhone" column="contact_phone" />
|
|
<result property="region" column="region" />
|
|
<result property="totalSales" column="total_sales" />
|
|
<result property="totalQuantity" column="total_quantity" />
|
|
<result property="averageUnitPrice" column="average_unit_price" />
|
|
<result property="largestOrder" column="largest_order" />
|
|
<result property="averageOrderValue" column="average_order_value" />
|
|
<result property="directSales" column="direct_sales" />
|
|
<result property="agentSales" column="agent_sales" />
|
|
<result property="onlineSales" column="online_sales" />
|
|
<result property="gasSales" column="gas_sales" />
|
|
<result property="equipmentSales" column="equipment_sales" />
|
|
<result property="serviceSales" column="service_sales" />
|
|
<result property="firstOrderDate" column="first_order_date" />
|
|
<result property="lastOrderDate" column="last_order_date" />
|
|
<result property="totalOrders" column="total_orders" />
|
|
<result property="repeatPurchaseRate" column="repeat_purchase_rate" />
|
|
<result property="totalPayments" column="total_payments" />
|
|
<result property="totalRefunds" column="total_refunds" />
|
|
<result property="outstandingBalance" column="outstanding_balance" />
|
|
<result property="statisticPeriod" column="statistic_period" />
|
|
</resultMap>
|
|
|
|
<sql id="selectHtJczcKehutongjiVo">
|
|
select id, customer_name, customer_type, contact_name, contact_phone, region, total_sales, total_quantity, average_unit_price, largest_order, average_order_value, direct_sales, agent_sales, online_sales, gas_sales, equipment_sales, service_sales, first_order_date, last_order_date, total_orders, repeat_purchase_rate, total_payments, total_refunds, outstanding_balance, statistic_period from ht_jczc_kehutongji
|
|
</sql>
|
|
|
|
<select id="selectHtJczcKehutongjiList" parameterType="HtJczcKehutongji" resultMap="HtJczcKehutongjiResult">
|
|
<include refid="selectHtJczcKehutongjiVo"/>
|
|
<where>
|
|
<if test="customerName != null and customerName != ''"> and customer_name like concat('%', #{customerName}, '%')</if>
|
|
<if test="customerType != null and customerType != ''"> and customer_type = #{customerType}</if>
|
|
<if test="contactName != null and contactName != ''"> and contact_name like concat('%', #{contactName}, '%')</if>
|
|
<if test="contactPhone != null and contactPhone != ''"> and contact_phone = #{contactPhone}</if>
|
|
<if test="region != null and region != ''"> and region = #{region}</if>
|
|
<if test="totalSales != null "> and total_sales = #{totalSales}</if>
|
|
<if test="totalQuantity != null "> and total_quantity = #{totalQuantity}</if>
|
|
<if test="averageUnitPrice != null "> and average_unit_price = #{averageUnitPrice}</if>
|
|
<if test="largestOrder != null "> and largest_order = #{largestOrder}</if>
|
|
<if test="averageOrderValue != null "> and average_order_value = #{averageOrderValue}</if>
|
|
<if test="directSales != null "> and direct_sales = #{directSales}</if>
|
|
<if test="agentSales != null "> and agent_sales = #{agentSales}</if>
|
|
<if test="onlineSales != null "> and online_sales = #{onlineSales}</if>
|
|
<if test="gasSales != null "> and gas_sales = #{gasSales}</if>
|
|
<if test="equipmentSales != null "> and equipment_sales = #{equipmentSales}</if>
|
|
<if test="serviceSales != null "> and service_sales = #{serviceSales}</if>
|
|
<if test="firstOrderDate != null "> and first_order_date = #{firstOrderDate}</if>
|
|
<if test="lastOrderDate != null "> and last_order_date = #{lastOrderDate}</if>
|
|
<if test="totalOrders != null "> and total_orders = #{totalOrders}</if>
|
|
<if test="repeatPurchaseRate != null "> and repeat_purchase_rate = #{repeatPurchaseRate}</if>
|
|
<if test="totalPayments != null "> and total_payments = #{totalPayments}</if>
|
|
<if test="totalRefunds != null "> and total_refunds = #{totalRefunds}</if>
|
|
<if test="outstandingBalance != null "> and outstanding_balance = #{outstandingBalance}</if>
|
|
<if test="statisticPeriod != null "> and statistic_period = #{statisticPeriod}</if>
|
|
</where>
|
|
</select>
|
|
|
|
<select id="selectHtJczcKehutongjiById" parameterType="Integer" resultMap="HtJczcKehutongjiResult">
|
|
<include refid="selectHtJczcKehutongjiVo"/>
|
|
where id = #{id}
|
|
</select>
|
|
|
|
<insert id="insertHtJczcKehutongji" parameterType="HtJczcKehutongji" useGeneratedKeys="true" keyProperty="id">
|
|
insert into ht_jczc_kehutongji
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="customerName != null and customerName != ''">customer_name,</if>
|
|
<if test="customerType != null and customerType != ''">customer_type,</if>
|
|
<if test="contactName != null">contact_name,</if>
|
|
<if test="contactPhone != null">contact_phone,</if>
|
|
<if test="region != null">region,</if>
|
|
<if test="totalSales != null">total_sales,</if>
|
|
<if test="totalQuantity != null">total_quantity,</if>
|
|
<if test="averageUnitPrice != null">average_unit_price,</if>
|
|
<if test="largestOrder != null">largest_order,</if>
|
|
<if test="averageOrderValue != null">average_order_value,</if>
|
|
<if test="directSales != null">direct_sales,</if>
|
|
<if test="agentSales != null">agent_sales,</if>
|
|
<if test="onlineSales != null">online_sales,</if>
|
|
<if test="gasSales != null">gas_sales,</if>
|
|
<if test="equipmentSales != null">equipment_sales,</if>
|
|
<if test="serviceSales != null">service_sales,</if>
|
|
<if test="firstOrderDate != null">first_order_date,</if>
|
|
<if test="lastOrderDate != null">last_order_date,</if>
|
|
<if test="totalOrders != null">total_orders,</if>
|
|
<if test="repeatPurchaseRate != null">repeat_purchase_rate,</if>
|
|
<if test="totalPayments != null">total_payments,</if>
|
|
<if test="totalRefunds != null">total_refunds,</if>
|
|
<if test="outstandingBalance != null">outstanding_balance,</if>
|
|
<if test="statisticPeriod != null">statistic_period,</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="customerName != null and customerName != ''">#{customerName},</if>
|
|
<if test="customerType != null and customerType != ''">#{customerType},</if>
|
|
<if test="contactName != null">#{contactName},</if>
|
|
<if test="contactPhone != null">#{contactPhone},</if>
|
|
<if test="region != null">#{region},</if>
|
|
<if test="totalSales != null">#{totalSales},</if>
|
|
<if test="totalQuantity != null">#{totalQuantity},</if>
|
|
<if test="averageUnitPrice != null">#{averageUnitPrice},</if>
|
|
<if test="largestOrder != null">#{largestOrder},</if>
|
|
<if test="averageOrderValue != null">#{averageOrderValue},</if>
|
|
<if test="directSales != null">#{directSales},</if>
|
|
<if test="agentSales != null">#{agentSales},</if>
|
|
<if test="onlineSales != null">#{onlineSales},</if>
|
|
<if test="gasSales != null">#{gasSales},</if>
|
|
<if test="equipmentSales != null">#{equipmentSales},</if>
|
|
<if test="serviceSales != null">#{serviceSales},</if>
|
|
<if test="firstOrderDate != null">#{firstOrderDate},</if>
|
|
<if test="lastOrderDate != null">#{lastOrderDate},</if>
|
|
<if test="totalOrders != null">#{totalOrders},</if>
|
|
<if test="repeatPurchaseRate != null">#{repeatPurchaseRate},</if>
|
|
<if test="totalPayments != null">#{totalPayments},</if>
|
|
<if test="totalRefunds != null">#{totalRefunds},</if>
|
|
<if test="outstandingBalance != null">#{outstandingBalance},</if>
|
|
<if test="statisticPeriod != null">#{statisticPeriod},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateHtJczcKehutongji" parameterType="HtJczcKehutongji">
|
|
update ht_jczc_kehutongji
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="customerName != null and customerName != ''">customer_name = #{customerName},</if>
|
|
<if test="customerType != null and customerType != ''">customer_type = #{customerType},</if>
|
|
<if test="contactName != null">contact_name = #{contactName},</if>
|
|
<if test="contactPhone != null">contact_phone = #{contactPhone},</if>
|
|
<if test="region != null">region = #{region},</if>
|
|
<if test="totalSales != null">total_sales = #{totalSales},</if>
|
|
<if test="totalQuantity != null">total_quantity = #{totalQuantity},</if>
|
|
<if test="averageUnitPrice != null">average_unit_price = #{averageUnitPrice},</if>
|
|
<if test="largestOrder != null">largest_order = #{largestOrder},</if>
|
|
<if test="averageOrderValue != null">average_order_value = #{averageOrderValue},</if>
|
|
<if test="directSales != null">direct_sales = #{directSales},</if>
|
|
<if test="agentSales != null">agent_sales = #{agentSales},</if>
|
|
<if test="onlineSales != null">online_sales = #{onlineSales},</if>
|
|
<if test="gasSales != null">gas_sales = #{gasSales},</if>
|
|
<if test="equipmentSales != null">equipment_sales = #{equipmentSales},</if>
|
|
<if test="serviceSales != null">service_sales = #{serviceSales},</if>
|
|
<if test="firstOrderDate != null">first_order_date = #{firstOrderDate},</if>
|
|
<if test="lastOrderDate != null">last_order_date = #{lastOrderDate},</if>
|
|
<if test="totalOrders != null">total_orders = #{totalOrders},</if>
|
|
<if test="repeatPurchaseRate != null">repeat_purchase_rate = #{repeatPurchaseRate},</if>
|
|
<if test="totalPayments != null">total_payments = #{totalPayments},</if>
|
|
<if test="totalRefunds != null">total_refunds = #{totalRefunds},</if>
|
|
<if test="outstandingBalance != null">outstanding_balance = #{outstandingBalance},</if>
|
|
<if test="statisticPeriod != null">statistic_period = #{statisticPeriod},</if>
|
|
</trim>
|
|
where id = #{id}
|
|
</update>
|
|
|
|
<delete id="deleteHtJczcKehutongjiById" parameterType="Integer">
|
|
delete from ht_jczc_kehutongji where id = #{id}
|
|
</delete>
|
|
|
|
<delete id="deleteHtJczcKehutongjiByIds" parameterType="String">
|
|
delete from ht_jczc_kehutongji where id in
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
</delete>
|
|
</mapper> |