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

设备认领修改

parent 6c43d2ba
......@@ -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')")
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);
......
......@@ -4,39 +4,66 @@
<select id="getCategoryCount" resultType="java.util.Map">
SELECT (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} ) waitClaim ,
(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} ) 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} ) refuseClaim
</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>
) waitClaim ,
(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>
) 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
......@@ -51,7 +78,7 @@
</select>
<select id="getSrcee" resultType="java.util.Map" >
<select id="getSrcee" resultType="java.util.Map">
SELECT
*
from
......
......@@ -194,13 +194,13 @@ public class EquipmentCategoryController extends BaseController {
/**
* 生成管辖分局树
* 获取行政区划
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/creatTree")
@ApiOperation(httpMethod = "GET", value = "生成管辖分局树", notes = "生成管辖分局树")
@ApiOperation(httpMethod = "GET", value = "获取行政区划", notes = "获取行政区划")
public ResponseModel<Object> creatTree() {
return ResponseHelper.buildResponse(equipmentCategoryService.creatTree());
}
......
......@@ -101,9 +101,12 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
Map<String, List<Map<String, Object>>> resourceJson = JsonUtils.getResourceJson(equipCategory);
List<Map<String, Object>> mapList = resourceJson.get(EquipmentClassifityEnum.BDLS.getCode());
List<Map<String, Object>> list = new ArrayList<>();
JSONObject object = getCompanyType();
String level = object.getString("level");
String orgCode = object.getString("orgCode");
for (Map map : mapList) {
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("image", map.get("image"));
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