Commit 2979a0b3 authored by chenzhao's avatar chenzhao

规则配置 查询接口

parent f15e4593
package com.yeejoin.amos.boot.module.common.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.common.api.dto.DutyPersonDto;
import com.yeejoin.amos.boot.module.common.api.entity.DutyPersonShift;
import org.apache.ibatis.annotations.Param;
......@@ -132,4 +133,6 @@ public interface DutyPersonShiftMapper extends BaseMapper<DutyPersonShift> {
Map<String, Object> getFireTeamBySequenceNbr (long sequenceNbr);
List<Map<String, Object>> getFirstAidForTypeCodeAndCompanyId(long company);
List<Map<String, Object>> queryByCompanyId(Long companyId);
}
......@@ -36,4 +36,6 @@ public interface FirefightersMapper extends BaseMapper<Firefighters> {
List<FirefightersExcelDto> exportToExcel(Boolean isDelete, String name, String postQualification, String fireTeamId,
String state, String areasExpertise, String jobTitle);
List<FirefightersDto> queryById(Long teamId,String[] gw);
}
......@@ -91,4 +91,6 @@ public interface OrgUsrMapper extends BaseMapper<OrgUsr> {
List< Map<String,String>> getPersonSimpleDetail();
List<Map<String, Long>> countDeptByCompanyId(@Param("companyIdList") List<String> companyIdList);
List<Map<String,Object>> queryCompanyId(Long id);
}
......@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.common.api.service;
import com.yeejoin.amos.boot.module.common.api.dto.DutyPersonDto;
import java.util.List;
import java.util.Map;
/**
* @author DELL
......@@ -32,4 +33,6 @@ public interface IDutyPersonService extends IDutyCommonService {
* @return
*/
List<DutyPersonDto> findByDutyAreaId(Long dutyAreaId);
List<Map<String, Object>> queryByCompanyId(Long companyId);
}
......@@ -341,4 +341,26 @@ AND cft.type_code = (
AND cft.company = #{company}
</select>
<select id='queryByCompanyId' resultType="map">
SELECT
e.field_code,
e.field_name,
e.field_value
FROM
cb_dynamic_form_instance e,
(SELECT
i.*
FROM
cb_dynamic_form_instance i
,
(SELECT * FROM `cb_duty_person_shift` where to_days(duty_date) = to_days(now())) b
WHERE
i.instance_id = b.instance_id
AND
i.field_code = 'deptId'
AND
i.field_value = #{companyId}) c
WHERE
e. instance_id = c.instance_id
</select>
</mapper>
......@@ -5,12 +5,12 @@
<select id="getFirefightersJobTitleCount"
resultType="com.yeejoin.amos.boot.biz.common.utils.FirefightersTreeDto">
select COUNT(a.sequence_nbr) num, a.job_title_code
select COUNT(a.sequence_nbr) num,
a.job_title_code
jobTitleCode
from cb_firefighters a
where a.is_delete = 0
GROUP BY
a.job_title_code
GROUP BY a.job_title_code
</select>
<!--消防队员列表按时间倒叙排列add desc 2021-09-08 by kongfm -->
<select id="getFirefighters"
......@@ -27,7 +27,9 @@
<if test='par.fireTeamId!=null'>and a.fire_team_id= #{par.fireTeamId}</if>
<if test='par.jobTitle!=null'>and a.job_title_code =#{par.jobTitle}</if>
<if
test='par.areasExpertiseCode!=null and par.areasExpertiseCode!="0"'>and b.areas_expertise_code =#{par.areasExpertiseCode}</if>
test='par.areasExpertiseCode!=null and par.areasExpertiseCode!="0"'>and b.areas_expertise_code
=#{par.areasExpertiseCode}
</if>
<if test='par.areasExpertiseCode=="0"'>and b.areas_expertise_code is not null</if>
ORDER BY a.rec_date desc limit #{pageNum},#{pageSize}
</select>
......@@ -43,7 +45,9 @@
<if test='par.fireTeamId!=null'>and a.fire_team_id= #{par.fireTeamId}</if>
<if test='par.jobTitle!=null'>and a.job_title_code =#{par.jobTitle}</if>
<if
test='par.areasExpertiseCode!=null and par.areasExpertiseCode!="0"'>and b.areas_expertise_code =#{par.areasExpertiseCode}</if>
test='par.areasExpertiseCode!=null and par.areasExpertiseCode!="0"'>and b.areas_expertise_code
=#{par.areasExpertiseCode}
</if>
<if test='par.areasExpertiseCode=="0"'>and b.areas_expertise_code is not null</if>
ORDER BY a.rec_date desc
......@@ -51,8 +55,7 @@
<select id="listToSelectById" resultType="Map">
SELECT
IFNULL(a.personnel_photos, '') personnelPhotos,
SELECT IFNULL(a.personnel_photos, '') personnelPhotos,
a.sequence_nbr
sequenceNbr,
IFNULL(a.`name`, '无') `name`,
......@@ -143,33 +146,45 @@
fe.school,
fe.professional_name,
fp.*
FROM
FROM
cb_firefighters f
LEFT JOIN cb_firefighters_contacts fc ON f.sequence_nbr = fc.firefighters_id
LEFT JOIN cb_firefighters_workexperience fw ON f.sequence_nbr = fw.firefighters_id
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
WHERE
LEFT JOIN cb_firefighters_contacts fc ON f.sequence_nbr = fc.firefighters_id
LEFT JOIN cb_firefighters_workexperience fw ON f.sequence_nbr = fw.firefighters_id
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
WHERE
f.is_delete = 0
<if test="name!=null and name !='-1' and name !=''">and f.`name` like concat('%',#{name},'%')</if>
<if test='postQualification!=null'>and fp.post_qualification_code = #{postQualification}</if>
<if test='fireTeamId !=null'>and f.fire_team_id = #{fireTeamId}</if>
<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>
<if test="name!=null and name !='-1' and name !=''">and f.`name` like concat('%',#{name},'%')</if>
<if test='postQualification!=null'>and fp.post_qualification_code = #{postQualification}</if>
<if test='fireTeamId !=null'>and f.fire_team_id = #{fireTeamId}</if>
<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 id="getFirefightersName" resultType="Map">
SELECT
cb_firefighters.name AS name,
SELECT cb_firefighters.name AS name,
IFNULL(cb_firefighters.mobile_phone, '') AS phone
FROM cb_firefighters
WHERE cb_firefighters.is_delete = 0
AND cb_firefighters.name IS NOT NULL
AND cb_firefighters.name != ''
group by cb_firefighters.name
</select>
<select id="queryById" resultType="com.yeejoin.amos.boot.module.common.api.dto.FirefightersDto">
SELECT
*
FROM
cb_firefighters
WHERE
cb_firefighters.is_delete = 0 AND
cb_firefighters.name IS NOT NULL AND
cb_firefighters.name != ''
group by cb_firefighters.name
fire_team_id = #{teamId}
<if test="gw != null">
And job_title_code In
<foreach item="item" collection="gw" index="index" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</select>
</mapper>
......@@ -685,4 +685,37 @@ LEFT JOIN (
#{companyId}
</foreach>
</select>
<select id="queryCompanyId" resultType="map">
SELECT
d.field_code ,
d.field_name ,
d.field_value ,
s.sequence_nbr,
s.biz_org_name,
s.parent_id
FROM
cb_dynamic_form_instance d ,
( SELECT
u.*
FROM
cb_org_usr u,
cb_dynamic_form_instance i
where
u.parent_id = #{id}
AND
u.is_delete = 0
AND
u.biz_org_type = 'PERSON'
AND
i.instance_id = u.sequence_nbr
AND
i.field_code = 'administrativePositionCode'
AND
i.field_value is not NULL ) s
WHERE
d.instance_id = s.sequence_nbr
AND
d.field_code = 'telephone'
</select>
</mapper>
......@@ -191,4 +191,18 @@ public class DutyPersonController extends BaseController {
return ResponseHelper.buildResponse(iDutyPersonService.findByDutyAreaId(dutyAreaId));
}
/**
*
*
* @return ResponseModel
*/
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@GetMapping(value = "/companyId/{companyId}")
@ApiOperation(httpMethod = "GET", value = "查询当日值班人员", notes = "查询当日值班人员")
public ResponseModel<List<Map<String, Object>>> queryByCompanyId(
@PathVariable Long companyId) throws Exception {
return ResponseHelper.buildResponse(iDutyPersonService.queryByCompanyId(companyId));
}
}
......@@ -267,4 +267,18 @@ public class OrgPersonController {
throw new RuntimeException("系统异常!");
}
}
/**
* 机场单位下 各单位下人员岗位不为空的人员
*
* @param id
* @return
*/
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/companyId/{id}", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "获取人员岗位不为空的人员详情", notes = "获取人员岗位不为空的人员详情")
public ResponseModel<Object> queryCompanyId(HttpServletRequest request,
@PathVariable Long id) throws Exception {
return ResponseHelper.buildResponse(iOrgUsrService.queryCompanyId(id));
}
}
......@@ -10,6 +10,7 @@ import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
import com.yeejoin.amos.boot.module.common.api.mapper.DutyPersonShiftMapper;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -37,6 +38,8 @@ public class DutyPersonServiceImpl extends DutyCommonServiceImpl implements IDut
@Autowired
EquipFeignClient equipFeign;
@Autowired
DutyPersonShiftMapper dutyPersonShiftMapper;
@Override
......@@ -297,8 +300,8 @@ public Object BuildScheduleDetails(String dutyDay, Long shiftId, String postType
}
}
......@@ -309,6 +312,9 @@ public Object BuildScheduleDetails(String dutyDay, Long shiftId, String postType
public List<Map<String, Object>> queryByCompanyId(Long companyId){
return dutyPersonShiftMapper.queryByCompanyId(companyId);
}
......
......@@ -129,7 +129,11 @@ public class FirefightersServiceImpl extends BaseService<FirefightersDto, Firefi
public List<Map<String,String>> getFirefightersName() {
return firefightersMapper.getFirefightersName();
}
public List<FirefightersDto> queryById(Long teamId,String[] gw){
return firefightersMapper.queryById(teamId,gw);
}
}
......@@ -1859,4 +1859,10 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
return resultMap;
}
public List<Map<String,Object>> queryCompanyId(Long id) {
return orgUsrMapper.queryCompanyId(id);
}
}
......@@ -94,6 +94,7 @@ public class FirefightersController extends BaseController {
@Value("${redis.cache.failure.time}")
private long time;
/**
* 新增消防队员
*
......@@ -332,4 +333,22 @@ public class FirefightersController extends BaseController {
return ResponseHelper.buildResponse(menus);
}
/**
*查询
*
* @param
* @return
* @throws Exception
*/
@TycloudOperation(needAuth = true, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/gw/{id}", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据id查询", notes = "根据id查询")
public ResponseModel<Object> queryById( @PathVariable Long teamId) throws Exception {
//规则提供岗位名称
String[] gw =new String[]{"1202","1203","1204","1205","1206","1207","1209","1208","1210","1211"};
return ResponseHelper.buildResponse(iFirefightersService.queryById(teamId,gw));
}
}
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