Explorar el Código

合作方产品

shixr hace 1 año
padre
commit
3fca7a3777

+ 12 - 0
src/main/java/com/kexun/controller/CooperatorController.java

@@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.kexun.common.utils.Result;
 import com.kexun.entity.CooperatorField;
 import com.kexun.entity.CooperatorInfo;
+import com.kexun.entity.CooperatorProduct;
 import com.kexun.service.CooperatorService;
 import lombok.extern.java.Log;
 import org.apache.commons.lang.StringUtils;
@@ -68,6 +69,17 @@ public class CooperatorController {
         return Result.success("ok", result);
     }
 
+    @GetMapping("findCooperatorProductByNum")
+    public Result findCooperatorProductByNum(String cooperatorNum) {
+
+        JSONObject result = new JSONObject();
+        List<CooperatorProduct> list = CooperatorService.findCooperatorProductByNum();
+//        System.out.println(list);
+        result.put("cooperator_product",list);
+
+        return Result.success("ok", result);
+    }
+
 
     @GetMapping("list")
     public Result list(String partnerName) {

+ 29 - 0
src/main/java/com/kexun/entity/CooperatorProduct.java

@@ -0,0 +1,29 @@
+package com.kexun.entity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.io.Serializable;
+
+@TableName(value = "prd_product")
+@Data
+public class CooperatorProduct implements Serializable {
+
+    @TableField(value = "product_num")
+    private String productNum;
+
+    @TableField(value = "product_name")
+    private String productName;
+
+    @TableField(value = "product_status")
+    private String productStatus;
+
+    private String modelName;
+
+    @TableField(value = "create_time")
+    private String createTime;
+
+    @TableField(exist = false)
+    private static final long serialVersionUID = 1L;
+}

+ 2 - 0
src/main/java/com/kexun/mapper/CooperatorMapper.java

@@ -3,6 +3,7 @@ package com.kexun.mapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.kexun.entity.CooperatorInfo;
 import com.kexun.entity.CooperatorField;
+import com.kexun.entity.CooperatorProduct;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
@@ -14,6 +15,7 @@ public interface CooperatorMapper extends BaseMapper<CooperatorInfo> {
 
     // List<CooperatorField> Query(@Param("cooperatorNum") String cooperatorNum);
     List<CooperatorField> Query();
+    List<CooperatorProduct> QueryProduct();
 
 }
 

+ 2 - 0
src/main/java/com/kexun/service/CooperatorService.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
 
 import com.kexun.entity.CooperatorField;
 import com.kexun.entity.CooperatorInfo;
+import com.kexun.entity.CooperatorProduct;
 import com.kexun.entity.UserField;
 
 import java.util.List;
@@ -15,4 +16,5 @@ public interface CooperatorService extends IService<CooperatorInfo> {
     CooperatorInfo findByCooperatorNum(String partnerName);
 //    List<CooperatorField> findCooperatorFieldByNum(String cooperatorNum);
     List<CooperatorField> findCooperatorFieldByNum();
+    List<CooperatorProduct> findCooperatorProductByNum();
 }

+ 9 - 1
src/main/java/com/kexun/service/impl/CooperatorServiceImpl.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.kexun.entity.CooperatorField;
 import com.kexun.entity.CooperatorInfo;
+import com.kexun.entity.CooperatorProduct;
 import com.kexun.mapper.CooperatorMapper;
 import com.kexun.service.CooperatorService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -29,12 +30,19 @@ public class CooperatorServiceImpl extends ServiceImpl<CooperatorMapper, Coopera
     CooperatorMapper cooperatorMapper;
 
     @Override
-    public List findCooperatorFieldByNum() {
+    public List<CooperatorField> findCooperatorFieldByNum() {
 //        System.out.println("aaa");
         List<CooperatorField> l = cooperatorMapper.Query();
         return l;
     }
 
+    @Override
+    public List<CooperatorProduct> findCooperatorProductByNum() {
+//        System.out.println("aaa");
+        List<CooperatorProduct> l = cooperatorMapper.QueryProduct();
+        return l;
+    }
+
 }
 
 

+ 16 - 0
src/main/resources/mapper/CooperatorMapper.xml

@@ -43,5 +43,21 @@
             cooperator_info.cooperator_num = "HBJK20230509";
 
 
+    </select>
+
+    <select id="QueryProduct" resultType="com.kexun.entity.CooperatorProduct">
+        SELECT DISTINCT
+            prd_product.product_num,
+            prd_product.product_name,
+            prd_product.product_status,
+            prd_product.create_time,
+            model.model_name
+        FROM
+            prd_product
+                LEFT JOIN model ON model.model_no = prd_product.model_id
+        WHERE
+            prd_product.cooperator_num = "HBJK20230509";
+
+
     </select>
 </mapper>