Commit 487a5c38 authored by chenzhao's avatar chenzhao

质押关系 省份变更

parent f5571fe2
......@@ -40,7 +40,10 @@ public interface JpStationMapper extends BaseMapper<JpStation> {
List<DropDown> getRegion(String regionName);
@UserEmpower(field ={"ORG_CODE"} ,dealerField ={"ORG_CODE"}, fieldConditions ={"in","in"} ,relationship="and",specific=false)
List<DropDown> getRegionByProvince(String province);
List<DropDown> getRegionByProvince(@Param(value = "ids") List<String> ids);
List<String> getRegionNode(String province);
List<DropDown> getRegionAll();
......
......@@ -251,6 +251,29 @@
</if>
</select>
<select id="getRegionNode" resultType="string">
WITH RECURSIVE Subtree AS (
SELECT
SEQUENCE_NBR
FROM
systemctl_region sr
WHERE
sr.REGION_CODE = #{province}
UNION ALL
SELECT
h.SEQUENCE_NBR
FROM
systemctl_region h
JOIN
Subtree s ON h.PARENT_ID = s.SEQUENCE_NBR
)
SELECT
*
FROM
Subtree;
</select>
<select id="getRegionByProvince" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.DropDown">
SELECT privilege_company.ORG_CODE orgCode,
privilege_company.COMPANY_NAME name,
......@@ -259,8 +282,11 @@
FROM privilege_company
WHERE IS_DELETED = 0
and privilege_company.COMPANY_TYPE = 'region'
<if test="province!=null and province!=''">
and privilege_company.ADDRESS like concat('%',#{province}, '%')
<if test="ids!=null and ids.size()>0">
and privilege_company.REGION_SEQ in
<foreach collection="ids" separator="," open="(" close=")" item="item">
#{item}
</foreach>
</if>
</select>
<select id="getRegionAll" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.DropDown">
......
......@@ -443,7 +443,9 @@ public class JpStationController extends BaseController {
@UserLimits
public ResponseModel<List<Map<String, String>>> getRegionByProvince(String province) {
List<DropDown> list = jpStationMapper.getRegionByProvince(province);
List<String> ids = jpStationMapper.getRegionNode(province);
List<DropDown> list = jpStationMapper.getRegionByProvince(ids);
List<Map<String, String>> result = new ArrayList<>();
list.forEach(dropDown -> {
Map<String, String> item = new HashMap<>();
......
......@@ -39,6 +39,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import javax.annotation.Resource;
import java.util.*;
......@@ -478,7 +479,9 @@ public class FinancingInfoServiceImpl extends BaseService<FinancingInfoDto, Fina
LambdaQueryWrapper<FinancingRegional> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(FinancingRegional::getRegionalCompaniesSeq,peasantHousehold.getRegionalCompaniesSeq());
FinancingRegional financingRegional = financingRegionalService.getBaseMapper().selectOne(wrapper);
if (ObjectUtils.isEmpty(financingRegional)){
throw new BadRequest("该区域公司尚未绑定融资机构,请绑定后操作");
}
List<String> ids = Arrays.asList(financingRegional.getFinancingId().split(","));
return this.getBaseMapper().orgListByqyid(ids);
......
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