Commit 347de6f1 authored by 曹盼盼's avatar 曹盼盼

设备认领修改

parent 6c43d2ba
...@@ -21,7 +21,7 @@ public interface EquipmentCategoryMapper extends BaseMapper<EquipmentCategory> { ...@@ -21,7 +21,7 @@ public interface EquipmentCategoryMapper extends BaseMapper<EquipmentCategory> {
@Select("select * from tz_equipment_category where code in('1000','2000','3000','4000','5000','6000','8000','9000')") @Select("select * from tz_equipment_category where code in('1000','2000','3000','4000','5000','6000','8000','9000')")
List<EquipmentCategoryDto> selectClassify(); List<EquipmentCategoryDto> selectClassify();
Map<String, Object> getCategoryCount(@Param("code") String code); Map<String, Object> getCategoryCount(@Param("code") String code,@Param("level")String level,@Param("orgCode")String orgCode);
Map<String, Object> getAdministrativeDivision(@Param("division") String division, @Param("county") String county); Map<String, Object> getAdministrativeDivision(@Param("division") String division, @Param("county") String county);
......
...@@ -4,39 +4,66 @@ ...@@ -4,39 +4,66 @@
<select id="getCategoryCount" resultType="java.util.Map"> <select id="getCategoryCount" resultType="java.util.Map">
SELECT (SELECT SELECT (SELECT
count(*) count(*)
FROM FROM
idx_biz_jg_use_info ibjui idx_biz_jg_use_info ibjui
LEFT JOIN idx_biz_jg_supervision_info ibjsi ON ibjui.RECORD = ibjsi.RECORD LEFT JOIN idx_biz_jg_supervision_info ibjsi ON ibjui.RECORD = ibjsi.RECORD
LEFT JOIN idx_biz_jg_register_info ibjri ON ibjui.RECORD = ibjri.RECORD LEFT JOIN idx_biz_jg_register_info ibjri ON ibjui.RECORD = ibjri.RECORD
LEFT JOIN idx_biz_jg_other_info ibjoi ON ibjui.RECORD = ibjoi.RECORD LEFT JOIN idx_biz_jg_other_info ibjoi ON ibjui.RECORD = ibjoi.RECORD
LEFT JOIN tz_equipment_category tec ON ibjri.EQU_CATEGORY = tec.code LEFT JOIN tz_equipment_category tec ON ibjri.EQU_CATEGORY = tec.code
LEFT JOIN tz_equipment_category tec1 ON ibjri.EQU_LIST = tec1.code LEFT JOIN tz_equipment_category tec1 ON ibjri.EQU_LIST = tec1.code
WHERE WHERE
ibjoi.claim_status = '待认领' AND ibjri."EQU_LIST" = #{code} ) waitClaim , ibjoi.claim_status = '待认领' AND ibjri."EQU_LIST" = #{code}
(SELECT <if test="level == 'company'">
COUNT( * ) AND ibjui."USE_UNIT_CREDIT_CODE"
FROM LIKE CONCAT('%',#{orgCode},'%')
idx_biz_jg_use_info ibjui </if>
LEFT JOIN idx_biz_jg_supervision_info ibjsi ON ibjui.RECORD = ibjsi.RECORD <if test="level != 'company'">
LEFT JOIN idx_biz_jg_register_info ibjri ON ibjui.RECORD = ibjri.RECORD AND ibjsi."ORG_BRANCH_CODE"
LEFT JOIN idx_biz_jg_other_info ibjoi ON ibjui.RECORD = ibjoi.RECORD LIKE CONCAT('%',#{orgCode},'%')
LEFT JOIN tz_equipment_category tec ON ibjri.EQU_CATEGORY = tec.code </if>
LEFT JOIN tz_equipment_category tec1 ON ibjri.EQU_LIST = tec1.code ) waitClaim ,
WHERE (SELECT
ibjoi.claim_status = '已认领' AND ibjri."EQU_LIST" = #{code} ) alreadyClaim, COUNT( * )
(SELECT FROM
COUNT( * ) idx_biz_jg_use_info ibjui
FROM LEFT JOIN idx_biz_jg_supervision_info ibjsi ON ibjui.RECORD = ibjsi.RECORD
idx_biz_jg_use_info ibjui LEFT JOIN idx_biz_jg_register_info ibjri ON ibjui.RECORD = ibjri.RECORD
LEFT JOIN idx_biz_jg_supervision_info ibjsi ON ibjui.RECORD = ibjsi.RECORD LEFT JOIN idx_biz_jg_other_info ibjoi ON ibjui.RECORD = ibjoi.RECORD
LEFT JOIN idx_biz_jg_register_info ibjri ON ibjui.RECORD = ibjri.RECORD LEFT JOIN tz_equipment_category tec ON ibjri.EQU_CATEGORY = tec.code
LEFT JOIN idx_biz_jg_other_info ibjoi ON ibjui.RECORD = ibjoi.RECORD LEFT JOIN tz_equipment_category tec1 ON ibjri.EQU_LIST = tec1.code
LEFT JOIN tz_equipment_category tec ON ibjri.EQU_CATEGORY = tec.code WHERE
LEFT JOIN tz_equipment_category tec1 ON ibjri.EQU_LIST = tec1.code ibjoi.claim_status = '已认领' AND ibjri."EQU_LIST" = #{code}
WHERE <if test="level == 'company'">
ibjoi.claim_status = '已拒领' AND ibjri."EQU_LIST" = #{code} ) refuseClaim AND ibjui."USE_UNIT_CREDIT_CODE"
</select> LIKE CONCAT('%',#{orgCode},'%')
</if>
<if test="level != 'company'">
AND ibjsi."ORG_BRANCH_CODE"
LIKE CONCAT('%',#{orgCode},'%')
</if>
) alreadyClaim,
(SELECT
COUNT( * )
FROM
idx_biz_jg_use_info ibjui
LEFT JOIN idx_biz_jg_supervision_info ibjsi ON ibjui.RECORD = ibjsi.RECORD
LEFT JOIN idx_biz_jg_register_info ibjri ON ibjui.RECORD = ibjri.RECORD
LEFT JOIN idx_biz_jg_other_info ibjoi ON ibjui.RECORD = ibjoi.RECORD
LEFT JOIN tz_equipment_category tec ON ibjri.EQU_CATEGORY = tec.code
LEFT JOIN tz_equipment_category tec1 ON ibjri.EQU_LIST = tec1.code
WHERE
ibjoi.claim_status = '已拒领' AND ibjri."EQU_LIST" = #{code}
<if test="level == 'company'">
AND ibjui."USE_UNIT_CREDIT_CODE"
LIKE CONCAT('%',#{orgCode},'%')
</if>
<if test="level != 'company'">
AND ibjsi."ORG_BRANCH_CODE"
LIKE CONCAT('%',#{orgCode},'%')
</if>
) refuseClaim
</select>
<select id="getAdministrativeDivision" resultType="java.util.Map"> <select id="getAdministrativeDivision" resultType="java.util.Map">
SELECT SELECT
...@@ -51,7 +78,7 @@ ...@@ -51,7 +78,7 @@
</select> </select>
<select id="getSrcee" resultType="java.util.Map" > <select id="getSrcee" resultType="java.util.Map">
SELECT SELECT
* *
from from
......
...@@ -194,13 +194,13 @@ public class EquipmentCategoryController extends BaseController { ...@@ -194,13 +194,13 @@ public class EquipmentCategoryController extends BaseController {
/** /**
* 生成管辖分局树 * 获取行政区划
* *
* @return * @return
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/creatTree") @GetMapping(value = "/creatTree")
@ApiOperation(httpMethod = "GET", value = "生成管辖分局树", notes = "生成管辖分局树") @ApiOperation(httpMethod = "GET", value = "获取行政区划", notes = "获取行政区划")
public ResponseModel<Object> creatTree() { public ResponseModel<Object> creatTree() {
return ResponseHelper.buildResponse(equipmentCategoryService.creatTree()); return ResponseHelper.buildResponse(equipmentCategoryService.creatTree());
} }
......
...@@ -101,9 +101,12 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -101,9 +101,12 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
Map<String, List<Map<String, Object>>> resourceJson = JsonUtils.getResourceJson(equipCategory); Map<String, List<Map<String, Object>>> resourceJson = JsonUtils.getResourceJson(equipCategory);
List<Map<String, Object>> mapList = resourceJson.get(EquipmentClassifityEnum.BDLS.getCode()); List<Map<String, Object>> mapList = resourceJson.get(EquipmentClassifityEnum.BDLS.getCode());
List<Map<String, Object>> list = new ArrayList<>(); List<Map<String, Object>> list = new ArrayList<>();
JSONObject object = getCompanyType();
String level = object.getString("level");
String orgCode = object.getString("orgCode");
for (Map map : mapList) { for (Map map : mapList) {
Map<String, Object> resultMap = new HashMap<>(); Map<String, Object> resultMap = new HashMap<>();
Map<String, Object> map1 = equipmentCategoryMapper.getCategoryCount(map.get("code").toString()); Map<String, Object> map1 = equipmentCategoryMapper.getCategoryCount(map.get("code").toString(),level,orgCode);
resultMap.put("name", map.get("name")); resultMap.put("name", map.get("name"));
resultMap.put("image", map.get("image")); resultMap.put("image", map.get("image"));
resultMap.put("waitClaim", map1.get("waitClaim")); resultMap.put("waitClaim", map1.get("waitClaim"));
......
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