Commit 4d2149c8 authored by tianbo's avatar tianbo

三库建设-按监管单位统计调整

parent 3689850d
...@@ -52,6 +52,11 @@ public class DPFilterParamDto { ...@@ -52,6 +52,11 @@ public class DPFilterParamDto {
private String superviseUnitName; private String superviseUnitName;
/** /**
* 监管单位编码(接收单位/管辖机构)
*/
private String superviseUnitCode;
/**
* 企业单位名称(发起单位/使用单位) * 企业单位名称(发起单位/使用单位)
*/ */
private String companyName; private String companyName;
......
...@@ -18,6 +18,12 @@ public class SkjsCompanyCountItemDto { ...@@ -18,6 +18,12 @@ public class SkjsCompanyCountItemDto {
*/ */
private String regionName; private String regionName;
/*
* 监管单位-code_name
*/
private String superviseKey;
/** /**
* 使用单位 * 使用单位
*/ */
......
...@@ -18,6 +18,11 @@ public class SkjsEquipCountItemDto { ...@@ -18,6 +18,11 @@ public class SkjsEquipCountItemDto {
*/ */
private String regionName; private String regionName;
/*
* 监管单位-code_name
*/
private String superviseKey;
/** /**
* 电梯 * 电梯
*/ */
......
...@@ -18,6 +18,11 @@ public class SkjsUserCountItemDto { ...@@ -18,6 +18,11 @@ public class SkjsUserCountItemDto {
*/ */
private String regionName; private String regionName;
/*
* 监管单位-code_name
*/
private String superviseKey;
/** /**
* 作业人员 * 作业人员
*/ */
......
package com.yeejoin.amos.boot.module.statistics.api.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
@AllArgsConstructor
@Getter
public enum RegulatoryUnitLevelEnum {
/**
* *监管单位类型
*/
省局("省局", "headquarter"),
市局("市局", "prefecture-level"),
区县局("区县局", "county");
private final String name;
private final String code;
public static Map<String, String> getName = new HashMap<>();
public static Map<String, String> getCode = new HashMap<>();
static {
for (RegulatoryUnitLevelEnum e : RegulatoryUnitLevelEnum.values()) {
getName.put(e.code, e.name);
getCode.put(e.name, e.code);
}
}
public static RegulatoryUnitLevelEnum getEnumByCode(String code) {
return Arrays.stream(RegulatoryUnitLevelEnum.values()).filter(r -> r.code.equals(code)).findFirst().orElse(null);
}
}
...@@ -46,6 +46,6 @@ public interface ZLStatisticsMapper { ...@@ -46,6 +46,6 @@ public interface ZLStatisticsMapper {
IPage<IdxBizJgOtherInfo> getEquipInfoPage(IPage<IdxBizJgOtherInfo> idxBizJgOtherInfoPage); IPage<IdxBizJgOtherInfo> getEquipInfoPage(IPage<IdxBizJgOtherInfo> idxBizJgOtherInfoPage);
List<CountDto> countUserByPostAndAreaCode(@Param("orgCode") String orgCode, @Param("regionCode") String regionCode); List<CountDto> countUserByPostAndAreaCode(@Param("orgCode") String orgCode, @Param("regionCode") String regionCode, Boolean isOrgCodeExactMatch);
} }
...@@ -170,7 +170,35 @@ ...@@ -170,7 +170,35 @@
tz_base_enterprise_info bi tz_base_enterprise_info bi
WHERE WHERE
tui.unit_code = bi.use_code tui.unit_code = bi.use_code
and ((bi.supervise_org_code != '50' and bi.supervise_org_code LIKE CONCAT (#{orgCode}, '%')) or (bi.supervise_org_code = '50' and bi.office_region LIKE CONCAT ('%', #{regionCode}, '%'))) and
(
<choose>
<when test="regionCode != null and regionCode != ''">--按监管单位统计时,省局使用
(
<choose>
<when test="isOrgCodeExactMatch != null and isOrgCodeExactMatch != ''">
bi.supervise_org_code != '50' AND bi.supervise_org_code = #{orgCode}
</when>
<otherwise>
bi.supervise_org_code != '50' AND bi.supervise_org_code LIKE CONCAT(#{orgCode}, '%')
</otherwise>
</choose>
)
OR
(bi.supervise_org_code = '50' AND bi.office_region LIKE CONCAT('%', #{regionCode}, '%'))
</when>
<otherwise>--按监管单位统计时,除省局外使用
<choose>
<when test="isOrgCodeExactMatch != null and isOrgCodeExactMatch != ''">
bi.supervise_org_code != '50' AND bi.supervise_org_code = #{orgCode}
</when>
<otherwise>
bi.supervise_org_code != '50' AND bi.supervise_org_code LIKE CONCAT(#{orgCode}, '%')
</otherwise>
</choose>
</otherwise>
</choose>
)
and tui.is_delete=false and tui.is_delete=false
and bi.is_delete= '0' and bi.is_delete= '0'
group by keyStr group by keyStr
......
...@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.statistcs.biz.controller; ...@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.statistcs.biz.controller;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamDto; import com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamDto;
import com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamForDetailDto; import com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamForDetailDto;
import com.yeejoin.amos.boot.module.jg.api.dto.FourColorCountDataDto; import com.yeejoin.amos.boot.module.jg.api.dto.FourColorCountDataDto;
...@@ -19,6 +20,7 @@ import org.typroject.tyboot.core.restful.doc.TycloudOperation; ...@@ -19,6 +20,7 @@ import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest; import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseHelper; import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -30,7 +32,7 @@ import java.util.Map; ...@@ -30,7 +32,7 @@ import java.util.Map;
@RestController @RestController
@Api(tags = "大屏-监管及总览统计API") @Api(tags = "大屏-监管及总览统计API")
@RequestMapping("/dp/jg") @RequestMapping("/dp/jg")
public class JGDPStatisticsController { public class JGDPStatisticsController extends BaseController {
private JGDPStatisticsServiceImpl statisticsService; private JGDPStatisticsServiceImpl statisticsService;
...@@ -632,4 +634,25 @@ public class JGDPStatisticsController { ...@@ -632,4 +634,25 @@ public class JGDPStatisticsController {
return ResponseHelper.buildResponse(statisticsService.querySkjsDetail(dpFilterParamDto)); return ResponseHelper.buildResponse(statisticsService.querySkjsDetail(dpFilterParamDto));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST", value = "大屏总览-右侧-三库建设情况统计(柱状图)(管辖机构)", notes = "大屏总览-右侧-三库建设情况统计(柱状图)(管辖机构)")
@PostMapping(value = "/zl/skjsBySupervise")
public ResponseModel<Map<String, Object>> queryBarChartDataForSkjsBySupervise(@Validated @RequestBody DPFilterParamDto dpFilterParamDto, BindingResult result) {
List<FieldError> fieldErrors = result.getFieldErrors();
if (!fieldErrors.isEmpty()) {
throw new BadRequest(fieldErrors.get(0).getDefaultMessage());
}
return ResponseHelper.buildResponse(statisticsService.queryBarChartDataForSkjsBySupervise(dpFilterParamDto));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST", value = "大屏总览-三库建设情况(管辖机构)-详情", notes = "大屏总览-三库建设情况(管辖机构)-详情")
@PostMapping(value = "/skjsBySupervise/detail")
public ResponseModel<Map<String, Object>> querySkjsBySuperviseDetail(@Validated @RequestBody DPFilterParamDto dpFilterParamDto, BindingResult result) {
List<FieldError> fieldErrors = result.getFieldErrors();
if (!fieldErrors.isEmpty()) {
throw new BadRequest(fieldErrors.get(0).getDefaultMessage());
}
return ResponseHelper.buildResponse(statisticsService.querySkjsBySuperviseDetail(dpFilterParamDto));
}
} }
...@@ -36,7 +36,6 @@ import org.springframework.stereotype.Service; ...@@ -36,7 +36,6 @@ import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import javax.validation.constraints.NotBlank;
import java.io.IOException; import java.io.IOException;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode; import java.math.RoundingMode;
...@@ -895,11 +894,11 @@ public class AQZSDPStatisticsServiceImpl { ...@@ -895,11 +894,11 @@ public class AQZSDPStatisticsServiceImpl {
return new HashMap<>(); return new HashMap<>();
} }
// 1.气瓶数量统计 // 1.气瓶数量统计
long cylinderNum = stCommonService.staticsCenterMapCountDataForCylinder(result, orgCode,true, true); long cylinderNum = stCommonService.staticsCenterMapCountDataForCylinder(result, orgCode,true, true, false);
//1.8大类设备数量统计,压力容器里包括气瓶所以需要特殊处理,在统计压力容器时去掉气瓶的数量 //1.8大类设备数量统计,压力容器里包括气瓶所以需要特殊处理,在统计压力容器时去掉气瓶的数量
stCommonService.staticsCenterMapCountDataForEquip(result, cylinderNum, orgCode,true,true); stCommonService.staticsCenterMapCountDataForEquip(result, cylinderNum, orgCode,true,true, false);
//2.压力管道长度统计 //2.压力管道长度统计
stCommonService.staticsCenterMapCountDataForPipeline(result, orgCode,true); stCommonService.staticsCenterMapCountDataForPipeline(result, orgCode,true, false);
//3.单位数量统计 //3.单位数量统计
this.staticsCenterMapCountDataForCompany(result, orgCode, dpFilterParamDto.getCityCode()); this.staticsCenterMapCountDataForCompany(result, orgCode, dpFilterParamDto.getCityCode());
//4.人员数量统计 //4.人员数量统计
...@@ -929,7 +928,7 @@ public class AQZSDPStatisticsServiceImpl { ...@@ -929,7 +928,7 @@ public class AQZSDPStatisticsServiceImpl {
setDefaultCompanyCountData(result); setDefaultCompanyCountData(result);
return; return;
} }
List<CountDto> countDtos = enterpriseInfoMapper.countByUnitTypeAndOrgCode(orgCode, cityCode); List<CountDto> countDtos = enterpriseInfoMapper.countByUnitTypeAndOrgCode(orgCode, cityCode, false);
result.put(DPMapStatisticsItemEnum.USERS_UNITS.getCode(), countDtos.stream().filter(c -> c.getKeyStr().contains(COMPANY_TYPE_USE)).mapToInt(CountDto::getIntValue).sum()); result.put(DPMapStatisticsItemEnum.USERS_UNITS.getCode(), countDtos.stream().filter(c -> c.getKeyStr().contains(COMPANY_TYPE_USE)).mapToInt(CountDto::getIntValue).sum());
result.put(DPMapStatisticsItemEnum.CONSTRUCTION_UNITS.getCode(), countDtos.stream().filter(c -> c.getKeyStr().contains(COMPANY_TYPE_MAINTENANCE)).mapToInt(CountDto::getIntValue).sum()); result.put(DPMapStatisticsItemEnum.CONSTRUCTION_UNITS.getCode(), countDtos.stream().filter(c -> c.getKeyStr().contains(COMPANY_TYPE_MAINTENANCE)).mapToInt(CountDto::getIntValue).sum());
result.put(DPMapStatisticsItemEnum.MANUFACTURING_UNITS.getCode(), countDtos.stream().filter(c -> c.getKeyStr().contains(COMPANY_TYPE_MANUFACTURE)).mapToInt(CountDto::getIntValue).sum()); result.put(DPMapStatisticsItemEnum.MANUFACTURING_UNITS.getCode(), countDtos.stream().filter(c -> c.getKeyStr().contains(COMPANY_TYPE_MANUFACTURE)).mapToInt(CountDto::getIntValue).sum());
...@@ -990,11 +989,11 @@ public class AQZSDPStatisticsServiceImpl { ...@@ -990,11 +989,11 @@ public class AQZSDPStatisticsServiceImpl {
return new HashMap<>(); return new HashMap<>();
} }
// 0. 气瓶数量统计 // 0. 气瓶数量统计
long cylinderNum = stCommonService.staticsCenterMapCountDataForCylinder(result, orgCode,true, true); long cylinderNum = stCommonService.staticsCenterMapCountDataForCylinder(result, orgCode,true, true, false);
// 1. 8大类设备数量统计,压力容器里包括气瓶所以需要特殊处理,在统计压力容器时去掉气瓶的数量 // 1. 8大类设备数量统计,压力容器里包括气瓶所以需要特殊处理,在统计压力容器时去掉气瓶的数量
stCommonService.staticsCenterMapCountDataForEquip(result, cylinderNum, orgCode,true,true); stCommonService.staticsCenterMapCountDataForEquip(result, cylinderNum, orgCode,true,true, false);
// 2. 压力管道长度统计 // 2. 压力管道长度统计
stCommonService.staticsCenterMapCountDataForPipeline(result, orgCode,true); stCommonService.staticsCenterMapCountDataForPipeline(result, orgCode,true, false);
// 3.单位数量统计 // 3.单位数量统计
this.staticsCenterMapCountDataForCompany(result, orgCode, dpFilterParamDto.getCityCode()); this.staticsCenterMapCountDataForCompany(result, orgCode, dpFilterParamDto.getCityCode());
// 4. 人员数量统计 // 4. 人员数量统计
......
...@@ -537,11 +537,11 @@ public class JYJCDPStatisticsServiceImpl { ...@@ -537,11 +537,11 @@ public class JYJCDPStatisticsServiceImpl {
return result; return result;
} }
// 1.气瓶统计 // 1.气瓶统计
long cylinderNum = stCommonService.staticsCenterMapCountDataForCylinder(result, orgCode,true, true); long cylinderNum = stCommonService.staticsCenterMapCountDataForCylinder(result, orgCode,true, true, false);
// 2.8大类统计 // 2.8大类统计
stCommonService.staticsCenterMapCountDataForEquip(result, cylinderNum, orgCode,true,true); stCommonService.staticsCenterMapCountDataForEquip(result, cylinderNum, orgCode,true,true, false);
// 3.压力管道统计 // 3.压力管道统计
stCommonService.staticsCenterMapCountDataForPipeline(result, orgCode,true); stCommonService.staticsCenterMapCountDataForPipeline(result, orgCode,true, false);
// 4.报检数量统计 // 4.报检数量统计
this.staticsCenterMapCountDataReporting(result, dpFilterParamDto); this.staticsCenterMapCountDataReporting(result, dpFilterParamDto);
// 5.检验检测临期设备数数量统计 // 5.检验检测临期设备数数量统计
......
...@@ -212,13 +212,18 @@ public class StCommonServiceImpl { ...@@ -212,13 +212,18 @@ public class StCommonServiceImpl {
return regionList.stream().map(RegionModel::getRegionName).collect(Collectors.toList()); return regionList.stream().map(RegionModel::getRegionName).collect(Collectors.toList());
} }
public long staticsCenterMapCountDataForCylinder(Map<String, Object> result, String orgCode,Boolean supervisoryFlag, Boolean isMatchSupervisoryCode) { public long staticsCenterMapCountDataForCylinder(Map<String, Object> result, String orgCode, Boolean supervisoryFlag, Boolean isMatchSupervisoryCode, Boolean isOrgBranchCodeExactMatch) {
long num = 0; long num = 0;
CountRequest request = new CountRequest(); CountRequest request = new CountRequest();
request.indices("idx_biz_view_jg_all"); request.indices("idx_biz_view_jg_all");
BoolQueryBuilder boolMust = QueryBuilders.boolQuery(); BoolQueryBuilder boolMust = QueryBuilders.boolQuery();
// 按照管辖机构区域信息模糊查询 if (isOrgBranchCodeExactMatch) {
boolMust.must(QueryBuilders.wildcardQuery("ORG_BRANCH_CODE.keyword", QueryParser.escape(orgCode) + "*")); // 按照管辖机构区域信息精确查询
boolMust.must(QueryBuilders.termQuery("ORG_BRANCH_CODE.keyword", QueryParser.escape(orgCode)));
} else {
// 按照管辖机构区域信息模糊查询
boolMust.must(QueryBuilders.wildcardQuery("ORG_BRANCH_CODE.keyword", QueryParser.escape(orgCode) + "*"));
}
// 设备类别精确查询气瓶 // 设备类别精确查询气瓶
boolMust.must(QueryBuilders.termQuery("EQU_CATEGORY_CODE", EQU_CATEGORY_CYLINDER)); boolMust.must(QueryBuilders.termQuery("EQU_CATEGORY_CODE", EQU_CATEGORY_CYLINDER));
if(isMatchSupervisoryCode){ if(isMatchSupervisoryCode){
...@@ -245,12 +250,17 @@ public class StCommonServiceImpl { ...@@ -245,12 +250,17 @@ public class StCommonServiceImpl {
} }
public long staticsCenterMapCountDataForEquip(Map<String, Object> result, long cylinderNum, String orgCode,Boolean supervisoryFlag, Boolean isMatchSupervisoryCode) { public long staticsCenterMapCountDataForEquip(Map<String, Object> result, long cylinderNum, String orgCode, Boolean supervisoryFlag, Boolean isMatchSupervisoryCode, Boolean isOrgBranchCodeExactMatch) {
SearchRequest request = new SearchRequest(); SearchRequest request = new SearchRequest();
request.indices("idx_biz_view_jg_all"); request.indices("idx_biz_view_jg_all");
BoolQueryBuilder boolMust = QueryBuilders.boolQuery(); BoolQueryBuilder boolMust = QueryBuilders.boolQuery();
// 按照管辖机构区域信息模糊查询 if (isOrgBranchCodeExactMatch) {
boolMust.must(QueryBuilders.wildcardQuery("ORG_BRANCH_CODE.keyword", QueryParser.escape(orgCode) + "*")); // 按照管辖机构区域信息精确查询
boolMust.must(QueryBuilders.termQuery("ORG_BRANCH_CODE.keyword", QueryParser.escape(orgCode)));
} else {
// 按照管辖机构区域信息模糊查询
boolMust.must(QueryBuilders.wildcardQuery("ORG_BRANCH_CODE.keyword", QueryParser.escape(orgCode) + "*"));
}
if(isMatchSupervisoryCode){ if(isMatchSupervisoryCode){
if(supervisoryFlag) { if(supervisoryFlag) {
//已赋码 //已赋码
...@@ -305,8 +315,8 @@ public class StCommonServiceImpl { ...@@ -305,8 +315,8 @@ public class StCommonServiceImpl {
return itemEnum.getCode(); return itemEnum.getCode();
} }
public String staticsCenterMapCountDataForPipeline(Map<String, Object> result, String orgCode,Boolean supervisoryFlag) { public String staticsCenterMapCountDataForPipeline(Map<String, Object> result, String orgCode, Boolean supervisoryFlag, Boolean isOrgBranchCodeExactMatch) {
String length = techParamsPipelineMapper.sumPipeLengthByOrgCode(orgCode, supervisoryFlag); String length = techParamsPipelineMapper.sumPipeLengthByOrgCode(orgCode, supervisoryFlag, isOrgBranchCodeExactMatch);
BigDecimal lengthDecimal = new BigDecimal(length); BigDecimal lengthDecimal = new BigDecimal(length);
if (lengthDecimal.compareTo(BigDecimal.ZERO) > 0) { if (lengthDecimal.compareTo(BigDecimal.ZERO) > 0) {
// 数据库的米换算成千米 // 数据库的米换算成千米
......
...@@ -17,8 +17,9 @@ public interface EquipTechParamPipelineMapper extends BaseMapper<EquipTechParamP ...@@ -17,8 +17,9 @@ public interface EquipTechParamPipelineMapper extends BaseMapper<EquipTechParamP
/** /**
* 统计压力管道长度 * 统计压力管道长度
* *
* @param orgCode 区域code对应的管辖机构 * @param orgCode 区域code对应的管辖机构
* @param isOrgBranchCodeExactMatch 是否按机构代码精确匹配
* @return 数量 * @return 数量
*/ */
String sumPipeLengthByOrgCode(@Param("orgCode") String orgCode,@Param("supervisoryFlag") Boolean supervisoryFlag); String sumPipeLengthByOrgCode(@Param("orgCode") String orgCode, @Param("supervisoryFlag") Boolean supervisoryFlag, @Param("isOrgBranchCodeExactMatch") Boolean isOrgBranchCodeExactMatch);
} }
...@@ -78,7 +78,7 @@ public interface TzBaseEnterpriseInfoMapper extends BaseMapper<TzBaseEnterpriseI ...@@ -78,7 +78,7 @@ public interface TzBaseEnterpriseInfoMapper extends BaseMapper<TzBaseEnterpriseI
*/ */
TzBaseEnterpriseInfo selectBySeq(Long sequenceNbr); TzBaseEnterpriseInfo selectBySeq(Long sequenceNbr);
List<CountDto> countByUnitTypeAndOrgCode(@Param("orgCode") String orgCode,@Param("cityCode") String cityCode); List<CountDto> countByUnitTypeAndOrgCode(@Param("orgCode") String orgCode, @Param("cityCode") String cityCode, @Param("isOrgCodeExactMatch") Boolean isOrgCodeExactMatch);
List<CountDto> countByUnitTypeAndOrgCodeNoParam(); List<CountDto> countByUnitTypeAndOrgCodeNoParam();
......
...@@ -51,6 +51,14 @@ ...@@ -51,6 +51,14 @@
and oi.CLAIM_STATUS = '已认领' and oi.CLAIM_STATUS = '已认领'
) a ) a
where where
p."RECORD" = a."RECORD" and a.orgBranchCode like concat(#{orgCode}, '%') p."RECORD" = a."RECORD" and
<choose>
<when test="isOrgBranchCodeExactMatch == true">
a.orgBranchCode = #{orgCode}
</when>
<otherwise>
a.orgBranchCode like concat(#{orgCode}, '%')
</otherwise>
</choose>
</select> </select>
</mapper> </mapper>
...@@ -297,9 +297,37 @@ ...@@ -297,9 +297,37 @@
a.unit_type as keyStr a.unit_type as keyStr
FROM FROM
"tz_base_enterprise_info" a "tz_base_enterprise_info" a
where <where>
((a.supervise_org_code != '50' and a.supervise_org_code LIKE CONCAT (#{orgCode}, '%')) or (a.supervise_org_code = '50' and a.office_region LIKE CONCAT ('%', #{cityCode}, '%'))) (
and a.is_delete = '0' <choose>
<when test="cityCode != null and cityCode != ''">--按监管单位统计时,省局使用
(
<choose>
<when test="isOrgCodeExactMatch != null and isOrgCodeExactMatch != ''">
a.supervise_org_code != '50' AND a.supervise_org_code = #{orgCode}
</when>
<otherwise>
a.supervise_org_code != '50' AND a.supervise_org_code LIKE CONCAT(#{orgCode}, '%')
</otherwise>
</choose>
)
OR
(a.supervise_org_code = '50' AND a.office_region LIKE CONCAT('%', #{cityCode}, '%'))
</when>
<otherwise>--按监管单位统计时,除省局使用
<choose>
<when test="isOrgCodeExactMatch != null and isOrgCodeExactMatch != ''">
a.supervise_org_code != '50' AND a.supervise_org_code = #{orgCode}
</when>
<otherwise>
a.supervise_org_code != '50' AND a.supervise_org_code LIKE CONCAT(#{orgCode}, '%')
</otherwise>
</choose>
</otherwise>
</choose>
)
AND a.is_delete = '0'
</where>
group by a.unit_type group by a.unit_type
</select> </select>
<select id="countByUnitTypeAndOrgCodeNoParam" resultType="com.yeejoin.amos.boot.biz.common.dto.CountDto"> <select id="countByUnitTypeAndOrgCodeNoParam" resultType="com.yeejoin.amos.boot.biz.common.dto.CountDto">
......
...@@ -55,12 +55,24 @@ ...@@ -55,12 +55,24 @@
tzs_user_info tui, tzs_user_info tui,
tz_base_enterprise_info bi tz_base_enterprise_info bi
WHERE WHERE
tui.unit_code = bi.use_code tui.unit_code = bi.use_code
<if test="post != '' and post != null"> <if test="post != '' and post != null">
and tui.new_post LIKE concat ('%', #{post}, '%') AND tui.new_post LIKE CONCAT('%', #{post}, '%')
</if> </if>
and ((bi.supervise_org_code != '50' and bi.supervise_org_code LIKE CONCAT (#{orgCode}, '%')) or (bi.supervise_org_code = '50' and bi.office_region LIKE CONCAT ('%', #{regionCode}, '%'))) AND (
and tui.is_delete=false <choose>
<when test="regionCode != null and regionCode != ''">
(bi.supervise_org_code != '50' AND bi.supervise_org_code LIKE CONCAT(#{orgCode}, '%'))
OR
(bi.supervise_org_code = '50' AND bi.office_region LIKE CONCAT('%', #{regionCode}, '%'))
</when>
<otherwise>
bi.supervise_org_code != '50' AND bi.supervise_org_code LIKE CONCAT(#{orgCode}, '%')
</otherwise>
</choose>
)
AND tui.is_delete = false
</select> </select>
<select id="queryPermissionByUserSeq" resultType="com.yeejoin.amos.boot.module.common.api.dto.TzsUserPermissionDto"> <select id="queryPermissionByUserSeq" resultType="com.yeejoin.amos.boot.module.common.api.dto.TzsUserPermissionDto">
SELECT SELECT
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment