查询bug
All checks were successful
JslGroup/JslDeveloper/JSL_OrganizeInternalOA/pipeline/head This commit looks good

This commit is contained in:
176yunxuan 2024-03-17 08:35:33 +08:00
parent 14c726cb9a
commit 5e1da6b079
3 changed files with 9 additions and 3 deletions

View File

@ -29,4 +29,8 @@ public interface ModuleMapper {
@Select("select * from organize_oa.oa_project_work where pid=#{id} and is_delete=0 and type=1 ") @Select("select * from organize_oa.oa_project_work where pid=#{id} and is_delete=0 and type=1 ")
List<ProjectWorkDO> getAllMoudleByPid(Long id); List<ProjectWorkDO> getAllMoudleByPid(Long id);
@Select("select principal_id from organize_oa.oa_project where id=(select project_id " +
"from organize_oa.oa_project_work where oa_project_work.id = #{sysId})")
Long getPridBySysyid(Integer sysId);
} }

View File

@ -52,9 +52,11 @@ public class ModuleServiceImpl implements ModuleService {
Long userId = Processing.getAuthHeaderToUserId(request); Long userId = Processing.getAuthHeaderToUserId(request);
//获取子系统负责人id //获取子系统负责人id
Long pid = moduleMapper.getPidBySysid(sysId); Long pid = moduleMapper.getPidBySysid(sysId);
//判断是否是子系统负责人 //获取项目负责人id
Long prid = moduleMapper.getPridBySysyid(sysId);
//判断是否是子系统/项目负责人
int is = 1; int is = 1;
if(!pid.equals(userId)){ if(!pid.equals(userId) && !prid.equals(userId)){
is = 0; is = 0;
} }

View File

@ -15,7 +15,7 @@
<select id="getBySysId" resultType="com.jsl.oa.model.doData.ProjectWorkDO"> <select id="getBySysId" resultType="com.jsl.oa.model.doData.ProjectWorkDO">
select * from organize_oa.oa_project_work where pid=#{sysId} and type=1 select * from organize_oa.oa_project_work where pid=#{sysId} and type=1
<if test="is != 1 "> <if test="is != 1 ">
and principal_id=#{userId} and (principal_id=#{userId} or principal_id is null)
</if> </if>
</select> </select>
</mapper> </mapper>