Commit 746ff7d8 authored by suhuiguang's avatar suhuiguang

1.总览数据刷新优化33秒左右

parent 18c8b218
package com.yeejoin.amos.boot.module.tzs.api.dto;
import lombok.Data;
/**
* @author Administrator
*/
@Data
public class UseUnitCreditCodeCategoryDto {
/**
* 使用单位编码
*/
private String useUnitCreditCode;
/**
* 状态
*/
private String claimStatus;
/**
* 设备定义编码
*/
private String equList;
/**
* 数量
*/
private Long total;
}
......@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.tzs.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.tzs.api.dto.EquipmentCategoryDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.UseUnitCreditCodeCategoryDto;
import com.yeejoin.amos.boot.module.tzs.api.entity.EquipmentCategory;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
......@@ -22,6 +23,7 @@ public interface EquipmentCategoryMapper extends BaseMapper<EquipmentCategory> {
List<Map<String, Object>> getCategoryCount( @Param("companyCode") String companyCode);
Map<String, Object> getAdministrativeDivision(@Param("division") String division, @Param("county") String county);
......@@ -40,4 +42,7 @@ public interface EquipmentCategoryMapper extends BaseMapper<EquipmentCategory> {
List<Map<String, Object>> getCategoryData(String level, String orgCode, String companyCode);
String getUnitCodeByRecord(String record);
List<UseUnitCreditCodeCategoryDto> useUnitCreditCodeCategoryCount();
}
......@@ -39,7 +39,7 @@ public interface IEquipmentCategoryService {
void checkEsData(String id);
List<EquipmentCategoryData> createEquipmentCategoryData();
void createEquipmentCategoryData();
EquipmentCategoryData updateEquipmentCategoryData(String id);
......
......@@ -135,8 +135,7 @@
idx_biz_jg_use_info ibjui
LEFT JOIN idx_biz_jg_supervision_info ibjsi ON ibjui."RECORD" = ibjsi."RECORD"
WHERE
USE_UNIT_CREDIT_CODE is NOT NULL
AND USE_UNIT_CREDIT_CODE <![CDATA[ <> ]]> ''
USE_UNIT_CREDIT_CODE <![CDATA[ <> ]]> ''
AND (lengthb(USE_UNIT_CREDIT_CODE)= 15 or lengthb(USE_UNIT_CREDIT_CODE)= 18)
<if test="unitCodes !=null and unitCodes.size>0">
and USE_UNIT_CREDIT_CODE in
......@@ -299,4 +298,22 @@
<select id="getUnitCodeByRecord" resultType="java.lang.String">
select "USE_UNIT_CREDIT_CODE" from idx_biz_jg_use_info where "RECORD" = #{id}
</select>
<select id="useUnitCreditCodeCategoryCount" resultType="com.yeejoin.amos.boot.module.tzs.api.dto.UseUnitCreditCodeCategoryDto">
SELECT
ibjui."USE_UNIT_CREDIT_CODE",
ibjoi."CLAIM_STATUS",
ibjri."EQU_LIST",
COUNT ( * ) as TOTAL
FROM
idx_biz_jg_use_info ibjui
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
where
ibjoi."CLAIM_STATUS" <![CDATA[ <> ]]> ''
and ibjui."USE_UNIT_CREDIT_CODE" <![CDATA[ <> ]]> ''
and ibjri."EQU_LIST" <![CDATA[ <> ]]> ''
GROUP BY ibjui."USE_UNIT_CREDIT_CODE", ibjoi."CLAIM_STATUS",ibjri."EQU_LIST"
ORDER BY ibjui."USE_UNIT_CREDIT_CODE"
</select>
</mapper>
......@@ -260,8 +260,8 @@ public class EquipmentCategoryController extends BaseController {
@RequestMapping(value = "/createEquipmentCategoryData", method = RequestMethod.GET)
@ApiOperation(httpMethod = "get", value = "初始化一码通总览数据", notes = "初始化一码通总览数据")
public ResponseModel<Object> createEquipmentCategoryData(){
return ResponseHelper.buildResponse(equipmentCategoryService.createEquipmentCategoryData());
equipmentCategoryService.createEquipmentCategoryData();
return ResponseHelper.buildResponse("SUCCESS");
}
/**
......
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