Commit a5c7b749 authored by wujiang's avatar wujiang

添加电站管理省份查询和筛选

parent 27a3b654
......@@ -10,16 +10,16 @@ import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* Mapper 接口
* Mapper 接口
*
* @author system_generator
* @date 2023-07-15
*/
public interface PowerStationMapper extends BaseMapper<PowerStation> {
@UserEmpower(field ={"regional_companies_code"} ,dealerField={"developer_code","regional_companies_code","developer_user_id"} ,fieldConditions ={"in","in","in"}, relationship="and")
List<PowerStationDto> queryPage(@Param("powerStationCode") String powerStationCode,
@Param("ownersName")String ownersName,
@Param("serviceAgent")String serviceAgent,
@Param("regionalCompaniesName")String regionalCompaniesName,
@Param("processStatus")String processStatus);
@UserEmpower(field = { "regional_companies_code" }, dealerField = { "developer_code", "regional_companies_code",
"developer_user_id" }, fieldConditions = { "in", "in", "in" }, relationship = "and")
List<PowerStationDto> queryPage(@Param("powerStationCode") String powerStationCode,
@Param("ownersName") String ownersName, @Param("serviceAgent") String serviceAgent,
@Param("regionalCompaniesName") String regionalCompaniesName, @Param("processStatus") String processStatus,
@Param("province") String province);
}
......@@ -11,6 +11,7 @@
hygf_peasant_household.developer_code,
hygf_peasant_household.developer_user_id,
hygf_peasant_household.project_address_detail,
substring_index ( hygf_peasant_household.project_address_name, '/', 1 ) AS province,
b.stamp_status,
b.status
from hygf_power_station LEFT JOIN ( SELECT bb.peasant_household_id, initiate_status, contract_lock_id, stamp_status, status FROM (SELECT peasant_household_id,MAX(sequence_nbr) AS sequence_nbr from hygf_household_contract GROUP BY peasant_household_id ) aa LEFT JOIN hygf_household_contract bb ON aa.sequence_nbr=bb.sequence_nbr) b on b.peasant_household_id=hygf_power_station.peasant_household_id
......@@ -32,6 +33,9 @@
<if test="processStatus != null and processStatus != ''">
and hygf_power_station.process_status = #{processStatus}
</if>
<if test="province != null and province != ''">
and hygf_peasant_household.project_address like concat(concat('%',#{province}),'%')
</if>
<!-- GROUP BY hygf_peasant_household.sequence_nbr-->
ORDER BY hygf_power_station.rec_date desc
</select>
......
......@@ -104,12 +104,13 @@ public class PowerStationController extends BaseController {
@RequestParam(value = "ownersName",required = false)String ownersName,
@RequestParam(value = "serviceAgent",required = false)String serviceAgent,
@RequestParam(value = "processStatus",required = false) String processStatus,
@RequestParam(value = "regionalCompaniesName",required = false)String regionalCompaniesName) {
@RequestParam(value = "regionalCompaniesName",required = false)String regionalCompaniesName,
@RequestParam(value = "province",required = false)String province) {
Page<PowerStationDto> page = new Page<PowerStationDto>();
page.setCurrent(current);
page.setSize(size);
AgencyUserModel userInfo = getUserInfo();
return ResponseHelper.buildResponse(powerStationServiceImpl.queryForPowerStationUserRoles(page,powerStationCode,ownersName,userInfo,serviceAgent,regionalCompaniesName,processStatus));
return ResponseHelper.buildResponse(powerStationServiceImpl.queryForPowerStationUserRoles(page,powerStationCode,ownersName,userInfo,serviceAgent,regionalCompaniesName,processStatus,province));
}
/**
......
......@@ -96,7 +96,7 @@ public class PowerStationServiceImpl extends BaseService<PowerStationDto, PowerS
private RedisLockUtil redisLockUtil;
public Page<PowerStationDto> queryForPowerStationUserRoles(Page<PowerStationDto> page, String powerStationCode,
String ownersName, AgencyUserModel userInfo, String serviceAgent, String regionalCompaniesName, String processStatus) {
String ownersName, AgencyUserModel userInfo, String serviceAgent, String regionalCompaniesName, String processStatus,String province) {
// Map<Long, List<RoleModel>> orgRoles = userInfo.getOrgRoles();
// Collection<List<RoleModel>> roleModels = orgRoles.values();
// if(roleModels !=null){
......@@ -122,7 +122,7 @@ public class PowerStationServiceImpl extends BaseService<PowerStationDto, PowerS
// this.queryForPowerStationPage(page,powerStationCode,ownersName,serviceAgent);
Page<PowerStationDto> powerStationDtoPage = this.queryPage((int) page.getCurrent(), (int) page.getSize(), powerStationCode, ownersName,
serviceAgent, regionalCompaniesName, processStatus);
serviceAgent, regionalCompaniesName, processStatus,province);
if(powerStationDtoPage.getRecords() != null && powerStationDtoPage.getRecords().size() > 0) {
powerStationDtoPage.getRecords().forEach(e -> {
......@@ -140,10 +140,10 @@ public class PowerStationServiceImpl extends BaseService<PowerStationDto, PowerS
// 查询电站审核记录
public Page<PowerStationDto> queryPage(int current, int size, String powerStationCode, String ownersName,
String serviceAgent,String regionalCompaniesName,String processStatus) {
String serviceAgent,String regionalCompaniesName,String processStatus,String province) {
PageHelper.startPage(current, size);
List<PowerStationDto> list = powerStationMapper.queryPage(powerStationCode, ownersName, serviceAgent,regionalCompaniesName,processStatus);
List<PowerStationDto> list = powerStationMapper.queryPage(powerStationCode, ownersName, serviceAgent,regionalCompaniesName,processStatus,province);
PageInfo<PowerStationDto> pages = new PageInfo(list);
com.baomidou.mybatisplus.extension.plugins.pagination.Page<PowerStationDto> pagenew = new com.baomidou.mybatisplus.extension.plugins.pagination.Page<PowerStationDto>();
......
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