2025-05-30 08:27:52 +00:00
|
|
|
<?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="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" />
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
<sql id="selectProjectOrderInfoVo">
|
2025-06-04 03:25:20 +00:00
|
|
|
select id, project_id,province, city, business_person, business_email, business_phone, order_code, currencyType,
|
2025-05-30 08:27:52 +00:00
|
|
|
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,
|
|
|
|
|
remark, order_status, create_by, create_time, update_by, update_time from project_order_info t1
|
|
|
|
|
</sql>
|
|
|
|
|
<sql id="selectProjectOrderInfoRelationVo">
|
2025-06-04 03:25:20 +00:00
|
|
|
select t1.id, t1.project_id,t1.province, t1.city, t1.business_person, t1.business_email, t1.business_phone, t1.order_code, t1.currencyType,
|
2025-05-30 08:27:52 +00:00
|
|
|
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
|
|
|
|
|
,t2.project_code,t2.project_name,t2.province,t2.customer_name,t2.industry_type
|
|
|
|
|
,t3.partner_name,t3.level
|
|
|
|
|
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
|
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
<select id="selectProjectOrderInfoList" parameterType="ProjectOrderInfo" resultMap="ProjectOrderInfoResult">
|
|
|
|
|
<include refid="selectProjectOrderInfoRelationVo"/>
|
|
|
|
|
<where>
|
|
|
|
|
<if test="projectId != null "> and t1.project_id = #{projectId}</if>
|
2025-06-04 03:25:20 +00:00
|
|
|
<if test="province != null and province != ''"> and t1.province = #{province}</if>
|
2025-05-30 08:27:52 +00:00
|
|
|
<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="duty != null and duty != ''"> and t1.duty = #{duty}</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="supplier != null and supplier != ''"> and t1.supplier = #{supplier}</if>
|
|
|
|
|
<if test="orderStatus != null and orderStatus != ''"> and t1.order_status = #{orderStatus}</if>
|
|
|
|
|
</where>
|
|
|
|
|
</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="selectProjectOrderInfoVo"/>
|
|
|
|
|
where t1.project_id in (
|
|
|
|
|
<foreach item="item" collection="list" separator=",">
|
|
|
|
|
#{item}
|
|
|
|
|
</foreach>
|
|
|
|
|
)
|
2025-06-04 03:25:20 +00:00
|
|
|
</select>
|
|
|
|
|
<select id="selectMaxOrderCode" resultType="java.lang.Integer">
|
|
|
|
|
select ifnull( max(SUBSTR( order_code FROM 16 FOR 3 )), 0 )
|
|
|
|
|
from project_order_info
|
|
|
|
|
where order_code like concat(#{province}, '%')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-05-30 08:27:52 +00:00
|
|
|
</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>
|
2025-06-04 03:25:20 +00:00
|
|
|
<if test="province != null">province,</if>
|
2025-05-30 08:27:52 +00:00
|
|
|
<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="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="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="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>
|
|
|
|
|
</trim>
|
|
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="projectId != null">#{projectId},</if>
|
2025-06-04 03:25:20 +00:00
|
|
|
<if test="province != null">#{province},</if>
|
2025-05-30 08:27:52 +00:00
|
|
|
<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="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="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="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>
|
|
|
|
|
</trim>
|
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
|
|
<update id="updateProjectOrderInfo" parameterType="ProjectOrderInfo">
|
|
|
|
|
update project_order_info
|
|
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
|
|
<if test="projectId != null">project_id = #{projectId},</if>
|
2025-06-04 03:25:20 +00:00
|
|
|
<if test="province != null">province = #{province},</if>
|
2025-05-30 08:27:52 +00:00
|
|
|
<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="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="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="supplier != null">supplier = #{supplier},</if>
|
|
|
|
|
<if test="remark != null">remark = #{remark},</if>
|
|
|
|
|
<if test="orderStatus != null">order_status = #{orderStatus},</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 id = #{id}
|
|
|
|
|
</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>
|