姜永辉 1 год назад
Родитель
Сommit
fa99631ad8

+ 9 - 0
src/main/java/com/dk/mdm/controller/mst/CustomerController.java

@@ -78,4 +78,13 @@ public class CustomerController{
     public ResponseResultVO<List<CustomerResponse>> selectByCondNoPage(@RequestBody CustomerQuery customerQuery) {
         return customerService.selectByCondNoPage(customerQuery);
     }
+
+    /**
+     * @desc : 客户详情
+     * @author : 姜永辉 10:36
+     */
+    @PostMapping({"select_customer/{id}"})
+    public ResponseResultVO selectCustomerById(@PathVariable String id) {
+        return customerService.selectCustomerById(id);
+    }
 }

+ 8 - 0
src/main/java/com/dk/mdm/mapper/mst/CustomerMapper.java

@@ -3,6 +3,7 @@ package com.dk.mdm.mapper.mst;
 import com.dk.mdm.model.pojo.mst.Customer;
 import com.dk.common.mapper.BaseMapper;
 import com.dk.mdm.model.query.mst.CustomerQuery;
+import com.dk.mdm.model.response.ivt.InboundResponse;
 import com.dk.mdm.model.response.mst.CustomerResponse;
 import org.apache.ibatis.annotations.Param;
 import org.springframework.stereotype.Repository;
@@ -39,5 +40,12 @@ public interface CustomerMapper extends BaseMapper<Customer>{
 
 
     int updateFollowStaffs(Customer customer);
+
+    /**
+     * @desc   : 根据id查询
+     * @date   : 2024/3/9 9:14
+     * @author : 于继渤
+     */
+    CustomerResponse selectCustomerById(@Param("id") String id);
 }
 

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

@@ -256,8 +256,16 @@
         FROM dkic_b.t_mst_customer
         WHERE cus_id = #{id}::uuid
     </select>
-
-
+    <!-- 根据主键查询表t_mst_customer的一行数据 -->
+    <select id="selectCustomerById" resultMap="BaseResultMapResponse">
+        SELECT
+        <include refid="Base_Column_List_Response"/>
+        ,tma.receivable_residue
+        ,tma.receipt_residue
+        FROM dkic_b.t_mst_customer  tmc
+        LEFT JOIN  dkic_b.t_mac_account tma  on tma.object_id =  tmc.cus_id
+        WHERE tmc.cus_id = #{id}::uuid
+    </select>
 
     <select id="selectByIdRespone" resultMap="BaseResultMapResponse">
         SELECT

+ 13 - 0
src/main/java/com/dk/mdm/service/mst/CustomerService.java

@@ -139,6 +139,19 @@ public class CustomerService extends BaseService<Customer> {
      * @author : 于继渤
      * @date : 2023/1/5 9:39
      */
+    public ResponseResultVO selectCustomerById( String id) {
+        CustomerResponse customerResponse = customerMapper.selectCustomerById(id);
+        if (customerResponse == null) {
+            return ResponseResultUtil.error(ResponseCodeEnum.SELECT_NULL);
+        }
+        return ResponseResultUtil.success(customerResponse);
+    }
+
+    /**
+     * @desc : 跟据id查询
+     * @author : 于继渤
+     * @date : 2023/1/5 9:39
+     */
     public ResponseResultVO<CustomerResponse> selectByIdRespone( String id) {
         CustomerResponse customerResponse = customerMapper.selectByIdRespone(id);
         if (customerResponse == null) {