张天森
2022-09-14 dca8b4cb56933c5cd9ec60181b716a7fb8a3180d
update
3个文件已修改
23 ■■■■■ 已修改文件
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/community/sanshuo/ComSanshuoExpertDTO.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComSanShuoExpertServiceImpl.java 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComSanshuoExpertDao.xml 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/community/sanshuo/ComSanshuoExpertDTO.java
@@ -129,6 +129,7 @@
     */
    @ApiModelProperty("所属单位")
    private String unit;
    private String unitId;
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComSanShuoExpertServiceImpl.java
@@ -54,14 +54,20 @@
    public R addExpert(ComSanshuoExpertDTO comSanshuoExpertDTO) {
        ComSanshuoExpert expert=new ComSanshuoExpert();
        BeanUtil.copyProperties(comSanshuoExpertDTO,expert);
        //处理id
        if (nonNull(comSanshuoExpertDTO.getUnit())){
            String id = comSanshuoExpertDTO.getUnit();
            String[] split = id.split(",");
            comSanshuoExpertDTO.setUnitId(split[split.length]);
        }
        expert.setId(Snowflake.getId());
        expert.setCreateTime(new Date());
        if (expert.getLevel()==2){
            expert.setIndustryCenterId(Long.parseLong(expert.getUnit()));
            expert.setIndustryCenterId(Long.parseLong(comSanshuoExpertDTO.getUnitId()));
        }else if(expert.getLevel()==3){
            expert.setStreetId(Long.parseLong(expert.getUnit()));
            expert.setStreetId(Long.parseLong(comSanshuoExpertDTO.getUnitId()));
        }else if(expert.getLevel()==4){
            expert.setCommunityId(Long.parseLong(expert.getUnit()));
            expert.setCommunityId(Long.parseLong(comSanshuoExpertDTO.getUnitId()));
        }
        int insert = comSanshuoExpertDao.insert(expert);
        if (insert>0){
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComSanshuoExpertDao.xml
@@ -37,7 +37,7 @@
        param1,unit from com_sanshuo_expert
    </sql>
    <select id="expertShow" resultType="com.panzhihua.common.model.vos.sanshuo.ExpertShowVO">
        select  count(id) as 'count',level from com_sanshuo_expert group by level
        select  count(id) as 'count',level from com_sanshuo_expert where status=1 and del_flag=1 group by level
    </select>
    <select id="expertPage"  resultType="com.panzhihua.common.model.vos.sanshuo.ComSanshuoExpertVO">
        select id,level,community_id,
@@ -47,7 +47,7 @@
        create_time,create_by,update_time,
        introduction,street_id,industry_center_id,
        param1,unit from com_sanshuo_expert
        where del_flag=0
        where del_flag=1
            <if test="keyWord != null and keyWord != ''">
                AND unit like concat('%',#{keyWord},'%')
                OR name like concat('%',#{keyWord},'%')
@@ -68,19 +68,19 @@
    <select id="selectExpertIndustry" resultType="com.panzhihua.common.model.vos.sanshuo.ExpertShowVO">
        select  count(t.id) as 'count',t1.name from com_sanshuo_expert t
        left join com_sanshuo_industry_center t1 on t.industry_center_id=t1.id
        where t.level=2
        where t.level=2 and t.status=1 and t.del_flag=1
        group by t1.name
    </select>
    <select id="selectExpertStreet" resultType="com.panzhihua.common.model.vos.sanshuo.ExpertShowVO">
        select  count(t.id) as 'count',t1.name from com_sanshuo_expert t
        left join com_street t1 on t.street_id=t1.street_id
        where t.level=3
        where t.level=3 and t.status=1 and t.del_flag=1
        group by t1.name
    </select>
    <select id="selectExpertCommunity" resultType="com.panzhihua.common.model.vos.sanshuo.ExpertShowVO">
        select  count(t.id) as 'count',t1.name from com_sanshuo_expert t
        left join com_act t1 on t.community_id=t1.community_id
        where t.level=4
        where t.level=4 and t.status=1 and t.del_flag=1
        group by t1.name
    </select>
</mapper>