Browse Source

message:

为党员中心户坐标集合添加注解
为党员中心户数和党群服务站数添加查询条件
dev_power_axis
HAHA 4 years ago
parent
commit
0351a453e8
  1. 3
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisDataVisualController.java
  2. 10
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/dao/PowerAxisStructDao.java
  3. 4
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisStructServiceImpl.java
  4. 106
      epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerAxisStructDao.xml

3
epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisDataVisualController.java

@ -14,6 +14,7 @@ import com.epmet.plugin.power.modules.axis.service.PowerServiceStationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.List;
/***
@ -129,7 +130,7 @@ public class PowerAxisDataVisualController {
* @date 2022/4/23 10:20
*/
@PostMapping("kernelHousehold/listPosition")
public Result<List<PowerKernelListPostitionResultDTO>> getListPosition(@RequestBody PowerKernelListPostitionFormDTO form, @LoginUser TokenDto tokenDto) {
public Result<List<PowerKernelListPostitionResultDTO>> getListPosition(@Valid @RequestBody PowerKernelListPostitionFormDTO form, @LoginUser TokenDto tokenDto) {
ValidatorUtils.validateEntity(form);
form.setCustomerId(tokenDto.getCustomerId());
return new Result().ok(powerKernelHouseholdService.getListPosition(form));

10
epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/dao/PowerAxisStructDao.java

@ -75,19 +75,19 @@ public interface PowerAxisStructDao extends BaseDao<PowerAxisStructEntity> {
List<String> getIdsByAgencyId(String agencyId, String customerId);
int queryGridParty(@Param("agencyId") String agencyId,@Param("customerId") String customerId,@Param("gridCateGoryCode") String gridCateGoryCode);
int queryGridParty(@Param("agencyId") String agencyId, @Param("customerId") String customerId, @Param("gridCateGoryCode") String gridCateGoryCode);
int queryGroupParty(@Param("agencyId") String agencyId,@Param("customerId") String customerId,@Param("groupCateGoryCode") String groupCateGoryCode);
int queryGroupParty(@Param("agencyId") String agencyId, @Param("customerId") String customerId, @Param("groupCateGoryCode") String groupCateGoryCode);
int getKernelHouseHold(PowerAxisStructViewFormDTO form);
int getKernelHouseHold(@Param("agencyId") String agencyId, @Param("customerId") String customerId);
int getServiceStation(PowerAxisStructViewFormDTO form);
int getServiceStation(@Param("agencyId") String agencyId,@Param("customerId") String customerId);
List<PowerAxisStructTreeResultDTO> getStructTree(PowerAxisStructStructTreeFormDTO form);
String queryCategoryCode(PowerAxisListPositionFormDTO form);
List<PowerAxisListPositionResultDTO> querylistPosition(@Param("customerId") String customerId,@Param("code") String code ,@Param("agencyId") String agencyId);
List<PowerAxisListPositionResultDTO> querylistPosition(@Param("customerId") String customerId, @Param("code") String code, @Param("agencyId") String agencyId);
/**
* 根据节点接报组装其上级节点树

4
epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisStructServiceImpl.java

@ -237,9 +237,9 @@ public class PowerAxisStructServiceImpl extends BaseServiceImpl<PowerAxisStructD
String groupCateGoryCode = baseDao.getCateGoryCode(form.getCustomerId(), PowerTagLevelEnum.CHILD_SECOND.level(), PowerTagCategoryEnum.STRUCT.category());
int groupParty = baseDao.queryGroupParty(form.getAgencyId(), form.getCustomerId(), groupCateGoryCode);
// 查询党员中心户数
int kernelHouseHold = baseDao.getKernelHouseHold(form);
int kernelHouseHold = baseDao.getKernelHouseHold(form.getAgencyId(), form.getCustomerId());
// 查询服务站数
int serviceStation = baseDao.getServiceStation(form);
int serviceStation = baseDao.getServiceStation(form.getAgencyId(),form.getCustomerId());
PowerAxisStructViewResultDTO result = new PowerAxisStructViewResultDTO();
result.setGridNum(gridParty);

106
epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerAxisStructDao.xml

@ -35,17 +35,17 @@
<select id="selectAllForTree"
resultType="com.epmet.plugin.power.dto.axis.result.PowerAxisStructLeaderResultDTO">
select
s.ID,
s.NAME,
s.PID,
s.PIDS,
s.CATEGORY_CODE,
s.SORT,
s.CREATED_TIME,
sl.LEADER_ID,
l.NAME as LEADER_NAME,
l.MOBILE as LEADER_MOBILE,
t.STRUCT_LEVEL
s.ID,
s.NAME,
s.PID,
s.PIDS,
s.CATEGORY_CODE,
s.SORT,
s.CREATED_TIME,
sl.LEADER_ID,
l.NAME as LEADER_NAME,
l.MOBILE as LEADER_MOBILE,
t.STRUCT_LEVEL
from pli_power_axis_struct s
left join pli_power_axis_struct_leader sl on s.ID = sl.STRUCT_REFERENCE_ID and sl.del_flag = '0'
left join pli_power_axis_leader l on l.ID = sl.LEADER_ID and l.del_flag = '0'
@ -66,16 +66,16 @@
<select id="queryDeptByName" resultType="com.epmet.plugin.power.dto.axis.result.PowerAxisStructResultDTO">
SELECT
CUSTOMER_ID,
NAME,
AGENCY_ID,
AGENCY_NAME,
AGENCY_TYPE,
PID,
PIDS,
CATEGORY_CODE
CUSTOMER_ID,
NAME,
AGENCY_ID,
AGENCY_NAME,
AGENCY_TYPE,
PID,
PIDS,
CATEGORY_CODE
FROM
pli_power_axis_struct
pli_power_axis_struct
<where>
1 = 1
<if test="name != null and name != ''">
@ -84,38 +84,38 @@
<if test="agencyId != null and agencyId != ''">
and AGENCY_ID = #{agencyId}
</if>
and del_flag = 0
and customer_id = #{customerId}
and del_flag = 0
and customer_id = #{customerId}
</where>
</select>
<select id="countRepeatStructByName" resultType="java.lang.Integer">
SELECT
count(*)
count(*)
FROM
pli_power_axis_struct s
pli_power_axis_struct s
WHERE
s.CUSTOMER_ID = #{customerId}
AND s.`NAME` = #{name}
<choose>
<when test="agencyId != null and agencyId != ''">AND s.AGENCY_ID = #{agencyId}</when>
<otherwise>
<if test="pid != null and pid != '' and pid != '0'">
AND s.AGENCY_ID = (SELECT t.agency_id FROM pli_power_axis_struct t WHERE t.ID = #{pid})
</if>
</otherwise>
</choose>
<if test="id != null and id != ''">AND s.ID != #{id}</if>
<if test="pid != null and pid != ''">AND s.pid = #{pid}</if>
s.CUSTOMER_ID = #{customerId}
AND s.`NAME` = #{name}
<choose>
<when test="agencyId != null and agencyId != ''">AND s.AGENCY_ID = #{agencyId}</when>
<otherwise>
<if test="pid != null and pid != '' and pid != '0'">
AND s.AGENCY_ID = (SELECT t.agency_id FROM pli_power_axis_struct t WHERE t.ID = #{pid})
</if>
</otherwise>
</choose>
<if test="id != null and id != ''">AND s.ID != #{id}</if>
<if test="pid != null and pid != ''">AND s.pid = #{pid}</if>
</select>
<select id="countRepeatStructByCategory" resultType="java.lang.Integer">
SELECT
count(*)
count(*)
FROM
pli_power_axis_struct
pli_power_axis_struct
WHERE
AGENCY_ID = #{agencyId} and CUSTOMER_ID = #{customerId} and CATEGORY_CODE = #{categoryCode}
<if test="id != null and id != ''">AND id != #{id}</if>
AGENCY_ID = #{agencyId} and CUSTOMER_ID = #{customerId} and CATEGORY_CODE = #{categoryCode}
<if test="id != null and id != ''">AND id != #{id}</if>
</select>
<select id="getIdsByAgencyId" resultType="java.lang.String">
select id from pli_power_axis_struct where agency_id = #{agencyId} and customer_id = #{customerId}
@ -144,16 +144,18 @@
AND
customer_id = #{customerId}
</select>
<select id="getKernelHouseHold" resultType="java.lang.Integer">
<select id="getServiceStation" resultType="java.lang.Integer">
SELECT
count( DISTINCT HOUSE_ID )
count(*)
FROM
pli_power_kernel_household
pli_power_service_station
WHERE
del_flag = '0'
</select>
<select id="getServiceStation" resultType="java.lang.Integer">
select count(*) from pli_power_service_station where del_flag = '0'
AND
AGENCY_ID = #{customerId}
AND
CUSTOMER_ID = #{customerId}
</select>
<select id="getStructTree"
resultType="com.epmet.plugin.power.dto.axis.result.PowerAxisStructTreeResultDTO">
@ -228,6 +230,18 @@
AND
STRUCT_LEVEL = #{level}
</select>
<select id="getKernelHouseHold" resultType="java.lang.Integer">
SELECT
count( DISTINCT HOUSE_ID )
FROM
pli_power_kernel_household
WHERE
del_flag = '0'
AND
AGENCY_ID = #{agencyId}
AND
CUSTOMER_ID = #{customerId}
</select>
</mapper>
Loading…
Cancel
Save