Commit 41b5f3ba authored by wujiang's avatar wujiang

添加电站过滤

parent cc46a3c6
......@@ -32,6 +32,9 @@ public class PowerStationDto extends BaseDto {
@ApiModelProperty(value = "服务代理商")
private String serviceAgent;
@ApiModelProperty(value = "区域公司")
private String regionalCompaniesName;
@ApiModelProperty(value = "电站类型")
private String powerStationType;
......
......@@ -19,5 +19,6 @@ public interface PowerStationMapper extends BaseMapper<PowerStation> {
@UserEmpower(field ={"regional_companies_code"} ,dealerField={"a.developer_code","a.regional_companies_code","a.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("serviceAgent")String serviceAgent,
@Param("regionalCompaniesName")String regionalCompaniesName);
}
......@@ -7,6 +7,7 @@
b.initiate_status,
b.contract_lock_id,
hygf_peasant_household.regional_companies_code,
hygf_peasant_household.regional_companies_name,
hygf_peasant_household.developer_code,
hygf_peasant_household.developer_user_id
from hygf_power_station LEFT JOIN ( select peasant_household_id,initiate_status, contract_lock_id from hygf_household_contract where hygf_household_contract.status !='已作废'
......@@ -21,7 +22,10 @@
and hygf_power_station.owners_name like concat(concat("%",#{ownersName}),"%")
</if>
<if test="serviceAgent!=null and serviceAgent!=''">
and hygf_power_station.service_agent=#{serviceAgent}
and hygf_power_station.service_agent like concat(concat("%",#{serviceAgent}),"%")
</if>
<if test="regionalCompaniesName!=null and regionalCompaniesName!=''">
and hygf_peasant_household.regional_companies_name like concat(concat("%",#{regionalCompaniesName}),"%")
</if>
ORDER BY hygf_power_station.rec_date desc
) a
......
......@@ -100,12 +100,14 @@ public class PowerStationController extends BaseController {
public ResponseModel<Page<PowerStationDto>> queryForPage(@RequestParam(value = "current") int current,
@RequestParam(value = "size") int size,
@RequestParam(value = "powerStationCode",required = false)String powerStationCode,
@RequestParam(value = "ownersName",required = false)String ownersName) {
@RequestParam(value = "ownersName",required = false)String ownersName,
@RequestParam(value = "serviceAgent",required = false)String serviceAgent,
@RequestParam(value = "regionalCompaniesName",required = false)String regionalCompaniesName) {
Page<PowerStationDto> page = new Page<PowerStationDto>();
page.setCurrent(current);
page.setSize(size);
AgencyUserModel userInfo = getUserInfo();
return ResponseHelper.buildResponse(powerStationServiceImpl.queryForPowerStationUserRoles(page,powerStationCode,ownersName,userInfo));
return ResponseHelper.buildResponse(powerStationServiceImpl.queryForPowerStationUserRoles(page,powerStationCode,ownersName,userInfo,serviceAgent,regionalCompaniesName));
}
/**
......
......@@ -84,8 +84,8 @@ public class PowerStationServiceImpl extends BaseService<PowerStationDto, PowerS
@Autowired
WorkflowImpl workflow;
public Page<PowerStationDto> queryForPowerStationUserRoles(Page<PowerStationDto> page, String powerStationCode, String ownersName, AgencyUserModel userInfo){
String serviceAgent =null;
public Page<PowerStationDto> queryForPowerStationUserRoles(Page<PowerStationDto> page, String powerStationCode,
String ownersName, AgencyUserModel userInfo, String serviceAgent, String regionalCompaniesName) {
// Map<Long, List<RoleModel>> orgRoles = userInfo.getOrgRoles();
// Collection<List<RoleModel>> roleModels = orgRoles.values();
// if(roleModels !=null){
......@@ -107,18 +107,18 @@ public class PowerStationServiceImpl extends BaseService<PowerStationDto, PowerS
// serviceAgent=userUnitInformationDto.getAmosDealerName();
// }
//return this.queryForPowerStationPage(page,powerStationCode,ownersName,serviceAgent);
return this.queryPage((int) page.getCurrent(), (int) page.getSize(),powerStationCode,ownersName,serviceAgent);
}
//查询电站审核记录
public Page<PowerStationDto> queryPage(int current, int size,
String powerStationCode,
String ownersName,String serviceAgent) {
// return
// this.queryForPowerStationPage(page,powerStationCode,ownersName,serviceAgent);
return this.queryPage((int) page.getCurrent(), (int) page.getSize(), powerStationCode, ownersName,
serviceAgent,regionalCompaniesName);
}
PageHelper.startPage(current, size);
List<PowerStationDto> list= powerStationMapper.queryPage(powerStationCode,ownersName,serviceAgent);
// 查询电站审核记录
public Page<PowerStationDto> queryPage(int current, int size, String powerStationCode, String ownersName,
String serviceAgent,String regionalCompaniesName) {
PageHelper.startPage(current, size);
List<PowerStationDto> list = powerStationMapper.queryPage(powerStationCode, ownersName, serviceAgent,regionalCompaniesName);
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