|
@@ -9,7 +9,7 @@
|
|
|
</sql>
|
|
</sql>
|
|
|
|
|
|
|
|
<!-- 通用查询映射结果 -->
|
|
<!-- 通用查询映射结果 -->
|
|
|
- <resultMap id="BaseResultMap" type="com.dk.mdm.model.pojo.sale.Order">
|
|
|
|
|
|
|
+ <resultMap id="BaseResultMap" type="com.dk.mdm.model.response.sale.OrderResponse">
|
|
|
<id column="order_id" property="orderId"/>
|
|
<id column="order_id" property="orderId"/>
|
|
|
<result column="order_no" property="orderNo"/>
|
|
<result column="order_no" property="orderNo"/>
|
|
|
<result column="order_type" property="orderType"/>
|
|
<result column="order_type" property="orderType"/>
|
|
@@ -59,130 +59,109 @@
|
|
|
<sql id="Condition">
|
|
<sql id="Condition">
|
|
|
<where>
|
|
<where>
|
|
|
<if test="orderNo != null and orderNo != ''">
|
|
<if test="orderNo != null and orderNo != ''">
|
|
|
- AND order_no = #{orderNo}
|
|
|
|
|
|
|
+ AND tpo.order_no = #{orderNo}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="orderType != null and orderType != ''">
|
|
<if test="orderType != null and orderType != ''">
|
|
|
- AND order_type = #{orderType}
|
|
|
|
|
|
|
+ AND tpo.order_type = #{orderType}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="orgId != null and orgId != ''">
|
|
<if test="orgId != null and orgId != ''">
|
|
|
- AND org_id = #{orgId}
|
|
|
|
|
|
|
+ AND tpo.org_id = #{orgId}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="staffId != null and staffId != ''">
|
|
<if test="staffId != null and staffId != ''">
|
|
|
- AND staff_id = #{staffId}
|
|
|
|
|
|
|
+ AND tpo.staff_id = #{staffId}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="cusId != null and cusId != ''">
|
|
<if test="cusId != null and cusId != ''">
|
|
|
- AND cus_id = #{cusId}
|
|
|
|
|
|
|
+ AND tpo.cus_id = #{cusId}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="addressArea != null and addressArea != ''">
|
|
<if test="addressArea != null and addressArea != ''">
|
|
|
- AND address_area = #{addressArea}
|
|
|
|
|
|
|
+ AND tpo.address_area = #{addressArea}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="addressName != null and addressName != ''">
|
|
<if test="addressName != null and addressName != ''">
|
|
|
- AND address_name = #{addressName}
|
|
|
|
|
|
|
+ AND tpo.address_name = #{addressName}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="addressNo != null and addressNo != ''">
|
|
<if test="addressNo != null and addressNo != ''">
|
|
|
- AND address_no = #{addressNo}
|
|
|
|
|
|
|
+ AND tpo.address_no = #{addressNo}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="addressGcj02 != null and addressGcj02 != ''">
|
|
<if test="addressGcj02 != null and addressGcj02 != ''">
|
|
|
- AND address_gcj02 = #{addressGcj02}
|
|
|
|
|
|
|
+ AND tpo.address_gcj02 = #{addressGcj02}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="addressFull != null and addressFull != ''">
|
|
<if test="addressFull != null and addressFull != ''">
|
|
|
- AND address_full = #{addressFull}
|
|
|
|
|
|
|
+ AND tpo.address_full = #{addressFull}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="contactName != null and contactName != ''">
|
|
<if test="contactName != null and contactName != ''">
|
|
|
- AND contact_name = #{contactName}
|
|
|
|
|
|
|
+ AND tpo.contact_name = #{contactName}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="contactPhone != null and contactPhone != ''">
|
|
<if test="contactPhone != null and contactPhone != ''">
|
|
|
- AND contact_phone = #{contactPhone}
|
|
|
|
|
|
|
+ AND tpo.contact_phone = #{contactPhone}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="salesChannel != null and salesChannel != ''">
|
|
<if test="salesChannel != null and salesChannel != ''">
|
|
|
- AND sales_channel = #{salesChannel}
|
|
|
|
|
|
|
+ AND tpo.sales_channel = #{salesChannel}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="deliveryDate != null">
|
|
<if test="deliveryDate != null">
|
|
|
- AND delivery_date = #{deliveryDate}
|
|
|
|
|
|
|
+ AND tpo.delivery_date = #{deliveryDate}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="sumQuantity != null">
|
|
<if test="sumQuantity != null">
|
|
|
- AND sum_quantity = #{sumQuantity}
|
|
|
|
|
|
|
+ AND tpo.sum_quantity = #{sumQuantity}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="sumStandard != null">
|
|
<if test="sumStandard != null">
|
|
|
- AND sum_standard = #{sumStandard}
|
|
|
|
|
|
|
+ AND tpo.sum_standard = #{sumStandard}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="sumAmount != null">
|
|
<if test="sumAmount != null">
|
|
|
- AND sum_amount = #{sumAmount}
|
|
|
|
|
|
|
+ AND tpo.sum_amount = #{sumAmount}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="saleDiscount != null">
|
|
<if test="saleDiscount != null">
|
|
|
- AND sale_discount = #{saleDiscount}
|
|
|
|
|
|
|
+ AND tpo.sale_discount = #{saleDiscount}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="orderStatus != null and orderStatus != ''">
|
|
<if test="orderStatus != null and orderStatus != ''">
|
|
|
- AND order_status = #{orderStatus}
|
|
|
|
|
|
|
+ AND tpo.order_status = #{orderStatus}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="outStatus != null and outStatus != ''">
|
|
<if test="outStatus != null and outStatus != ''">
|
|
|
- AND out_status = #{outStatus}
|
|
|
|
|
|
|
+ AND tpo.out_status = #{outStatus}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="outingQty != null">
|
|
<if test="outingQty != null">
|
|
|
- AND outing_qty = #{outingQty}
|
|
|
|
|
|
|
+ AND tpo.outing_qty = #{outingQty}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="outingAmt != null">
|
|
<if test="outingAmt != null">
|
|
|
- AND outing_amt = #{outingAmt}
|
|
|
|
|
|
|
+ AND tpo.outing_amt = #{outingAmt}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="outQty != null">
|
|
<if test="outQty != null">
|
|
|
- AND out_qty = #{outQty}
|
|
|
|
|
|
|
+ AND tpo.out_qty = #{outQty}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="outAmt != null">
|
|
<if test="outAmt != null">
|
|
|
- AND out_amt = #{outAmt}
|
|
|
|
|
|
|
+ AND tpo.out_amt = #{outAmt}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="returnQty != null">
|
|
<if test="returnQty != null">
|
|
|
- AND return_qty = #{returnQty}
|
|
|
|
|
|
|
+ AND tpo.return_qty = #{returnQty}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="returnAmt != null">
|
|
<if test="returnAmt != null">
|
|
|
- AND return_amt = #{returnAmt}
|
|
|
|
|
|
|
+ AND tpo.return_amt = #{returnAmt}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="amtReceivable != null">
|
|
<if test="amtReceivable != null">
|
|
|
- AND amt_receivable = #{amtReceivable}
|
|
|
|
|
|
|
+ AND tpo.amt_receivable = #{amtReceivable}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="amtHandle != null">
|
|
<if test="amtHandle != null">
|
|
|
- AND amt_handle = #{amtHandle}
|
|
|
|
|
|
|
+ AND tpo.amt_handle = #{amtHandle}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="amtResidue != null">
|
|
<if test="amtResidue != null">
|
|
|
- AND amt_residue = #{amtResidue}
|
|
|
|
|
|
|
+ AND tpo.amt_residue = #{amtResidue}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="remarks != null and remarks != ''">
|
|
<if test="remarks != null and remarks != ''">
|
|
|
- AND remarks = #{remarks}
|
|
|
|
|
|
|
+ AND tpo.remarks = #{remarks}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="annexPaths != null and annexPaths != ''">
|
|
<if test="annexPaths != null and annexPaths != ''">
|
|
|
- AND annex_paths = #{annexPaths}
|
|
|
|
|
|
|
+ AND tpo.annex_paths = #{annexPaths}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="makeStaff != null and makeStaff != ''">
|
|
<if test="makeStaff != null and makeStaff != ''">
|
|
|
- AND make_staff = #{makeStaff}
|
|
|
|
|
|
|
+ AND tpo.make_staff = #{makeStaff}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="makeTime != null">
|
|
<if test="makeTime != null">
|
|
|
- AND make_time = #{makeTime}
|
|
|
|
|
|
|
+ AND tpo.make_time = #{makeTime}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="flgValid != null">
|
|
<if test="flgValid != null">
|
|
|
- AND flg_valid = #{flgValid}
|
|
|
|
|
|
|
+ AND tpo.flg_valid = #{flgValid}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="cpId != null">
|
|
<if test="cpId != null">
|
|
|
- AND cp_id = #{cpId}
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="opCreateTime != null">
|
|
|
|
|
- AND op_create_time = #{opCreateTime}
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="opCreateUserId != null and opCreateUserId != ''">
|
|
|
|
|
- AND op_create_user_id = #{opCreateUserId}
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="opUpdateTime != null">
|
|
|
|
|
- AND op_update_time = #{opUpdateTime}
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="opUpdateUserId != null and opUpdateUserId != ''">
|
|
|
|
|
- AND op_update_user_id = #{opUpdateUserId}
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="opAppCode != null and opAppCode != ''">
|
|
|
|
|
- AND op_app_code = #{opAppCode}
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="opTimestamp != null">
|
|
|
|
|
- AND op_timestamp = #{opTimestamp}
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="opDbUser != null and opDbUser != ''">
|
|
|
|
|
- AND op_db_user = #{opDbUser}
|
|
|
|
|
|
|
+ AND tpo.cp_id = #{cpId}
|
|
|
</if>
|
|
</if>
|
|
|
</where>
|
|
</where>
|
|
|
</sql>
|
|
</sql>
|
|
@@ -197,9 +176,54 @@
|
|
|
|
|
|
|
|
<!-- 查询表t_psi_order,(条件查询+分页)列表 -->
|
|
<!-- 查询表t_psi_order,(条件查询+分页)列表 -->
|
|
|
<select id="selectByCond" resultMap="BaseResultMap">
|
|
<select id="selectByCond" resultMap="BaseResultMap">
|
|
|
- SELECT
|
|
|
|
|
- <include refid="Base_Column_List"/>
|
|
|
|
|
- FROM t_psi_order
|
|
|
|
|
|
|
+ SELECT tpo.order_id,
|
|
|
|
|
+ tpo.order_no,
|
|
|
|
|
+ tpo.order_type,
|
|
|
|
|
+ tpo.org_id,
|
|
|
|
|
+ tmo.org_name as "orgName",
|
|
|
|
|
+ tpo.staff_id,
|
|
|
|
|
+ tms.staff_name as "staffName",
|
|
|
|
|
+ tpo.cus_id,
|
|
|
|
|
+ tmc.cus_code as "cusCode",
|
|
|
|
|
+ tmc.cus_name as "cusName",
|
|
|
|
|
+ tmc.cus_phone as "cusPhone",
|
|
|
|
|
+ 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,
|
|
|
|
|
+ tmsc.channel_name as "channelName",
|
|
|
|
|
+ tpo.delivery_date,
|
|
|
|
|
+ tpo.sum_quantity,
|
|
|
|
|
+ tpo.sum_standard,
|
|
|
|
|
+ tpo.sum_amount,
|
|
|
|
|
+ tpo.sale_discount,
|
|
|
|
|
+ tpo.order_status,
|
|
|
|
|
+ tpo.out_status,
|
|
|
|
|
+ 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,
|
|
|
|
|
+ makestaff.staff_name as "makeStaff",
|
|
|
|
|
+ tpo.make_time
|
|
|
|
|
+ FROM dkic_b.t_psi_order as tpo
|
|
|
|
|
+ inner join dkic_b.t_mst_sale_channel tmsc on tpo.sales_channel = tmsc.channel_id
|
|
|
|
|
+ inner join dkic_b.t_mst_org tmo on tpo.org_id = tmo.org_id
|
|
|
|
|
+ inner join dkic_b.t_mst_staff tms on tpo.staff_id = tms.staff_id
|
|
|
|
|
+ inner join dkic_b.t_mst_staff as makestaff on tpo.make_staff = makestaff.staff_id
|
|
|
|
|
+ inner join dkic_b.t_mst_customer tmc on tpo.cus_id = tmc.cus_id
|
|
|
|
|
+ left join dkic_b.t_mst_dictionary_data tmdd on tmc.cus_from = tmdd.data_id
|
|
|
<include refid="Condition"/>
|
|
<include refid="Condition"/>
|
|
|
<if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
|
|
<if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
|
|
|
limit #{end} offset #{start}
|
|
limit #{end} offset #{start}
|
|
@@ -210,7 +234,7 @@
|
|
|
<select id="countByCond" resultType="Long">
|
|
<select id="countByCond" resultType="Long">
|
|
|
SELECT
|
|
SELECT
|
|
|
count(1)
|
|
count(1)
|
|
|
- FROM t_psi_order
|
|
|
|
|
|
|
+ FROM dkic_b.t_psi_order as tpo
|
|
|
<include refid="Condition"/>
|
|
<include refid="Condition"/>
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|