Browse Source

参数设置查询品牌修改 5-17

master
fkf 2 years ago
parent
commit
a293fb0650
  1. 2
      yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/biz/confBrandProportion/ConfBrandProportionMapper.java
  2. 2
      yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/biz/confBrandProportion/ConfBrandProportionMapper.xml
  3. 18
      yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/biz/confBrandProportion/ConfBrandProportionService.java
  4. 14
      yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/biz/enpBrand/EnpBrand.java

2
yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/biz/confBrandProportion/ConfBrandProportionMapper.java

@ -13,7 +13,7 @@ import java.util.List;
@Mapper @Mapper
public interface ConfBrandProportionMapper extends BaseMapper<ConfBrandProportion> { public interface ConfBrandProportionMapper extends BaseMapper<ConfBrandProportion> {
List<ConfBrandProportion> selectConfBrandProportionList(); List<ConfBrandProportion> selectConfBrandProportionList(@Param("brandSid") String brandSid);
List<ConfBrandProportion> selectBrandProportionByBrandName(@Param("brandName") String brandName); List<ConfBrandProportion> selectBrandProportionByBrandName(@Param("brandName") String brandName);
} }

2
yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/biz/confBrandProportion/ConfBrandProportionMapper.xml

@ -2,7 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yxt.supervise.dbcenter.zhj.crawl.biz.confBrandProportion.ConfBrandProportionMapper"> <mapper namespace="com.yxt.supervise.dbcenter.zhj.crawl.biz.confBrandProportion.ConfBrandProportionMapper">
<select id="selectConfBrandProportionList" resultType="com.yxt.supervise.dbcenter.zhj.crawl.biz.confBrandProportion.ConfBrandProportion"> <select id="selectConfBrandProportionList" resultType="com.yxt.supervise.dbcenter.zhj.crawl.biz.confBrandProportion.ConfBrandProportion">
select * from conf_brand_proportion select * from conf_brand_proportion where brandSid = #{brandSid}
</select> </select>
<select id="selectBrandProportionByBrandName" resultType="com.yxt.supervise.dbcenter.zhj.crawl.biz.confBrandProportion.ConfBrandProportion"> <select id="selectBrandProportionByBrandName" resultType="com.yxt.supervise.dbcenter.zhj.crawl.biz.confBrandProportion.ConfBrandProportion">

18
yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/biz/confBrandProportion/ConfBrandProportionService.java

@ -3,6 +3,9 @@ package com.yxt.supervise.dbcenter.zhj.crawl.biz.confBrandProportion;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yxt.common.core.result.ResultBean; import com.yxt.common.core.result.ResultBean;
import com.yxt.supervise.dbcenter.zhj.crawl.biz.enpBrand.EnpBrand;
import com.yxt.supervise.dbcenter.zhj.crawl.biz.enpBrand.EnpBrandMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List; import java.util.List;
@ -14,6 +17,9 @@ import java.util.List;
@Service @Service
public class ConfBrandProportionService extends ServiceImpl<ConfBrandProportionMapper, ConfBrandProportion> { public class ConfBrandProportionService extends ServiceImpl<ConfBrandProportionMapper, ConfBrandProportion> {
@Autowired
private EnpBrandMapper enpBrandMapper;
public ResultBean save(ConfBrandProportionDto dto){ public ResultBean save(ConfBrandProportionDto dto){
ResultBean rb = ResultBean.fireFail(); ResultBean rb = ResultBean.fireFail();
ConfBrandProportion proportion = new ConfBrandProportion(); ConfBrandProportion proportion = new ConfBrandProportion();
@ -27,8 +33,16 @@ public class ConfBrandProportionService extends ServiceImpl<ConfBrandProportionM
public ResultBean selectConfBrandProportion(){ public ResultBean selectConfBrandProportion(){
ResultBean rb = ResultBean.fireFail(); ResultBean rb = ResultBean.fireFail();
List<ConfBrandProportion> proportions = baseMapper.selectConfBrandProportionList(); List<EnpBrand> enpBrands = enpBrandMapper.selectEnpBrandList();
return rb.success().setData(proportions); for (EnpBrand enpBrand : enpBrands) {
List<ConfBrandProportion> proportions = baseMapper.selectConfBrandProportionList(enpBrand.getSid());
if (proportions != null){
enpBrand.setConfBrandProportionList(proportions);
}else {
enpBrand.setConfBrandProportionList(null);
}
}
return rb.success().setData(enpBrands);
} }
public ResultBean deleteConfBrandProportion(Integer id){ public ResultBean deleteConfBrandProportion(Integer id){

14
yxt-supervise-dbcenter/yxt-supervise-dbcenter-biz/src/main/java/com/yxt/supervise/dbcenter/zhj/crawl/biz/enpBrand/EnpBrand.java

@ -2,8 +2,11 @@ package com.yxt.supervise.dbcenter.zhj.crawl.biz.enpBrand;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.yxt.common.core.domain.BaseEntity; import com.yxt.common.core.domain.BaseEntity;
import com.yxt.supervise.dbcenter.zhj.crawl.biz.confBrandProportion.ConfBrandProportion;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import java.util.List;
/** /**
* @author shkstart * @author shkstart
* @create 2023-05-09-9:39 * @create 2023-05-09-9:39
@ -21,6 +24,17 @@ public class EnpBrand extends BaseEntity {
@ApiModelProperty("所属企业名称") @ApiModelProperty("所属企业名称")
private String enpName; private String enpName;
@ApiModelProperty("该品牌占比")
private List<ConfBrandProportion> confBrandProportionList;
public List<ConfBrandProportion> getConfBrandProportionList() {
return confBrandProportionList;
}
public void setConfBrandProportionList(List<ConfBrandProportion> confBrandProportionList) {
this.confBrandProportionList = confBrandProportionList;
}
public String getCode() { public String getCode() {
return code; return code;
} }

Loading…
Cancel
Save