|
@@ -993,4 +993,65 @@
|
|
|
</if>
|
|
</if>
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ <sql id="ConditionSalesTrackingReport">
|
|
|
|
|
+ <where>
|
|
|
|
|
+ <if test="cpId != null">
|
|
|
|
|
+ tpo.cp_id = #{cpId}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </where>
|
|
|
|
|
+ </sql>
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 销售跟踪表 列表查询 -->
|
|
|
|
|
+ <select id="getSalesTrackingReport" resultType="java.util.Map">
|
|
|
|
|
+ SELECT
|
|
|
|
|
+ tpo.order_id AS "orderId"
|
|
|
|
|
+ ,tpo.order_no AS "orderNo"
|
|
|
|
|
+ ,tpo.order_type AS "orderType"
|
|
|
|
|
+ ,sys.f_get_name_i18n(tdk1.kind_name_i18n, #{i18n}) AS "orderTypeName"
|
|
|
|
|
+ ,tpo.sum_quantity AS "sumQuantity"
|
|
|
|
|
+ ,tpo.sum_amount AS "sumAmount"
|
|
|
|
|
+ ,tpo.sum_standard AS "sumStandard"
|
|
|
|
|
+ ,tpo.sale_discount AS "saleDiscount"
|
|
|
|
|
+ ,tpo.order_status AS "orderStatus"
|
|
|
|
|
+ ,sys.f_get_name_i18n(tdk2.kind_name_i18n, #{i18n}) as "orderStatusName"
|
|
|
|
|
+ ,tpo.out_status AS "outStatus"
|
|
|
|
|
+ ,sys.f_get_name_i18n(tdk3.kind_name_i18n, #{i18n}) as "outStatusName"
|
|
|
|
|
+ ,tpo.outing_qty AS "outingQty"
|
|
|
|
|
+ ,tpo.outing_amt AS "outingAmt"
|
|
|
|
|
+ ,tpo.out_qty AS "outQty"
|
|
|
|
|
+ ,tpo.out_amt AS "outAmt"
|
|
|
|
|
+ ,tpo.return_qty AS "returnQty"
|
|
|
|
|
+ ,tpo.return_amt AS "returnAmt"
|
|
|
|
|
+ ,tpo.amt_receivable AS "amtReceivable"
|
|
|
|
|
+ ,tpo.amt_handle AS "amtHandle"
|
|
|
|
|
+ ,tpo.amt_residue AS "amtResidue"
|
|
|
|
|
+ ,tpo.make_time AS "makeTime"
|
|
|
|
|
+ ,tmc.cus_code AS "cusCode"
|
|
|
|
|
+ ,tmc.cus_name As "cusName"
|
|
|
|
|
+ ,tmc.cus_phone As "cusPhone"
|
|
|
|
|
+ FROM
|
|
|
|
|
+ dkic_b.t_psi_order tpo
|
|
|
|
|
+ left join dkic_b.t_mst_customer tmc on tpo.cus_id = tmc.cus_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
|
|
|
|
|
+ <include refid="ConditionSalesTrackingReport"/>
|
|
|
|
|
+ order by tpo.op_create_time desc
|
|
|
|
|
+ <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
|
|
|
|
|
+ limit #{end} offset #{start}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </select>
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ <select id="getSalesTrackingReportCount" resultType="java.lang.Long">
|
|
|
|
|
+ SELECT count(1)
|
|
|
|
|
+ FROM
|
|
|
|
|
+ dkic_b.t_psi_order tpo
|
|
|
|
|
+ <include refid="ConditionSalesTrackingReport"/>
|
|
|
|
|
+ </select>
|
|
|
|
|
+
|
|
|
</mapper>
|
|
</mapper>
|