|
|
@@ -106,126 +106,126 @@
|
|
|
<sql id="Condition">
|
|
|
<where>
|
|
|
<if test="orderNo != null and orderNo != ''">
|
|
|
- AND tpo.order_no = #{orderNo}
|
|
|
+ AND t.order_no = #{orderNo}
|
|
|
</if>
|
|
|
<if test="orderType != null and orderType != ''">
|
|
|
- AND tpo.order_type = #{orderType}
|
|
|
+ AND t.order_type = #{orderType}
|
|
|
</if>
|
|
|
<if test="orgId != null and orgId != ''">
|
|
|
- AND tpo.org_id = #{orgId}
|
|
|
+ AND t.org_id = #{orgId}
|
|
|
</if>
|
|
|
<if test="staffId != null and staffId != ''">
|
|
|
- AND tpo.staff_id = #{staffId}
|
|
|
+ AND t.staff_id = #{staffId}
|
|
|
</if>
|
|
|
<if test="cusId != null and cusId != ''">
|
|
|
- AND tpo.cus_id = #{cusId}
|
|
|
+ AND t.cus_id = #{cusId}
|
|
|
</if>
|
|
|
<if test="addressArea != null and addressArea != ''">
|
|
|
- AND tpo.address_area = #{addressArea}
|
|
|
+ AND t.address_area = #{addressArea}
|
|
|
</if>
|
|
|
<if test="addressName != null and addressName != ''">
|
|
|
- AND tpo.address_name = #{addressName}
|
|
|
+ AND t.address_name = #{addressName}
|
|
|
</if>
|
|
|
<if test="addressNo != null and addressNo != ''">
|
|
|
- AND tpo.address_no = #{addressNo}
|
|
|
+ AND t.address_no = #{addressNo}
|
|
|
</if>
|
|
|
<if test="addressGcj02 != null and addressGcj02 != ''">
|
|
|
- AND tpo.address_gcj02 = #{addressGcj02}
|
|
|
+ AND t.address_gcj02 = #{addressGcj02}
|
|
|
</if>
|
|
|
<if test="addressFull != null and addressFull != ''">
|
|
|
- AND tpo.address_full = #{addressFull}
|
|
|
+ AND t.address_full = #{addressFull}
|
|
|
</if>
|
|
|
<if test="contactName != null and contactName != ''">
|
|
|
- AND tpo.contact_name = #{contactName}
|
|
|
+ AND t.contact_name = #{contactName}
|
|
|
</if>
|
|
|
<if test="contactPhone != null and contactPhone != ''">
|
|
|
- AND tpo.contact_phone = #{contactPhone}
|
|
|
+ AND t.contact_phone = #{contactPhone}
|
|
|
</if>
|
|
|
<if test="salesChannel != null and salesChannel != ''">
|
|
|
- AND tpo.sales_channel = #{salesChannel}
|
|
|
+ AND t.sales_channel = #{salesChannel}
|
|
|
</if>
|
|
|
<if test="deliveryDate != null">
|
|
|
- AND tpo.delivery_date = #{deliveryDate}
|
|
|
+ AND t.delivery_date = #{deliveryDate}
|
|
|
</if>
|
|
|
<if test="sumQuantity != null">
|
|
|
- AND tpo.sum_quantity = #{sumQuantity}
|
|
|
+ AND t.sum_quantity = #{sumQuantity}
|
|
|
</if>
|
|
|
<if test="sumStandard != null">
|
|
|
- AND tpo.sum_standard = #{sumStandard}
|
|
|
+ AND t.sum_standard = #{sumStandard}
|
|
|
</if>
|
|
|
<if test="sumAmount != null">
|
|
|
- AND tpo.sum_amount = #{sumAmount}
|
|
|
+ AND t.sum_amount = #{sumAmount}
|
|
|
</if>
|
|
|
<if test="saleDiscount != null">
|
|
|
- AND tpo.sale_discount = #{saleDiscount}
|
|
|
+ AND t.sale_discount = #{saleDiscount}
|
|
|
</if>
|
|
|
<if test="orderStatus != null and orderStatus != ''">
|
|
|
- AND tpo.order_status = #{orderStatus}
|
|
|
+ AND t.order_status = #{orderStatus}
|
|
|
</if>
|
|
|
<if test="outStatus != null and outStatus != ''">
|
|
|
- AND tpo.out_status = #{outStatus}
|
|
|
+ AND t.out_status = #{outStatus}
|
|
|
</if>
|
|
|
<if test="outingQty != null">
|
|
|
- AND tpo.outing_qty = #{outingQty}
|
|
|
+ AND t.outing_qty = #{outingQty}
|
|
|
</if>
|
|
|
<if test="outingAmt != null">
|
|
|
- AND tpo.outing_amt = #{outingAmt}
|
|
|
+ AND t.outing_amt = #{outingAmt}
|
|
|
</if>
|
|
|
<if test="outQty != null">
|
|
|
- AND tpo.out_qty = #{outQty}
|
|
|
+ AND t.out_qty = #{outQty}
|
|
|
</if>
|
|
|
<if test="outAmt != null">
|
|
|
- AND tpo.out_amt = #{outAmt}
|
|
|
+ AND t.out_amt = #{outAmt}
|
|
|
</if>
|
|
|
<if test="returnQty != null">
|
|
|
- AND tpo.return_qty = #{returnQty}
|
|
|
+ AND t.return_qty = #{returnQty}
|
|
|
</if>
|
|
|
<if test="returnAmt != null">
|
|
|
- AND tpo.return_amt = #{returnAmt}
|
|
|
+ AND t.return_amt = #{returnAmt}
|
|
|
</if>
|
|
|
<if test="amtReceivable != null">
|
|
|
- AND tpo.amt_receivable = #{amtReceivable}
|
|
|
+ AND t.amt_receivable = #{amtReceivable}
|
|
|
</if>
|
|
|
<if test="amtHandle != null">
|
|
|
- AND tpo.amt_handle = #{amtHandle}
|
|
|
+ AND t.amt_handle = #{amtHandle}
|
|
|
</if>
|
|
|
<if test="amtResidue != null">
|
|
|
- AND tpo.amt_residue = #{amtResidue}
|
|
|
+ AND t.amt_residue = #{amtResidue}
|
|
|
</if>
|
|
|
<if test="remarks != null and remarks != ''">
|
|
|
- AND tpo.remarks = #{remarks}
|
|
|
+ AND t.remarks = #{remarks}
|
|
|
</if>
|
|
|
<if test="annexPaths != null and annexPaths != ''">
|
|
|
- AND tpo.annex_paths = #{annexPaths}
|
|
|
+ AND t.annex_paths = #{annexPaths}
|
|
|
</if>
|
|
|
<if test="makeStaff != null and makeStaff != ''">
|
|
|
- AND tpo.make_staff = #{makeStaff}
|
|
|
+ AND t.make_staff = #{makeStaff}
|
|
|
</if>
|
|
|
<if test="makeTime != null">
|
|
|
- AND tpo.make_time = #{makeTime}
|
|
|
+ AND t.make_time = #{makeTime}
|
|
|
</if>
|
|
|
<if test="flgValid != null">
|
|
|
- AND tpo.flg_valid = #{flgValid}
|
|
|
+ AND t.flg_valid = #{flgValid}
|
|
|
</if>
|
|
|
<if test="cpId != null">
|
|
|
- AND tpo.cp_id = #{cpId}
|
|
|
+ AND t.cp_id = #{cpId}
|
|
|
</if>
|
|
|
<if test="orgIdList != null and orgIdList.size() > 0">
|
|
|
- AND tpo.org_id =any(#{orgIdList, typeHandler=uuidListTypeHandler})
|
|
|
+ AND t.org_id =any(#{orgIdList, typeHandler=uuidListTypeHandler})
|
|
|
</if>
|
|
|
<if test="staffIdList != null and staffIdList.size() > 0">
|
|
|
- AND tpo.staff_id =any(#{staffIdList, typeHandler=uuidListTypeHandler})
|
|
|
+ AND t.staff_id =any(#{staffIdList, typeHandler=uuidListTypeHandler})
|
|
|
</if>
|
|
|
<if test="outStatusList != null and outStatusList.size() > 0">
|
|
|
- AND tpo.out_status =any(#{outStatusList, typeHandler=StringListTypeHandler})
|
|
|
+ AND t.out_status =any(#{outStatusList, typeHandler=StringListTypeHandler})
|
|
|
</if>
|
|
|
<if test="makeTimeStart != null and makeTimeEnd != null">
|
|
|
- AND tpo.make_time >= #{makeTimeStart}::timestamp with time zone
|
|
|
- AND tpo.make_time < #{makeTimeEnd}::timestamp with time zone + interval '1 day'
|
|
|
+ AND t.make_time >= #{makeTimeStart}::timestamp with time zone
|
|
|
+ AND t.make_time < #{makeTimeEnd}::timestamp with time zone + interval '1 day'
|
|
|
</if>
|
|
|
<if test="deliveryDateStart != null and deliveryDateEnd != null">
|
|
|
- AND tpo.delivery_date >= #{deliveryDateStart}::timestamp with time zone
|
|
|
- AND tpo.delivery_date < #{deliveryDateEnd}::timestamp with time zone + interval '1 day'
|
|
|
+ AND t.delivery_date >= #{deliveryDateStart}::timestamp with time zone
|
|
|
+ AND t.delivery_date < #{deliveryDateEnd}::timestamp with time zone + interval '1 day'
|
|
|
</if>
|
|
|
</where>
|
|
|
</sql>
|
|
|
@@ -240,64 +240,64 @@
|
|
|
|
|
|
<!-- 查询表t_psi_order,(条件查询+分页)列表 -->
|
|
|
<select id="selectByCond" resultMap="BaseResultMapResponse">
|
|
|
- SELECT tpo.order_id,
|
|
|
- tpo.order_no,
|
|
|
- tpo.order_type,
|
|
|
+ SELECT t.order_id,
|
|
|
+ t.order_no,
|
|
|
+ t.order_type,
|
|
|
sys.f_get_name_i18n(tdk1.kind_name_i18n, 'zh_CN') as "orderTypeName",
|
|
|
- tpo.org_id,
|
|
|
+ t.org_id,
|
|
|
tmo.org_name as "orgName",
|
|
|
- tpo.staff_id,
|
|
|
+ t.staff_id,
|
|
|
tms.staff_name as "staffName",
|
|
|
- tpo.cus_id,
|
|
|
+ t.cus_id,
|
|
|
tmc.cus_code as "cusCode",
|
|
|
tmc.cus_name as "cusName",
|
|
|
tmc.cus_phone as "cusPhone",
|
|
|
tmc.cus_from as "cusFrom",
|
|
|
tmdd.data_value as "cusFromName",
|
|
|
- tpo.address_area,
|
|
|
- tpo.address_name,
|
|
|
- tpo.address_no,
|
|
|
- tpo.address_gcj02,
|
|
|
- tpo.address_full,
|
|
|
- tpo.contact_name,
|
|
|
- tpo.contact_phone,
|
|
|
- tpo.sales_channel,
|
|
|
+ t.address_area,
|
|
|
+ t.address_name,
|
|
|
+ t.address_no,
|
|
|
+ t.address_gcj02,
|
|
|
+ t.address_full,
|
|
|
+ t.contact_name,
|
|
|
+ t.contact_phone,
|
|
|
+ t.sales_channel,
|
|
|
tmsc.channel_name as "channelName",
|
|
|
- tpo.delivery_date,
|
|
|
- tpo.sum_quantity,
|
|
|
- tpo.sum_standard,
|
|
|
- tpo.sum_amount,
|
|
|
- tpo.sale_discount,
|
|
|
- tpo.order_status,
|
|
|
+ t.delivery_date,
|
|
|
+ t.sum_quantity,
|
|
|
+ t.sum_standard,
|
|
|
+ t.sum_amount,
|
|
|
+ t.sale_discount,
|
|
|
+ t.order_status,
|
|
|
sys.f_get_name_i18n(tdk2.kind_name_i18n, 'zh_CN') as "orderStatusName",
|
|
|
- tpo.out_status,
|
|
|
+ t.out_status,
|
|
|
sys.f_get_name_i18n(tdk3.kind_name_i18n, 'zh_CN') as "outStatusName",
|
|
|
- tpo.outing_qty,
|
|
|
- tpo.outing_amt,
|
|
|
- tpo.out_qty,
|
|
|
- tpo.out_amt,
|
|
|
- tpo.return_qty,
|
|
|
- tpo.return_amt,
|
|
|
- tpo.amt_receivable,
|
|
|
- tpo.amt_handle,
|
|
|
- tpo.amt_residue,
|
|
|
- tpo.remarks,
|
|
|
- tpo.annex_paths,
|
|
|
+ t.outing_qty,
|
|
|
+ t.outing_amt,
|
|
|
+ t.out_qty,
|
|
|
+ t.out_amt,
|
|
|
+ t.return_qty,
|
|
|
+ t.return_amt,
|
|
|
+ t.amt_receivable,
|
|
|
+ t.amt_handle,
|
|
|
+ t.amt_residue,
|
|
|
+ t.remarks,
|
|
|
+ t.annex_paths,
|
|
|
makestaff.staff_name as "makeStaffName",
|
|
|
- tpo.make_time,
|
|
|
- tpo.cp_id
|
|
|
- FROM dkic_b.t_psi_order as tpo
|
|
|
- left join dkic_b.t_mst_sale_channel tmsc on tpo.sales_channel = tmsc.channel_id
|
|
|
- left join dkic_b.t_mst_org tmo on tpo.org_id = tmo.org_id
|
|
|
- left join dkic_b.t_mst_staff tms on tpo.staff_id = tms.staff_id
|
|
|
- left join dkic_b.t_mst_staff as makestaff on tpo.make_staff = makestaff.staff_id
|
|
|
- left join dkic_b.t_mst_customer tmc on tpo.cus_id = tmc.cus_id
|
|
|
+ t.make_time,
|
|
|
+ t.cp_id
|
|
|
+ FROM dkic_b.t_psi_order as t
|
|
|
+ left join dkic_b.t_mst_sale_channel tmsc on t.sales_channel = tmsc.channel_id
|
|
|
+ left join dkic_b.t_mst_org tmo on t.org_id = tmo.org_id
|
|
|
+ left join dkic_b.t_mst_staff tms on t.staff_id = tms.staff_id
|
|
|
+ left join dkic_b.t_mst_staff as makestaff on t.make_staff = makestaff.staff_id
|
|
|
+ left join dkic_b.t_mst_customer tmc on t.cus_id = tmc.cus_id
|
|
|
left join dkic_b.t_mst_dictionary_data tmdd on tmc.cus_from = tmdd.data_id
|
|
|
- left join sys.t_data_kind as tdk1 on tpo.order_type = tdk1.kind_code
|
|
|
- left join sys.t_data_kind as tdk2 on tpo.order_status = tdk2.kind_code
|
|
|
- left join sys.t_data_kind as tdk3 on tpo.out_status = tdk3.kind_code
|
|
|
+ left join sys.t_data_kind as tdk1 on t.order_type = tdk1.kind_code
|
|
|
+ left join sys.t_data_kind as tdk2 on t.order_status = tdk2.kind_code
|
|
|
+ left join sys.t_data_kind as tdk3 on t.out_status = tdk3.kind_code
|
|
|
<include refid="Condition"/>
|
|
|
- order by tpo.op_create_time desc
|
|
|
+ order by t.op_create_time desc
|
|
|
<if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
|
|
|
limit #{end} offset #{start}
|
|
|
</if>
|
|
|
@@ -307,69 +307,69 @@
|
|
|
<select id="countByCond" resultType="Long">
|
|
|
SELECT
|
|
|
count(1)
|
|
|
- FROM dkic_b.t_psi_order as tpo
|
|
|
+ FROM dkic_b.t_psi_order as t
|
|
|
<include refid="Condition"/>
|
|
|
</select>
|
|
|
|
|
|
<!-- 根据主键查询表t_psi_order的一行数据 -->
|
|
|
<select id="selectById" resultMap="BaseResultMapResponse">
|
|
|
- SELECT tpo.order_id,
|
|
|
- tpo.order_no,
|
|
|
- tpo.order_type,
|
|
|
+ SELECT t.order_id,
|
|
|
+ t.order_no,
|
|
|
+ t.order_type,
|
|
|
sys.f_get_name_i18n(tdk1.kind_name_i18n, 'zh_CN') as "orderTypeName",
|
|
|
- tpo.org_id,
|
|
|
+ t.org_id,
|
|
|
tmo.org_name as "orgName",
|
|
|
- tpo.staff_id,
|
|
|
+ t.staff_id,
|
|
|
tms.staff_name as "staffName",
|
|
|
- tpo.cus_id,
|
|
|
+ t.cus_id,
|
|
|
tmc.cus_code as "cusCode",
|
|
|
tmc.cus_name as "cusName",
|
|
|
tmc.cus_phone as "cusPhone",
|
|
|
tmc.cus_from as "cusFrom",
|
|
|
tmdd.data_value as "cusFromName",
|
|
|
- tpo.address_area,
|
|
|
- tpo.address_name,
|
|
|
- tpo.address_no,
|
|
|
- tpo.address_gcj02,
|
|
|
- tpo.address_full,
|
|
|
- tpo.contact_name,
|
|
|
- tpo.contact_phone,
|
|
|
- tpo.sales_channel,
|
|
|
+ t.address_area,
|
|
|
+ t.address_name,
|
|
|
+ t.address_no,
|
|
|
+ t.address_gcj02,
|
|
|
+ t.address_full,
|
|
|
+ t.contact_name,
|
|
|
+ t.contact_phone,
|
|
|
+ t.sales_channel,
|
|
|
tmsc.channel_name as "channelName",
|
|
|
- tpo.delivery_date,
|
|
|
- tpo.sum_quantity,
|
|
|
- tpo.sum_standard,
|
|
|
- tpo.sum_amount,
|
|
|
- tpo.sale_discount,
|
|
|
- tpo.order_status,
|
|
|
+ t.delivery_date,
|
|
|
+ t.sum_quantity,
|
|
|
+ t.sum_standard,
|
|
|
+ t.sum_amount,
|
|
|
+ t.sale_discount,
|
|
|
+ t.order_status,
|
|
|
sys.f_get_name_i18n(tdk2.kind_name_i18n, 'zh_CN') as "orderStatusName",
|
|
|
- tpo.out_status,
|
|
|
+ t.out_status,
|
|
|
sys.f_get_name_i18n(tdk3.kind_name_i18n, 'zh_CN') as "outStatusName",
|
|
|
- tpo.outing_qty,
|
|
|
- tpo.outing_amt,
|
|
|
- tpo.out_qty,
|
|
|
- tpo.out_amt,
|
|
|
- tpo.return_qty,
|
|
|
- tpo.return_amt,
|
|
|
- tpo.amt_receivable,
|
|
|
- tpo.amt_handle,
|
|
|
- tpo.amt_residue,
|
|
|
- tpo.remarks,
|
|
|
- tpo.annex_paths,
|
|
|
+ t.outing_qty,
|
|
|
+ t.outing_amt,
|
|
|
+ t.out_qty,
|
|
|
+ t.out_amt,
|
|
|
+ t.return_qty,
|
|
|
+ t.return_amt,
|
|
|
+ t.amt_receivable,
|
|
|
+ t.amt_handle,
|
|
|
+ t.amt_residue,
|
|
|
+ t.remarks,
|
|
|
+ t.annex_paths,
|
|
|
makestaff.staff_name as "makeStaffName",
|
|
|
- tpo.make_time,
|
|
|
- tpo.cp_id
|
|
|
- FROM dkic_b.t_psi_order as tpo
|
|
|
- left join dkic_b.t_mst_sale_channel tmsc on tpo.sales_channel = tmsc.channel_id
|
|
|
- left join dkic_b.t_mst_org tmo on tpo.org_id = tmo.org_id
|
|
|
- left join dkic_b.t_mst_staff tms on tpo.staff_id = tms.staff_id
|
|
|
- left join dkic_b.t_mst_staff as makestaff on tpo.make_staff = makestaff.staff_id
|
|
|
- left join dkic_b.t_mst_customer tmc on tpo.cus_id = tmc.cus_id
|
|
|
+ t.make_time,
|
|
|
+ t.cp_id
|
|
|
+ FROM dkic_b.t_psi_order as t
|
|
|
+ left join dkic_b.t_mst_sale_channel tmsc on t.sales_channel = tmsc.channel_id
|
|
|
+ left join dkic_b.t_mst_org tmo on t.org_id = tmo.org_id
|
|
|
+ left join dkic_b.t_mst_staff tms on t.staff_id = tms.staff_id
|
|
|
+ left join dkic_b.t_mst_staff as makestaff on t.make_staff = makestaff.staff_id
|
|
|
+ left join dkic_b.t_mst_customer tmc on t.cus_id = tmc.cus_id
|
|
|
left join dkic_b.t_mst_dictionary_data tmdd on tmc.cus_from = tmdd.data_id
|
|
|
- left join sys.t_data_kind as tdk1 on tpo.order_type = tdk1.kind_code
|
|
|
- left join sys.t_data_kind as tdk2 on tpo.order_status = tdk2.kind_code
|
|
|
- left join sys.t_data_kind as tdk3 on tpo.out_status = tdk3.kind_code
|
|
|
- WHERE tpo.order_id = #{orderId}::uuid
|
|
|
+ left join sys.t_data_kind as tdk1 on t.order_type = tdk1.kind_code
|
|
|
+ left join sys.t_data_kind as tdk2 on t.order_status = tdk2.kind_code
|
|
|
+ left join sys.t_data_kind as tdk3 on t.out_status = tdk3.kind_code
|
|
|
+ WHERE t.order_id = #{orderId}::uuid
|
|
|
</select>
|
|
|
|
|
|
<!-- 根据主键锁定表t_psi_order的一行数据 -->
|