unis_sip/ruoyi-sip/src/main/resources/mapper/sip/ProjectOrderInfoMapper.xml

561 lines
33 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.ruoyi.sip.mapper.ProjectOrderInfoMapper">
<resultMap type="ProjectOrderInfo" id="ProjectOrderInfoResult">
<result property="id" column="id" />
<result property="projectId" column="project_id" />
<result property="city" column="city" />
<result property="businessPerson" column="business_person" />
<result property="businessEmail" column="business_email" />
<result property="businessPhone" column="business_phone" />
<result property="orderCode" column="order_code" />
<result property="currencyType" column="currencyType" />
<result property="shipmentAmount" column="shipment_amount" />
<result property="actualPurchaseAmount" column="actual_purchase_amount" />
<result property="orderEndTime" column="order_end_time" />
<result property="deliveryTime" column="delivery_time" />
<result property="companyDelivery" column="company_delivery" />
<result property="notifier" column="notifier" />
<result property="notifierAddress" column="notifier_address" />
<result property="notifierEmail" column="notifier_email" />
<result property="notifierPhone" column="notifier_phone" />
<result property="duty" column="duty" />
<result property="dutyEmail" column="duty_email" />
<result property="dutyPhone" column="duty_phone" />
<result property="orderChannel" column="order_channel" />
<result property="partnerCode" column="partner_code" />
<result property="supplier" column="supplier" />
<result property="remark" column="remark" />
<result property="orderStatus" column="order_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="paymentMethod" column="payment_method" />
<result property="paymentRatio" column="payment_ratio" />
<result property="paymentDescription" column="payment_description" />
</resultMap>
<sql id="selectProjectOrderInfoVo">
select id, project_id,province, city, business_person, business_email, business_phone, order_code, currencyType,
shipment_amount, actual_purchase_amount, order_end_time, delivery_time, company_delivery, notifier,
notifier_email, notifier_phone, duty, duty_email, duty_phone, order_channel, partner_code, supplier,notifier_address,
remark, order_status, create_by, create_time, update_by, update_time,version_code,process_type,process_template,discount_fold,
delivery_status,sign_status,outer_status,approve_time,payment_method,payment_ratio,payment_description
from project_order_info t1
</sql>
<sql id="selectProjectOrderInfoRelationVo">
select t1.id, t1.project_id,t1.province, t1.city, t1.business_person, t1.business_email, t1.business_phone, t1.order_code, t1.currencyType,
t1.shipment_amount, t1.actual_purchase_amount, t1.order_end_time, t1.delivery_time, t1.company_delivery, t1.notifier,
t1.notifier_email, t1.notifier_phone, t1.duty, t1.duty_email, t1.duty_phone, t1.order_channel, t1.partner_code, t1.supplier,
t1.remark, t1.order_status, t1.create_by, t1.create_time, t1.update_by, t1.update_time,t1.partner_user_name,t1.partner_email
,t1.partner_phone,t1.version_code,t1.process_type,t1.process_template,t1.discount_fold,t1.notifier_address,
t1.delivery_status,t1.sign_status,t1.outer_status,t1.approve_time,t1.payment_method,t1.payment_ratio,t1.payment_description
,t2.project_code,t2.project_name,t2.province,t2.customer_name,t2.customer_code,t2.industry_type,t2.bg_property,t2.agent_code,t2.estimated_order_time
,t2.customer_phone,t2.customer_user_name,t2.agent_code,t2.customer_code,t2.partner_name project_partner_name
,t3.partner_name,t3.level,t3.system_user_id
,t4.agent_name
,t5.user_name as duty_name
from project_order_info t1
left join project_info t2 on t1.project_id = t2.id
left join partner_info t3 on t1.partner_code=t3.partner_code
left join agent_info t4 on t2.agent_code=t4.agent_code
left join sys_user t5 on t1.duty=t5.user_id
</sql>
<select id="selectProjectOrderInfoList" parameterType="ProjectOrderInfo" resultMap="ProjectOrderInfoResult">
<include refid="selectProjectOrderInfoRelationVo"/>
where 1=1
<if test="projectId != null ">and t1.project_id = #{projectId}</if>
<if test="projectCode != null and projectCode!='' ">and t2.project_code like
concat('%',#{projectCode},'%')
</if>
<if test="projectName != null and projectName!=''">and t2.project_name like concat('%',
#{projectName},'%')
</if>
<if test="customerName != null and customerName!=''">and t2.customer_name like
concat('%',#{customerName},'%')
</if>
<if test="agentName != null and agentName!=''">and t4.agent_name like concat('%',#{agentName},'%')</if>
<if test="province != null and province != ''">and t1.province = #{province}</if>
<if test="city != null and city != ''">and t1.city = #{city}</if>
<if test="businessPerson != null and businessPerson != ''">and t1.business_person = #{businessPerson}</if>
<if test="businessEmail != null and businessEmail != ''">and t1.business_email = #{businessEmail}</if>
<if test="businessPhone != null and businessPhone != ''">and t1.business_phone = #{businessPhone}</if>
<if test="orderCode != null and orderCode != ''">and t1.order_code = #{orderCode}</if>
<if test="currencyType != null and currencyType != ''">and t1.currencyType = #{currencyType}</if>
<if test="shipmentAmount != null ">and t1.shipment_amount = #{shipmentAmount}</if>
<if test="actualPurchaseAmount != null ">and t1.actual_purchase_amount = #{actualPurchaseAmount}</if>
<if test="orderEndTime != null ">and t1.order_end_time = #{orderEndTime}</if>
<if test="deliveryTime != null ">and t1.delivery_time = #{deliveryTime}</if>
<if test="companyDelivery != null and companyDelivery != ''">and t1.company_delivery = #{companyDelivery}
</if>
<if test="notifier != null and notifier != ''">and t1.notifier = #{notifier}</if>
<if test="notifierEmail != null and notifierEmail != ''">and t1.notifier_email = #{notifierEmail}</if>
<if test="notifierPhone != null and notifierPhone != ''">and t1.notifier_phone = #{notifierPhone}</if>
<if test="notifierAddress != null and notifierAddress != ''">and t1.notifier_address = #{notifierAddress}
</if>
<if test="duty != null and duty != ''">and t1.duty = #{duty}</if>
<if test="dutyName != null and dutyName != ''">and t5.user_name like concat('%', #{dutyName}, '%')</if>
<if test="dutyEmail != null and dutyEmail != ''">and t1.duty_email = #{dutyEmail}</if>
<if test="dutyPhone != null and dutyPhone != ''">and t1.duty_phone = #{dutyPhone}</if>
<if test="orderChannel != null and orderChannel != ''">and t1.order_channel = #{orderChannel}</if>
<if test="partnerCode != null and partnerCode != ''">and t1.partner_code = #{partnerCode}</if>
<if test="partnerName != null and partnerName != ''">and t3.partner_name like concat('%', #{partnerName},
'%')
</if>
<if test="supplier != null and supplier != ''">and t1.supplier = #{supplier}</if>
<if test="supplier != null and supplier != ''">and t1.supplier = #{supplier}</if>
<if test="orderStatus != null and orderStatus != ''">and t1.order_status = #{orderStatus}</if>
<if test="deliveryStatus != null and deliveryStatus != ''">and t1.delivery_status = #{deliveryStatus}</if>
<if test="outerStatus != null and outerStatus != ''">and t1.outer_status = #{outerStatus}</if>
<if test="signStatus != null and signStatus != ''">and t1.sign_status = #{signStatus}</if>
<if test="keyword != null and keyword != ''">and (t1.order_code like concat('%',#{keyword},'%') or
t2.project_name like concat('%',#{keyword},'%') or t2.customer_name like concat('%',#{keyword},'%'))
</if>
<if test="deliveryTimeStart != null or deliveryTimeEnd != null">
<choose>
<when test="deliveryTimeStart != null and deliveryTimeEnd != null">
and t1.delivery_time between date_format(#{deliveryTimeStart}, '%Y-%m-%d 00:00:00') and
date_format(#{deliveryTimeEnd}, '%Y-%m-%d 23:59:59')
</when>
<when test="deliveryTimeStart != null">
and t1.delivery_time <![CDATA[ >= ]]> date_format(#{deliveryTimeStart}, '%Y-%m-%d 00:00:00')
</when>
<when test="deliveryTimeEnd != null">
and t1.delivery_time <![CDATA[ <= ]]> date_format(#{deliveryTimeEnd}, '%Y-%m-%d 23:59:59')
</when>
</choose>
</if>
<if test="updateTimeStart != null or updateTimeEnd != null">
<choose>
<when test="updateTimeStart != null and updateTimeEnd != null">
and t1.update_time between date_format(#{updateTimeStart}, '%Y-%m-%d 00:00:00') and
date_format(#{updateTimeEnd}, '%Y-%m-%d 23:59:59')
</when>
<when test="updateTimeStart != null">
and t1.update_time <![CDATA[ >= ]]> date_format(#{updateTimeStart}, '%Y-%m-%d 00:00:00')
</when>
<when test="updateTimeEnd != null">
and t1.update_time <![CDATA[ <= ]]> date_format(#{updateTimeEnd}, '%Y-%m-%d 23:59:59')
</when>
</choose>
</if>
<if test="approveTimeStart != null or approveTimeEnd != null">
<choose>
<when test="approveTimeStart != null and approveTimeEnd != null">
and t1.approve_time between date_format(#{approveTimeStart}, '%Y-%m-%d 00:00:00') and
date_format(#{approveTimeEnd}, '%Y-%m-%d 23:59:59')
</when>
<when test="deliveryTimeStart != null">
and t1.approve_time <![CDATA[ >= ]]> date_format(#{approveTimeStart}, '%Y-%m-%d 00:00:00')
</when>
<when test="approveTimeEnd != null">
and t1.approve_time <![CDATA[ <= ]]> date_format(#{approveTimeEnd}, '%Y-%m-%d 23:59:59')
</when>
</choose>
</if>
<if test="estimatedOrderTimeStart != null or estimatedOrderTimeEnd != null">
<choose>
<when test="estimatedOrderTimeStart != null and estimatedOrderTimeEnd != null">
and t2.estimated_order_time between date_format(#{estimatedOrderTimeStart}, '%Y-%m-%d 00:00:00')
and date_format(#{estimatedOrderTimeEnd}, '%Y-%m-%d 23:59:59')
</when>
<when test="estimatedOrderTimeStart != null">
and t2.estimated_order_time <![CDATA[ >= ]]> date_format(#{estimatedOrderTimeStart}, '%Y-%m-%d
00:00:00')
</when>
<when test="estimatedOrderTimeEnd != null">
and t2.estimated_order_time <![CDATA[ <= ]]> date_format(#{estimatedOrderTimeEnd}, '%Y-%m-%d
23:59:59')
</when>
</choose>
</if>
<if test="orderEndTimeStart != null or orderEndTimeEnd != null">
<choose>
<when test="orderEndTimeStart != null and orderEndTimeEnd != null">
and t1.order_end_time between date_format(#{orderEndTimeStart}, '%Y-%m-%d 00:00:00') and
date_format(#{orderEndTimeEnd}, '%Y-%m-%d 23:59:59')
</when>
<when test="orderEndTimeStart != null">
and t1.order_end_time <![CDATA[ >= ]]> date_format(#{orderEndTimeStart}, '%Y-%m-%d 00:00:00')
</when>
<when test="orderEndTimeEnd != null">
and t1.order_end_time <![CDATA[ <= ]]> date_format(#{orderEndTimeEnd}, '%Y-%m-%d 23:59:59')
</when>
</choose>
</if>
<if test="approve!=null and approve!=''">and t1.order_code in (select business_key from bu_todo where
process_key in ('order_approve_online','order_approve_offline') and approve_user = #{approve} and
task_name != '售前')
</if>
<if test="productCodeList!=null and productCodeList.size>0">
and t1.project_id in (select distinct t2.project_id from project_product_info t2 where t2.product_bom_code
in
<foreach item="item" collection="productCodeList" separator="," open="(" close=")">
#{item}
</foreach>
)
</if>
${params.authSql}
</select>
<select id="selectProjectOrderInfoById" parameterType="Long" resultMap="ProjectOrderInfoResult">
<include refid="selectProjectOrderInfoRelationVo"/>
where t1.id = #{id}
</select>
<select id="selectProjectOrderInfoByProjectId" resultType="com.ruoyi.sip.domain.ProjectOrderInfo">
<include refid="selectProjectOrderInfoRelationVo"/>
where t1.project_id in (
<foreach item="item" collection="list" separator=",">
#{item}
</foreach>
)
</select>
<select id="selectMaxOrderCode" resultType="java.lang.Integer">
select ifnull( max(SUBSTR( order_code FROM LENGTH(#{province})+1 FOR 3 )), 0 )
from project_order_info
where order_code like concat(#{province}, '%')
</select>
<select id="selectAgentProvinceByProjectId" resultType="java.lang.String">
select t2.province
from project_info t1
inner join agent_info t2 on t1.agent_code = t2.agent_code
where t1.id = #{projectId}
limit 1
</select>
<select id="listHomePageData" resultType="com.ruoyi.sip.dto.StatisticsDetailDto">
select count(1) value,date_format(create_time,'%Y-%m-%d') statistics_str from project_order_info
where create_time >=DATE_SUB(CURDATE(), INTERVAL ${day} DAY)
group by date_format(create_time,'%Y-%m-%d')
</select>
<select id="selectProjectOrderInfoByCode" resultType="com.ruoyi.sip.domain.ProjectOrderInfo">
<include refid="selectProjectOrderInfoRelationVo"/>
where t1.order_code = #{orderCode}
</select>
<select id="listOrderInfoVo" resultType="com.ruoyi.sip.vo.OrderInfoVo">
SELECT
t1.order_code,
t2.project_name AS 'order_name',
t1.version_code,
t3.contact_person AS 'sale_name',
t3.contact_email AS 'sale_email' ,
t4.customer_name as 'customer_name',
t4.contact_person,
t4.contact_email,
t4.contact_phone,
t1.update_time as 'last_update_time'
FROM
project_order_info t1
LEFT JOIN project_info t2 ON t1.project_id = t2.id
LEFT JOIN agent_info t3 ON t2.agent_code = t3.agent_code
LEFT JOIN customer_info t4 ON t2.customer_code = t4.customer_code
where t1.update_time between #{updateTimeStart} and #{updateTimeEnd}
and t1.order_code in ( select DISTINCT order_code from oms_inventory_outer where outer_code in (SELECT outer_code from oms_inventory_delivery where delivery_status=1)
)
<if test="productSn!=null and productSn!=''">
and t1.order_code in (select select DISTINCT order_code from oms_inventory_outer where outer_code in (select outer_code from oms_inventory_info where product_sn=#{productSn} ) )
</if>
</select>
<insert id="insertProjectOrderInfo" parameterType="ProjectOrderInfo" useGeneratedKeys="true" keyProperty="id">
insert into project_order_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="projectId != null">project_id,</if>
<if test="province != null">province,</if>
<if test="city != null">city,</if>
<if test="businessPerson != null">business_person,</if>
<if test="businessEmail != null">business_email,</if>
<if test="businessPhone != null">business_phone,</if>
<if test="orderCode != null">order_code,</if>
<if test="versionCode != null">version_code,</if>
<if test="currencyType != null">currencyType,</if>
<if test="shipmentAmount != null">shipment_amount,</if>
<if test="actualPurchaseAmount != null">actual_purchase_amount,</if>
<if test="orderEndTime != null">order_end_time,</if>
<if test="deliveryTime != null">delivery_time,</if>
<if test="companyDelivery != null">company_delivery,</if>
<if test="notifier != null">notifier,</if>
<if test="notifierEmail != null">notifier_email,</if>
<if test="notifierPhone != null">notifier_phone,</if>
<if test="notifierAddress != null">notifier_address,</if>
<if test="duty != null">duty,</if>
<if test="dutyEmail != null">duty_email,</if>
<if test="dutyPhone != null">duty_phone,</if>
<if test="orderChannel != null">order_channel,</if>
<if test="partnerCode != null">partner_code,</if>
<if test="partnerEmail != null">partner_email,</if>
<if test="partnerUserName != null">partner_user_name,</if>
<if test="partnerPhone != null">partner_phone,</if>
<if test="supplier != null">supplier,</if>
<if test="remark != null">remark,</if>
<if test="orderStatus != null">order_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="processType != null and processType!=''">process_type,</if>
<if test="processTemplate != null and processTemplate!=''">process_template,</if>
<if test="discountFold != null and discountFold!=''">discount_fold,</if>
<if test="paymentMethod != null and paymentMethod != ''">payment_method,</if>
<if test="paymentRatio != null">payment_ratio,</if>
<if test="paymentDescription != null and paymentDescription != ''">payment_description,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="projectId != null">#{projectId},</if>
<if test="province != null">#{province},</if>
<if test="city != null">#{city},</if>
<if test="businessPerson != null">#{businessPerson},</if>
<if test="businessEmail != null">#{businessEmail},</if>
<if test="businessPhone != null">#{businessPhone},</if>
<if test="orderCode != null">#{orderCode},</if>
<if test="versionCode != null">#{versionCode},</if>
<if test="currencyType != null">#{currencyType},</if>
<if test="shipmentAmount != null">#{shipmentAmount},</if>
<if test="actualPurchaseAmount != null">#{actualPurchaseAmount},</if>
<if test="orderEndTime != null">#{orderEndTime},</if>
<if test="deliveryTime != null">#{deliveryTime},</if>
<if test="companyDelivery != null">#{companyDelivery},</if>
<if test="notifier != null">#{notifier},</if>
<if test="notifierEmail != null">#{notifierEmail},</if>
<if test="notifierPhone != null">#{notifierPhone},</if>
<if test="notifierAddress != null">#{notifierAddress},</if>
<if test="duty != null">#{duty},</if>
<if test="dutyEmail != null">#{dutyEmail},</if>
<if test="dutyPhone != null">#{dutyPhone},</if>
<if test="orderChannel != null">#{orderChannel},</if>
<if test="partnerCode != null">#{partnerCode},</if>
<if test="partnerEmail != null">#{partnerEmail},</if>
<if test="partnerUserName != null">#{partnerUserName},</if>
<if test="partnerPhone != null">#{partnerPhone},</if>
<if test="supplier != null">#{supplier},</if>
<if test="remark != null">#{remark},</if>
<if test="orderStatus != null">#{orderStatus},</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="processType != null and processType!=''">#{processType},</if>
<if test="processTemplate != null and processTemplate!=''">#{processTemplate},</if>
<if test="discountFold != null and discountFold!=''">#{discountFold},</if>
<if test="paymentMethod != null and paymentMethod != ''">#{paymentMethod},</if>
<if test="paymentRatio != null">#{paymentRatio},</if>
<if test="paymentDescription != null and paymentDescription != ''">#{paymentDescription},</if>
</trim>
</insert>
<insert id="bakData">
insert into project_order_info_log(id,
project_id,
province,
city,
business_person,
business_email,
business_phone,
version_code,
order_code,
currencyType,
shipment_amount,
actual_purchase_amount,
order_end_time,
delivery_time,
company_delivery,
notifier,
notifier_email,
notifier_phone,
notifier_address,
duty,
duty_email,
duty_phone,
order_channel,
partner_user_name,
partner_phone,
partner_email,
partner_code,
supplier,
remark,
delivery_status,
sign_status,
outer_status,
approve_time,
order_status,
create_by,
create_time,
update_by,
update_time,
process_type,
process_template,
discount_fold)
select id,
project_id,
province,
city,
business_person,
business_email,
business_phone,
version_code,
order_code,
currencyType,
shipment_amount,
actual_purchase_amount,
order_end_time,
delivery_time,
company_delivery,
notifier,
notifier_email,
notifier_phone,
notifier_address,
duty,
duty_email,
duty_phone,
order_channel,
partner_user_name,
partner_phone,
partner_email,
partner_code,
supplier,
remark,
delivery_status,
sign_status,
outer_status,
approve_time,
order_status,
create_by,
create_time,
update_by,
update_time,
process_type,
process_template,
discount_fold
from project_order_info
where order_code = #{orderCode}
</insert>
<update id="updateProjectOrderInfo" parameterType="ProjectOrderInfo">
update project_order_info
<trim prefix="SET" suffixOverrides=",">
<if test="projectId != null">project_id = #{projectId},</if>
<if test="province != null">province = #{province},</if>
<if test="city != null">city = #{city},</if>
<if test="businessPerson != null">business_person = #{businessPerson},</if>
<if test="businessEmail != null">business_email = #{businessEmail},</if>
<if test="businessPhone != null">business_phone = #{businessPhone},</if>
<if test="orderCode != null">order_code = #{orderCode},</if>
<if test="versionCode != null">version_code=#{versionCode},</if>
<if test="currencyType != null">currencyType = #{currencyType},</if>
<if test="shipmentAmount != null">shipment_amount = #{shipmentAmount},</if>
<if test="actualPurchaseAmount != null">actual_purchase_amount = #{actualPurchaseAmount},</if>
<if test="orderEndTime != null">order_end_time = #{orderEndTime},</if>
<if test="deliveryTime != null">delivery_time = #{deliveryTime},</if>
<if test="companyDelivery != null">company_delivery = #{companyDelivery},</if>
<if test="notifier != null">notifier = #{notifier},</if>
<if test="notifierEmail != null">notifier_email = #{notifierEmail},</if>
<if test="notifierPhone != null">notifier_phone = #{notifierPhone},</if>
<if test="notifierAddress != null">notifier_address = #{notifierAddress},</if>
<if test="duty != null">duty = #{duty},</if>
<if test="dutyEmail != null">duty_email = #{dutyEmail},</if>
<if test="dutyPhone != null">duty_phone = #{dutyPhone},</if>
<if test="orderChannel != null">order_channel = #{orderChannel},</if>
<if test="partnerCode != null">partner_code = #{partnerCode},</if>
<if test="partnerEmail != null">partner_email=#{partnerEmail},</if>
<if test="processType != null and processType!=''">process_type=#{processType},</if>
<if test="processTemplate != null and processTemplate!=''">process_template=#{processTemplate},</if>
<if test="discountFold != null and discountFold!=''">discount_fold=#{discountFold},</if>
<if test="partnerUserName != null">partner_user_name=#{partnerUserName},</if>
<if test="partnerPhone != null">partner_phone=#{partnerPhone},</if>
<if test="supplier != null">supplier = #{supplier},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="orderStatus != null">order_status = #{orderStatus},</if>
<if test="outerStatus != null">outer_status = #{outerStatus},</if>
<if test="deliveryStatus != null">delivery_status = #{deliveryStatus},</if>
<if test="signStatus != null">sign_status = #{signStatus},</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="approveTime != null">approve_time = #{approveTime},</if>
<if test="paymentMethod != null and paymentMethod != ''">payment_method = #{paymentMethod},</if>
<if test="paymentRatio != null">payment_ratio = #{paymentRatio},</if>
<if test="paymentDescription != null and paymentDescription != ''">payment_description = #{paymentDescription},</if>
</trim>
where id = #{id}
</update>
<update id="updateProjectOrderInfoByCode" parameterType="ProjectOrderInfo">
update project_order_info
<trim prefix="SET" suffixOverrides=",">
<if test="projectId != null">project_id = #{projectId},</if>
<if test="province != null">province = #{province},</if>
<if test="city != null">city = #{city},</if>
<if test="businessPerson != null">business_person = #{businessPerson},</if>
<if test="businessEmail != null">business_email = #{businessEmail},</if>
<if test="businessPhone != null">business_phone = #{businessPhone},</if>
<if test="approveTime != null">approve_time = #{approveTime},</if>
<if test="paymentMethod != null and paymentMethod != ''">payment_method = #{paymentMethod},</if>
<if test="paymentRatio != null">payment_ratio = #{paymentRatio},</if>
<if test="paymentDescription != null and paymentDescription != ''">payment_description = #{paymentDescription},</if>
<if test="versionCode != null">
<choose>
<when test="versionCode == 'add'.toString()">version_code = cast(version_code as UNSIGNED) +1,</when>
<otherwise>version_code = #{versionCode},</otherwise>
</choose>
</if>
<if test="processType != null and processType!=''">process_type=${processType},</if>
<if test="processTemplate != null and processTemplate!=''">process_template=${processTemplate},</if>
<if test="discountFold != null and discountFold!=''">discount_fold=${discountFold},</if>
<if test="currencyType != null">currencyType = #{currencyType},</if>
<if test="shipmentAmount != null">shipment_amount = #{shipmentAmount},</if>
<if test="actualPurchaseAmount != null">actual_purchase_amount = #{actualPurchaseAmount},</if>
<if test="orderEndTime != null">order_end_time = #{orderEndTime},</if>
<if test="deliveryTime != null">delivery_time = #{deliveryTime},</if>
<if test="companyDelivery != null">company_delivery = #{companyDelivery},</if>
<if test="notifier != null">notifier = #{notifier},</if>
<if test="notifierEmail != null">notifier_email = #{notifierEmail},</if>
<if test="notifierPhone != null">notifier_phone = #{notifierPhone},</if>
<if test="notifierAddress != null">notifier_address = #{notifierAddress},</if>
<if test="duty != null">duty = #{duty},</if>
<if test="dutyEmail != null">duty_email = #{dutyEmail},</if>
<if test="dutyPhone != null">duty_phone = #{dutyPhone},</if>
<if test="orderChannel != null">order_channel = #{orderChannel},</if>
<if test="partnerCode != null">partner_code = #{partnerCode},</if>
<if test="partnerEmail != null">partner_email=#{partnerEmail},</if>
<if test="partnerUserName != null">partner_user_name=#{partnerUserName},</if>
<if test="partnerPhone != null">partner_phone=#{partnerPhone},</if>
<if test="supplier != null">supplier = #{supplier},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="orderStatus != null">order_status = #{orderStatus},</if>
<if test="outerStatus != null">outer_status = #{outerStatus},</if>
<if test="deliveryStatus != null">delivery_status = #{deliveryStatus},</if>
<if test="signStatus != null">sign_status = #{signStatus},</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>
</trim>
where order_code = #{orderCode}
</update>
<delete id="deleteProjectOrderInfoById" parameterType="Long">
delete from project_order_info where id = #{id}
</delete>
<delete id="deleteProjectOrderInfoByIds" parameterType="String">
delete from project_order_info where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>