Commit 428bc0da7e2e3ef188d7bd4744938aa40ff354ec

Authored by 陈威
1 parent 26a6d1e3
Exists in dev

项目公司组织级联

zr-cloud/zr-modules/zr-schsf/src/main/java/com/chinagas/modules/schsf/controller/McBasicCmtyController.java
... ... @@ -58,6 +58,37 @@ public class McBasicCmtyController extends BaseController {
58 58  
59 59  
60 60 /**
  61 + * 查询小区
  62 + * @param fiscalYear
  63 + * @param regionName
  64 + * @param groupName
  65 + * @param companyName
  66 + * @param companyCode
  67 + * @return
  68 + */
  69 + @RequirePermission("schsf:mcBasicCmty:vlgOrCmty")
  70 + @GetMapping("/vlgOrCmty")
  71 + public AjaxResult vlgOrCmty(
  72 + @RequestParam(value = "fiscalYear", required = true) Long fiscalYear,
  73 + @RequestParam(value = "regionName", required = true) String regionName,
  74 + @RequestParam(value = "groupName", required = true) String groupName,
  75 + @RequestParam(value = "companyName", required = true) String companyName,
  76 + @RequestParam(value = "companyCode", required = true) String companyCode) {
  77 + McBasicCmtyVo mcBasicCmtyVo = new McBasicCmtyVo();
  78 + mcBasicCmtyVo.setDefFlag("0");
  79 + mcBasicCmtyVo.setFiscalYear(fiscalYear);
  80 + mcBasicCmtyVo.setRegionName(regionName);
  81 + mcBasicCmtyVo.setGroupName(groupName);
  82 + mcBasicCmtyVo.setCompanyName(companyName);
  83 + mcBasicCmtyVo.setCompanyCode(companyCode);
  84 + List<McBasicCmty> data = mcBasicCmtyService.selectVlgOrCmtyList(mcBasicCmtyVo);
  85 + return AjaxResult.success(data);
  86 + }
  87 +
  88 +
  89 +
  90 +
  91 + /**
61 92 * 查询基础数据-户数列表
62 93 */
63 94 @RequirePermission("schsf:mcBasicCmty:list")
... ...
zr-cloud/zr-modules/zr-schsf/src/main/java/com/chinagas/modules/schsf/mapper/McBasicCmtyMapper.java
... ... @@ -67,4 +67,7 @@ public interface McBasicCmtyMapper
67 67 List<CompanyDto> getDistinctGroupList(McBasicCmtyVo mcBasicCmtyVo);
68 68  
69 69 List<CompanyDto> getDistinctCompanyList(McBasicCmtyVo mcBasicCmtyVo);
  70 +
  71 + List<McBasicCmty> selectVlgOrCmtyList(McBasicCmtyVo mcBasicCmtyVo);
  72 +
70 73 }
... ...
zr-cloud/zr-modules/zr-schsf/src/main/java/com/chinagas/modules/schsf/service/IMcBasicCmtyService.java
... ... @@ -70,6 +70,10 @@ public interface IMcBasicCmtyService
70 70 List<CompanyDto> selectCompanyCascader(McBasicCmtyVo mcBasicCmtyVo);
71 71  
72 72  
73   -
74   -
  73 + /**
  74 + * 查询小区
  75 + * @param mcBasicCmtyVo
  76 + * @return
  77 + */
  78 + List<McBasicCmty> selectVlgOrCmtyList(McBasicCmtyVo mcBasicCmtyVo);
75 79 }
... ...
zr-cloud/zr-modules/zr-schsf/src/main/java/com/chinagas/modules/schsf/service/impl/McBasicCmtyServiceImpl.java
... ... @@ -120,6 +120,16 @@ public class McBasicCmtyServiceImpl implements IMcBasicCmtyService
120 120 return companyDtos;
121 121 }
122 122  
  123 + /**
  124 + * 查询小区
  125 + * @param mcBasicCmtyVo
  126 + * @return
  127 + */
  128 + @Override
  129 + public List<McBasicCmty> selectVlgOrCmtyList(McBasicCmtyVo mcBasicCmtyVo) {
  130 + return mcBasicCmtyMapper.selectVlgOrCmtyList(mcBasicCmtyVo);
  131 + }
  132 +
123 133 private List<CompanyDto> loadDistinctGroups(McBasicCmtyVo mcBasicCmtyVo, CompanyDto parent) {
124 134 mcBasicCmtyVo.setRegionName(parent.getValue());
125 135 return mcBasicCmtyMapper.getDistinctGroupList(mcBasicCmtyVo);
... ...
zr-cloud/zr-modules/zr-schsf/src/main/resources/mapper/McBasicCmtyMapper.xml
... ... @@ -283,7 +283,7 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
283 283 left join sys_user u on u.user_id = t.create_by
284 284 left join sys_dept d on d.dept_id = t.company_code
285 285 WHERE 1=1
286   - <if test="regionName != null and regionName != ''"> and region_name = #{regionName}</if>
  286 + <if test="regionName != null and regionName != ''"> and t.region_name = #{regionName}</if>
287 287 <if test="defFlag != null and defFlag != ''"> and t.def_flag = #{defFlag}</if>
288 288 <if test="fiscalYear != null "> and t.fiscal_year = #{fiscalYear}</if>
289 289 <!-- 数据范围过滤 -->
... ... @@ -299,10 +299,10 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
299 299 left join sys_dept d on d.dept_id = t.company_code
300 300 WHERE 1 = 1
301 301 <if test="groupName != null and groupName != ''">
302   - and group_name = #{groupName}
  302 + and t.group_name = #{groupName}
303 303 </if>
304 304 <if test="regionName != null and regionName != ''">
305   - and region_name = #{regionName}
  305 + and t.region_name = #{regionName}
306 306 </if>
307 307 <if test="defFlag != null and defFlag != ''">
308 308 and t.def_flag = #{defFlag}
... ... @@ -313,4 +313,32 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
313 313 <!-- 数据范围过滤 -->
314 314 ${params.dataScope}
315 315 </select>
  316 +
  317 + <select id="selectVlgOrCmtyList" resultMap="McBasicCmtyResult" parameterType="com.chinagas.modules.schsf.domain.vo.McBasicCmtyVo">
  318 + SELECT DISTINCT t.vlg_or_cmty
  319 + FROM mc_basic_cmty t
  320 + left join sys_user u on u.user_id = t.create_by
  321 + left join sys_dept d on d.dept_id = t.company_code
  322 + WHERE 1 = 1
  323 + <if test="groupName != null and groupName != ''">
  324 + and t.group_name = #{groupName}
  325 + </if>
  326 + <if test="regionName != null and regionName != ''">
  327 + and t.region_name = #{regionName}
  328 + </if>
  329 + <if test="defFlag != null and defFlag != ''">
  330 + and t.def_flag = #{defFlag}
  331 + </if>
  332 + <if test="fiscalYear != null">
  333 + and t.fiscal_year = #{fiscalYear}
  334 + </if>
  335 + <if test="companyName != null and companyName != ''">
  336 + and t.company_name = #{companyName}
  337 + </if>
  338 + <if test="companyCode != null and companyCode != ''">
  339 + and t.company_code = #{companyCode}
  340 + </if>
  341 + <!-- 数据范围过滤 -->
  342 + ${params.dataScope}
  343 + </select>
316 344 </mapper>
... ...