Просмотр исходного кода

只查询总单, 不包含总单加明细

姜永辉 2 лет назад
Родитель
Сommit
de0282d9a2

+ 19 - 9
src/main/java/com/dk/mdm/mapper/mac/AccountMapper.xml

@@ -5,7 +5,10 @@
     <!-- 通用设置 -->
     <!-- 通用查询列 -->
     <sql id="Base_Column_List">
-        object_id, object_type, receipt, receipt_lock, contract_assets, receivable, receivable_handle, receivable_waive, receivable_residue, receipt_residue, payment, pur_estimate, payable, payable_handle, payable_waive, payable_residue, payment_residue, remarks, flg_valid, cp_id
+        ac.object_id, ac.object_type, ac.receipt, ac.receipt_lock, ac.contract_assets, ac.receivable,
+        ac.receivable_handle, ac.receivable_waive, ac.receivable_residue, ac.receipt_residue, ac.payment,
+        ac.pur_estimate, ac.payable, ac.payable_handle, ac.payable_waive, ac.payable_residue,
+        ac.payment_residue, ac.remarks, ac.flg_valid, ac.cp_id
     </sql>
 
     <!-- 通用查询映射结果 -->
@@ -121,7 +124,7 @@
 
     <sql id="idsForeach">
         <!-- 根据主键objectId批量操作 -->
-        WHERE object_id in
+        WHERE  ac.object_id in
         <foreach collection="ids" index="index" item="item" separator="," open="(" close=")">
             #{item}
         </foreach>
@@ -131,7 +134,7 @@
     <select id="selectByCond" resultMap="BaseResultMap">
         SELECT
         <include refid="Base_Column_List"/>
-        FROM dkic_b.t_mac_account
+        FROM dkic_b.t_mac_account  ac
         <include refid="Condition"/>
         <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
             limit #{end} offset #{start}
@@ -142,7 +145,7 @@
     <select id="countByCond" resultType="Long">
         SELECT
         count(1)
-        FROM dkic_b.t_mac_account
+        FROM dkic_b.t_mac_account ac
         <include refid="Condition"/>
     </select>
 
@@ -150,16 +153,23 @@
     <select id="selectById" resultMap="BaseResultMapResponse">
         SELECT
         <include refid="Base_Column_List"/>
-        FROM dkic_b.t_mac_account
-        WHERE object_id = #{objectId}::uuid
+        ,sys.f_get_name_i18n(tdk.kind_name_i18n, #{i18n}) AS  "objectTypeName"
+        ,tmp.sup_name                              AS "supplierName"
+        ,tmc.cus_name                                      as "cusName"
+        ,tmc.cus_phone                                     as "cusPhone"
+        FROM dkic_b.t_mac_account ac
+        LEFT JOIN sys.t_data_kind tdk   ON tdk.kind_code = ac.object_type
+        Left join dkic_b.t_mst_supplier tmp on tmp.sup_id = ac.object_id
+        left join dkic_b.t_mst_customer tmc on ac.object_id = tmc.cus_id
+        WHERE ac.object_id = #{objectId}::uuid
     </select>
 
     <!-- 根据主键锁定表t_mac_account的一行数据 -->
     <select id="selectByIdForUpdate" resultMap="BaseResultMap">
         SELECT
         <include refid="Base_Column_List"/>
-        FROM dkic_b.t_mac_account
-        WHERE object_id = #{id}::uuid
+        FROM dkic_b.t_mac_account  ac
+        WHERE  ac.object_id = #{id}::uuid
         for update
     </select>
 
@@ -167,7 +177,7 @@
     <select id="selectByIdsForUpdate" resultMap="BaseResultMap">
         SELECT
         <include refid="Base_Column_List"/>
-        FROM dkic_b.t_mac_account
+        FROM dkic_b.t_mac_account  ac
         <include refid="idsForeach"/>
         for update
     </select>

+ 3 - 2
src/main/java/com/dk/mdm/mapper/mst/CustomerMapper.xml

@@ -96,7 +96,7 @@
         <result column="follow_staff" property="followStaff"/>
         <result column="follow_staff_name" property="followStaffName"/>
         <result column="receivable_residue" property="receivableResidue"/>
-
+        <result column="receipt_residue" property="receiptResidue"/>
     </resultMap>
 
     <!-- 通用条件列 -->
@@ -211,7 +211,8 @@
         tms2.staff_name  AS  "reportStaffName",
         tdk.kind_name_i18n  ->> 'zh_CN' AS "saleStatusName",
         tcf.next_follow_time,
-        tma.receivable_residue
+        tma.receivable_residue,
+        tma.receipt_residue
         FROM dkic_b.t_mst_customer tmc
         LEFT JOIN  ( select tccff.cus_id, max (tccff.next_follow_time)as next_follow_time from dkic_b.t_crm_cus_follow tccff group by tccff.cus_id )  tcf on tmc.cus_id = tcf.cus_id
         LEFT JOIN  dkic_b.t_mst_dictionary_data tmd  on tmd.data_id =  tmc.cus_from

+ 3 - 0
src/main/java/com/dk/mdm/model/response/mst/CustomerResponse.java

@@ -309,6 +309,9 @@ public class CustomerResponse extends PageInfo<CustomerResponse> implements Seri
     @ApiModelProperty(value = "总剩余应收 (总应收账款-总应收收款金额-总应收优惠金额)")
     private BigDecimal receivableResidue;
 
+    @ApiModelProperty(value = "总收款金额-总应收收款金额+总应收优惠金额(现金池)")
+    private BigDecimal receiptResidue;
+
 
     private static final long serialVersionUID = 1L;