Commit 561a1f05 authored by chenhao's avatar chenhao

添加消防人员的excle导出数据帅选

parent d2f1c42b
...@@ -32,7 +32,8 @@ public interface FirefightersMapper extends BaseMapper<Firefighters> { ...@@ -32,7 +32,8 @@ public interface FirefightersMapper extends BaseMapper<Firefighters> {
List<FirefightersTreeDto> getFirefightersJobTitleCount(); List<FirefightersTreeDto> getFirefightersJobTitleCount();
List<FirefightersExcelDto> exportToExcel(Boolean isDelete);
List<String> getFirefightersName( ); List<String> getFirefightersName( );
List<FirefightersExcelDto> exportToExcel(Boolean isDelete, String name, String postQualification, String fireTeamId,
String state, String areasExpertise, String jobTitle);
} }
...@@ -151,10 +151,12 @@ LEFT JOIN cb_firefighters_education fe ON f.sequence_nbr = fe.firefighters_id ...@@ -151,10 +151,12 @@ LEFT JOIN cb_firefighters_education fe ON f.sequence_nbr = fe.firefighters_id
LEFT JOIN cb_firefighters_post fp ON f.sequence_nbr = fp.firefighters_id LEFT JOIN cb_firefighters_post fp ON f.sequence_nbr = fp.firefighters_id
WHERE WHERE
f.is_delete = 0 f.is_delete = 0
-- AND fc.is_delete = 0 <if test="name!=null and name !='-1' and name !=''">and f.`name` like concat('%',#{name},'%')</if>
-- AND fw.is_delete = 0 <if test='postQualification!=null'>and fp.post_qualification_code = #{postQualification}</if>
-- AND fe.is_delete = 0 <if test='fireTeamId !=null'>and f.fire_team_id = #{fireTeamId}</if>
-- AND fp.is_delete = 0 <if test='state !=null'>and f.state_code = #{state}</if>
<if test='areasExpertise!=null'>and fp.areas_expertise_code = #{areasExpertise}</if>
<if test='jobTitle!=null'>and f.job_title_code = #{jobTitle}</if>
</select> </select>
<select id="getFirefightersName" resultType="string"> <select id="getFirefightersName" resultType="string">
......
...@@ -29,6 +29,8 @@ import org.typroject.tyboot.core.restful.doc.TycloudOperation; ...@@ -29,6 +29,8 @@ import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper; import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import static org.hamcrest.CoreMatchers.nullValue;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
import java.util.Date; import java.util.Date;
...@@ -178,7 +180,7 @@ public class FireExpertsController extends BaseController { ...@@ -178,7 +180,7 @@ public class FireExpertsController extends BaseController {
@ApiOperation(httpMethod = "GET", value = "列表全部数据查询", notes = "列表全部数据查询") @ApiOperation(httpMethod = "GET", value = "列表全部数据查询", notes = "列表全部数据查询")
@GetMapping(value = "/list") @GetMapping(value = "/list")
public ResponseModel<List<FireExpertsDto>> selectForList() { public ResponseModel<List<FireExpertsDto>> selectForList() {
List<FireExpertsDto> fireExpertsDtoList = fireExpertsServiceImpl.queryForFireExpertsList(false); List<FireExpertsDto> fireExpertsDtoList = fireExpertsServiceImpl.queryForFireExpertsList(false,null,null);
fireExpertsDtoList.stream().map(item -> { fireExpertsDtoList.stream().map(item -> {
item.setAge(DateUtils.getAge(item.getBirthdayTime())); item.setAge(DateUtils.getAge(item.getBirthdayTime()));
return item; return item;
......
package com.yeejoin.amos.boot.module.common.biz.service.impl; package com.yeejoin.amos.boot.module.common.biz.service.impl;
import static org.hamcrest.CoreMatchers.nullValue;
import java.util.Collection; import java.util.Collection;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -96,8 +98,14 @@ public class FirefightersServiceImpl extends BaseService<FirefightersDto, Firefi ...@@ -96,8 +98,14 @@ public class FirefightersServiceImpl extends BaseService<FirefightersDto, Firefi
/** /**
* 导出列表 * 导出列表
*/ */
public List<FirefightersExcelDto> exportToExcel(@Condition(Operator.eq) Boolean isDelete) { public List<FirefightersExcelDto> exportToExcel(@Condition(Operator.eq) Boolean isDelete,Map par) {
return firefightersMapper.exportToExcel(isDelete); String name =par.containsKey("name")?par.get("name").toString():null;
String postQualification =par.containsKey("postQualification")?par.get("postQualification").toString():null;
String fireTeamId =par.containsKey("fireTeamId")?par.get("fireTeamId").toString():null;
String state =par.containsKey("state")?par.get("state").toString():null;
String areasExpertise =par.containsKey("areasExpertise")?par.get("areasExpertise").toString():null;
String jobTitle =par.containsKey("jobTitle")?par.get("jobTitle").toString():null;
return firefightersMapper.exportToExcel(isDelete,name,postQualification,fireTeamId,state,areasExpertise,jobTitle);
} }
......
...@@ -254,7 +254,7 @@ public class ExcelServiceImpl { ...@@ -254,7 +254,7 @@ public class ExcelServiceImpl {
FireStationDto.class, null, false); FireStationDto.class, null, false);
break; break;
case "XFRY": case "XFRY":
List<FirefightersExcelDto> firefightersExcelDtoList = firefightersService.exportToExcel(false); List<FirefightersExcelDto> firefightersExcelDtoList = firefightersService.exportToExcel(false, par);
ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(), ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(),
firefightersExcelDtoList, FirefightersExcelDto.class, null, false); firefightersExcelDtoList, FirefightersExcelDto.class, null, false);
break; break;
...@@ -1561,7 +1561,7 @@ public class ExcelServiceImpl { ...@@ -1561,7 +1561,7 @@ public class ExcelServiceImpl {
FireStationDto.class, null, false); FireStationDto.class, null, false);
break; break;
case "XFRY": case "XFRY":
List<FirefightersExcelDto> firefightersExcelDtoList = firefightersService.exportToExcel(false); List<FirefightersExcelDto> firefightersExcelDtoList = firefightersService.exportToExcel(false,null);
ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(), ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(),
firefightersExcelDtoList, FirefightersExcelDto.class, null, false); firefightersExcelDtoList, FirefightersExcelDto.class, null, false);
break; break;
......
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