Browse Source

修改大屏mapper.xml字段名称

ghost 4 years ago
parent
commit
899ba50874

+ 10 - 0
forest-admin/admin-server/src/main/java/com/hwrj/cloud/admin/controller/PmsProductController.java

@@ -20,10 +20,12 @@ import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.validation.BindingResult;
+import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
 
 import javax.servlet.http.HttpServletResponse;
+import javax.validation.constraints.NotNull;
 import java.io.IOException;
 import java.util.List;
 
@@ -70,6 +72,14 @@ public class PmsProductController {
         }
     }
 
+    @ApiOperation("根据供应商选择生产地")
+    @GetMapping(value = "/plOfPro/select")
+    @ResponseBody
+    public CommonResult plOfProSelect(@RequestParam("compId")  Long compId) {
+        List<SelectVo> plOfProSelect = productService.plOfProSelect(compId);
+        return CommonResult.success(plOfProSelect);
+    }
+
     @ApiOperation("查询商品")
     @RequestMapping(value = "/list", method = RequestMethod.GET)
     @ResponseBody

+ 2 - 0
forest-admin/admin-server/src/main/java/com/hwrj/cloud/admin/dao/PmsProductExcelDao.java

@@ -16,4 +16,6 @@ public interface PmsProductExcelDao {
     List<SelectVo> bigDataType();
 
     Long checkOne(@Param("check")String check);
+
+    List<SelectVo> plOfProSelect(@Param("compId")Long compId);
 }

+ 2 - 0
forest-admin/admin-server/src/main/java/com/hwrj/cloud/admin/service/PmsProductService.java

@@ -88,4 +88,6 @@ public interface PmsProductService {
     BigDataListInfoVo bigDatainfo(Long id);
 
     List<SelectVo> bigDataType();
+
+    List<SelectVo> plOfProSelect(Long compId);
 }

+ 5 - 0
forest-admin/admin-server/src/main/java/com/hwrj/cloud/admin/service/impl/PmsProductServiceImpl.java

@@ -385,4 +385,9 @@ public class PmsProductServiceImpl implements PmsProductService {
         return productExcelDao.bigDataType();
     }
 
+    @Override
+    public List<SelectVo> plOfProSelect(Long compId) {
+        return productExcelDao.plOfProSelect(compId);
+    }
+
 }

+ 29 - 16
forest-admin/admin-server/src/main/resources/dao/ProductExcelDao.xml

@@ -161,23 +161,26 @@
 
     <select id="bigDatainfo" resultMap="bigDatainfoMap" parameterType="java.lang.Long">
         SELECT
-        a.id,
-        a.`name` AS 'name',
-        a.pic AS pic,
-        a.brand_name AS brandName,
-        a.price AS price,
-        a.spec AS spec,
-        a.quality_guarantee_period AS qualityGuaranteePeriod,
-        a.place_of_production AS placeOfProduction,
-        a.ums_company_info AS umsCompanyInfo,
-        a.description AS description,
-        b.shop_type AS shopType,
-        b.shop_img AS shopImg,
-        b.shop_url AS shopUrl
+            a.id,
+            a.`name` AS 'name',
+            a.pic AS pic,
+            a.brand_name AS brandName,
+            a.price AS price,
+            a.spec AS spec,
+            a.quality_guarantee_period AS qualityGuaranteePeriod,
+            d.origin_name AS placeOfProduction,
+            c.comp_name AS umsCompanyInfo,
+            a.description AS description,
+            b.shop_type AS shopType,
+            b.shop_img AS shopImg,
+            b.shop_url AS shopUrl
         FROM
-        pms_product a
-        LEFT JOIN ums_company_shop b on a.ums_company_info_id=b.comp_id
-        WHERE 1=1
+            pms_product a
+        LEFT JOIN ums_company_info c ON c.id = a.comp_id
+        LEFT JOIN ums_company_shop b ON b.comp_id = a.comp_id
+        LEFT JOIN ums_member_origin d ON d.comp_id = a.comp_id
+        WHERE
+            1 = 1
         AND a.id = #{id}
     </select>
     <select id="bigDataType" resultType="com.hwrj.cloud.admin.dto.param.SelectVo">
@@ -214,4 +217,14 @@
             a.ums_company_info
         ) = #{check}
     </select>
+    <select id="plOfProSelect" resultType="com.hwrj.cloud.admin.dto.param.SelectVo">
+        SELECT
+            a.id as lable,
+            a.origin_name as text
+        FROM
+            ums_member_origin a
+        WHERE
+            a.state = 0
+        AND a.comp_id = #{compId}
+    </select>
 </mapper>