feat(corp): 为可视化大屏企业用户汇总接口添加查询参数支持
parent
2aa7777dfc
commit
8f7f5201ea
|
|
@ -165,8 +165,8 @@ public class CorpInfoController {
|
||||||
|
|
||||||
@ApiOperation("可视化大屏-企业用户汇总")
|
@ApiOperation("可视化大屏-企业用户汇总")
|
||||||
@PostMapping("/corpUserSummary")
|
@PostMapping("/corpUserSummary")
|
||||||
public SingleResponse<CorpUserSummaryCO> corpUserSummary() {
|
public SingleResponse<CorpUserSummaryCO> corpUserSummary(@Validated @RequestBody CorpUserSummaryQry qry) {
|
||||||
return SingleResponse.of(corpInfoService.corpUserSummary());
|
return SingleResponse.of(corpInfoService.corpUserSummary(qry));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -323,8 +323,9 @@ public class CorpInfoQueryExe {
|
||||||
return PageResponse.of(list, pageResponse.getTotalCount(), pageResponse.getPageSize(), pageResponse.getPageIndex());
|
return PageResponse.of(list, pageResponse.getTotalCount(), pageResponse.getPageSize(), pageResponse.getPageIndex());
|
||||||
}
|
}
|
||||||
|
|
||||||
public CorpUserSummaryCO corpUserSummary() {
|
public CorpUserSummaryCO corpUserSummary(CorpUserSummaryQry qry) {
|
||||||
CorpUserSummaryDO corpUserSummaryDO = corpInfoRepository.corpUserSummary();
|
Map<String, Object> params = PageQueryHelper.toHashMap(qry);
|
||||||
|
CorpUserSummaryDO corpUserSummaryDO = corpInfoRepository.corpUserSummary(params);
|
||||||
CorpUserSummaryCO corpUserSummaryCO = new CorpUserSummaryCO();
|
CorpUserSummaryCO corpUserSummaryCO = new CorpUserSummaryCO();
|
||||||
BeanUtils.copyProperties(corpUserSummaryDO, corpUserSummaryCO);
|
BeanUtils.copyProperties(corpUserSummaryDO, corpUserSummaryCO);
|
||||||
return corpUserSummaryCO;
|
return corpUserSummaryCO;
|
||||||
|
|
|
||||||
|
|
@ -153,8 +153,8 @@ public class CorpInfoServiceImpl implements CorpInfoServiceI {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CorpUserSummaryCO corpUserSummary() {
|
public CorpUserSummaryCO corpUserSummary(CorpUserSummaryQry qry) {
|
||||||
return corpInfoQueryExe.corpUserSummary();
|
return corpInfoQueryExe.corpUserSummary(qry);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -58,6 +58,6 @@ public interface CorpInfoServiceI {
|
||||||
|
|
||||||
PageResponse<CorpUserStatisticCO> corpUserStatisticPage(CorpUserStatisticQry qry);
|
PageResponse<CorpUserStatisticCO> corpUserStatisticPage(CorpUserStatisticQry qry);
|
||||||
|
|
||||||
CorpUserSummaryCO corpUserSummary();
|
CorpUserSummaryCO corpUserSummary(CorpUserSummaryQry qry);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
package com.zcloud.basic.info.dto;
|
package com.zcloud.basic.info.dto;
|
||||||
|
|
||||||
import com.alibaba.cola.dto.PageQuery;
|
import com.alibaba.cola.dto.PageQuery;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
|
@ -20,4 +21,11 @@ public class CorpUserStatisticQry extends PageQuery {
|
||||||
|
|
||||||
@ApiModelProperty(value = "企业类型1:监管 2:企业 3:相关方", name = "enterpriseType")
|
@ApiModelProperty(value = "企业类型1:监管 2:企业 3:相关方", name = "enterpriseType")
|
||||||
private Integer enterpriseType;
|
private Integer enterpriseType;
|
||||||
|
|
||||||
|
@JsonProperty("port_area")
|
||||||
|
@ApiModelProperty(value = "港区,1:秦皇岛港区,2:秦皇岛东,3:秦皇岛西", name = "port_area")
|
||||||
|
private Integer portArea;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "企业id", name = "corpinfoId")
|
||||||
|
private Long corpinfoId;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,19 @@
|
||||||
|
package com.zcloud.basic.info.dto;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 可视化大屏企业用户汇总查询参数
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class CorpUserSummaryQry {
|
||||||
|
|
||||||
|
@JsonProperty("port_area")
|
||||||
|
@ApiModelProperty(value = "港区,1:秦皇岛港区,2:秦皇岛东,3:秦皇岛西", name = "port_area")
|
||||||
|
private Integer portArea;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "企业id", name = "corpinfoId")
|
||||||
|
private Long corpinfoId;
|
||||||
|
}
|
||||||
|
|
@ -36,7 +36,7 @@ public interface CorpInfoMapper extends BaseMapper<CorpInfoDO> {
|
||||||
|
|
||||||
IPage<CorpUserStatisticDO> corpUserStatisticPage(IPage<CorpUserStatisticDO> iPage, Map<String, Object> params);
|
IPage<CorpUserStatisticDO> corpUserStatisticPage(IPage<CorpUserStatisticDO> iPage, Map<String, Object> params);
|
||||||
|
|
||||||
CorpUserSummaryDO corpUserSummary();
|
CorpUserSummaryDO corpUserSummary(Map<String, Object> params);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -49,6 +49,6 @@ public interface CorpInfoRepository extends BaseRepository<CorpInfoDO> {
|
||||||
|
|
||||||
PageResponse<CorpUserStatisticDO> corpUserStatisticPage(Map<String, Object> parmas);
|
PageResponse<CorpUserStatisticDO> corpUserStatisticPage(Map<String, Object> parmas);
|
||||||
|
|
||||||
CorpUserSummaryDO corpUserSummary();
|
CorpUserSummaryDO corpUserSummary(Map<String, Object> parmas);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -342,8 +342,8 @@ public class CorpInfoRepositoryImpl extends BaseRepositoryImpl<CorpInfoMapper, C
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CorpUserSummaryDO corpUserSummary() {
|
public CorpUserSummaryDO corpUserSummary(Map<String, Object> params) {
|
||||||
return corpInfoMapper.corpUserSummary();
|
return corpInfoMapper.corpUserSummary(params);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -99,6 +99,12 @@
|
||||||
<if test="params.likeCorpName != null and params.likeCorpName.trim() != ''">
|
<if test="params.likeCorpName != null and params.likeCorpName.trim() != ''">
|
||||||
AND c.corp_name like concat('%',#{params.likeCorpName},'%')
|
AND c.corp_name like concat('%',#{params.likeCorpName},'%')
|
||||||
</if>
|
</if>
|
||||||
|
<if test="params.portArea != null">
|
||||||
|
AND c.port_area = #{params.portArea}
|
||||||
|
</if>
|
||||||
|
<if test="params.corpinfoId != null">
|
||||||
|
AND c.id = #{params.corpinfoId}
|
||||||
|
</if>
|
||||||
ORDER BY IFNULL(u.userCount, 0) DESC, IFNULL(d.departmentCount, 0) DESC, c.corp_order ASC, c.create_time DESC
|
ORDER BY IFNULL(u.userCount, 0) DESC, IFNULL(d.departmentCount, 0) DESC, c.corp_order ASC, c.create_time DESC
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
@ -111,9 +117,21 @@
|
||||||
FROM user u
|
FROM user u
|
||||||
INNER JOIN corp_info c ON c.id = u.corpinfo_id AND c.delete_enum = 'FALSE'
|
INNER JOIN corp_info c ON c.id = u.corpinfo_id AND c.delete_enum = 'FALSE'
|
||||||
WHERE u.delete_enum = 'FALSE'
|
WHERE u.delete_enum = 'FALSE'
|
||||||
|
<if test="params.portArea != null">
|
||||||
|
AND c.port_area = #{params.portArea}
|
||||||
|
</if>
|
||||||
|
<if test="params.corpinfoId != null">
|
||||||
|
AND c.id = #{params.corpinfoId}
|
||||||
|
</if>
|
||||||
), 0) AS userCount
|
), 0) AS userCount
|
||||||
FROM corp_info c
|
FROM corp_info c
|
||||||
WHERE c.delete_enum = 'FALSE'
|
WHERE c.delete_enum = 'FALSE'
|
||||||
|
<if test="params.portArea != null">
|
||||||
|
AND c.port_area = #{params.portArea}
|
||||||
|
</if>
|
||||||
|
<if test="params.corpinfoId != null">
|
||||||
|
AND c.id = #{params.corpinfoId}
|
||||||
|
</if>
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue