添加一个根据人员id查分包业绩的方法

This commit is contained in:
fl 2025-04-28 14:08:42 +08:00
parent 650598762e
commit 5f5137dfda
7 changed files with 58 additions and 6 deletions

View File

@ -136,4 +136,22 @@ public class TbSubPerfController extends BaseController {
log.info("导出失败{}",e.getMessage()); log.info("导出失败{}",e.getMessage());
} }
} }
/**
* 根据人员查询分包业绩管理列表
* @param
* @return
*/
@ApiOperation(value = "分包业绩管理列表查询")
// @PreAuthorize("@ss.hasPermi('key:people:list')")
@GetMapping("/getTbSubPerfListByPersonId")
public List<TbSubPerfVo> getTbSubPerfListByPersonId(TbSubPerfVo tbSubPerfVo) {
try {
return tbSubPerfService.getTbSubPerfListByPersonId(tbSubPerfVo);
}catch (Exception e){
log.info("分包业绩管理列表失败{}",e.getMessage());
return null;
}
}
} }

View File

@ -100,4 +100,9 @@ public class TbSubPerfVo {
* 附件集合 * 附件集合
*/ */
private List<TbFileSourceVo> tbFileSourceVoList; private List<TbFileSourceVo> tbFileSourceVoList;
/**
* 人员
*/
private Long personId;
} }

View File

@ -16,4 +16,6 @@ public interface TbSubPerfMapper {
void updateTbSubPerf(TbSubPerfVo tbSubPerfVo); void updateTbSubPerf(TbSubPerfVo tbSubPerfVo);
void delTbSubPerf(TbSubPerfVo tbSubPerfVo); void delTbSubPerf(TbSubPerfVo tbSubPerfVo);
List<TbSubPerfVo> getTbSubPerfListByPersonId(TbSubPerfVo tbSubPerfVo);
} }

View File

@ -39,4 +39,6 @@ public interface TbSubPerfService {
* @return * @return
*/ */
void delTbSubPerf(TbSubPerfVo tbSubPerfVo) throws Exception; void delTbSubPerf(TbSubPerfVo tbSubPerfVo) throws Exception;
List<TbSubPerfVo> getTbSubPerfListByPersonId(TbSubPerfVo tbSubPerfVo);
} }

View File

@ -153,4 +153,9 @@ public class TbSubPerfServiceImpl implements TbSubPerfService {
//删除关键人信息 //删除关键人信息
tbCompanyPerfRelService.delTbCompanyPerRelByPerfId(tbSubPerfVo.getId(),"2"); tbCompanyPerfRelService.delTbCompanyPerRelByPerfId(tbSubPerfVo.getId(),"2");
} }
@Override
public List<TbSubPerfVo> getTbSubPerfListByPersonId(TbSubPerfVo tbSubPerfVo) {
return tbSubPerfMapper.getTbSubPerfListByPersonId(tbSubPerfVo);
}
} }

View File

@ -64,7 +64,7 @@
from tb_company_perf where del_flag =0 from tb_company_perf where del_flag =0
<if test="proName != '' and proName != null">and pro_name = #{proName}</if> <if test="proName != '' and proName != null">and pro_name = #{proName}</if>
<if test="voltage != '' and voltage != null">and voltage = #{voltage}</if> <if test="voltage != '' and voltage != null">and voltage = #{voltage}</if>
<if test="startTime != null and test=endTime != null"> <if test="startTime != null and endTime != null">
and start_time BETWEEN STR_TO_DATE(#{startTime}, '%Y-%m-%d') AND STR_TO_DATE(#{endTime}, '%Y-%m-%d') and start_time BETWEEN STR_TO_DATE(#{startTime}, '%Y-%m-%d') AND STR_TO_DATE(#{endTime}, '%Y-%m-%d')
</if> </if>
@ -81,20 +81,19 @@
</select> </select>
<select id="getTbCompanyPerfListByPersonId" resultType="com.bonus.tool.dto.TbCompanyPerfVo"> <select id="getTbCompanyPerfListByPersonId" resultType="com.bonus.tool.dto.TbCompanyPerfVo">
select select
tkp.user_name as personName,
tcp.pro_name, tcp.pro_name,
tcp.start_time, tcp.start_time,
tcp.end_time, tcp.end_time,
tcp.voltage tcp.voltage
FROM FROM
tb_key_people tkp tb_key_people tkp
LEFT JOIN tb_company_perf_rel tcpr ON tcpr.key_user = tkp.id LEFT JOIN tb_company_perf_rel tcpr ON tcpr.key_user = tkp.id and tcpr.source = '1'
LEFT JOIN tb_company_perf tcp ON tcp.id = tcpr.perf_id and tcp.del_flag = 0 LEFT JOIN tb_company_perf tcp ON tcp.id = tcpr.perf_id and tcp.del_flag = 0
WHERE tkp.del_flag = 0 WHERE tkp.del_flag = 0 and tcp.id is not null
<if test="personId != '' and personId != null">and tkp.id = #{personId}</if> <if test="personId != '' and personId != null">and tkp.id = #{personId}</if>
<if test="proName != '' and proName != null">and tcp.pro_name = #{proName}</if> <if test="proName != '' and proName != null">and tcp.pro_name = #{proName}</if>
<if test="voltage != '' and voltage != null">and tcp.voltage = #{voltage}</if> <if test="voltage != '' and voltage != null">and tcp.voltage = #{voltage}</if>
<if test="startTime != null and test=endTime != null"> <if test="startTime != null and endTime != null">
and tcp.start_time BETWEEN STR_TO_DATE(#{startTime}, '%Y-%m-%d') AND STR_TO_DATE(#{endTime}, '%Y-%m-%d') and tcp.start_time BETWEEN STR_TO_DATE(#{startTime}, '%Y-%m-%d') AND STR_TO_DATE(#{endTime}, '%Y-%m-%d')
</if> </if>
</select> </select>

View File

@ -56,7 +56,9 @@
end_time as endTime,ht_remark as htRemark,money as money,voltage as voltage end_time as endTime,ht_remark as htRemark,money as money,voltage as voltage
from tb_sub_perf where del_flag=0 from tb_sub_perf where del_flag=0
<if test="proName != '' and proName != null">and pro_name = #{proName}</if> <if test="proName != '' and proName != null">and pro_name = #{proName}</if>
<if test="startTime != null and test=endTime != null"> <if test="subId != '' and subId != null">and sub_id = #{subId}</if>
<if test="voltage != '' and voltage != null">and voltage = #{voltage}</if>
<if test="startTime != null and endTime != null">
and start_time BETWEEN STR_TO_DATE(#{startTime}, '%Y-%m-%d') AND STR_TO_DATE(#{endTime}, '%Y-%m-%d') and start_time BETWEEN STR_TO_DATE(#{startTime}, '%Y-%m-%d') AND STR_TO_DATE(#{endTime}, '%Y-%m-%d')
</if> </if>
</select> </select>
@ -70,4 +72,23 @@
end_time as endTime,ht_remark as htRemark,money as money,voltage as voltage end_time as endTime,ht_remark as htRemark,money as money,voltage as voltage
from tb_sub_perf where pro_name=#{proName} and sub_id=#{subId} and del_flag=0 from tb_sub_perf where pro_name=#{proName} and sub_id=#{subId} and del_flag=0
</select> </select>
<select id="getTbSubPerfListByPersonId" resultType="com.bonus.tool.dto.TbSubPerfVo">
select
tcp.pro_name,
tcp.start_time,
tcp.end_time,
tcp.voltage
FROM
tb_sub_people tsp
LEFT JOIN tb_company_perf_rel tcpr ON tcpr.key_user = tsp.id and source = '2'
LEFT JOIN tb_sub_perf tcp ON tcp.id = tcpr.perf_id and tcp.del_flag = 0
WHERE tsp.del_flag = 0 and tcp.id is not null
<if test="personId != '' and personId != null">and tsp.id = #{personId}</if>
<if test="proName != '' and proName != null">and tcp.pro_name = #{proName}</if>
<if test="subId != '' and subId != null">and tcp.sub_id = #{subId}</if>
<if test="voltage != '' and voltage != null">and tcp.voltage = #{voltage}</if>
<if test="startTime != null and endTime != null">
and tcp.start_time BETWEEN STR_TO_DATE(#{startTime}, '%Y-%m-%d') AND STR_TO_DATE(#{endTime}, '%Y-%m-%d')
</if>
</select>
</mapper> </mapper>