修正xml文件的部分bug
This commit is contained in:
parent
ec45c0b233
commit
49247fd88f
|
@ -108,9 +108,18 @@ public interface ProjectMapper {
|
|||
+ "where DATE(deadline) = DATE(#{threeDayLater}) and is_finish != 1")
|
||||
List<ProjectWorkDO> getProjectWorkByTime(LocalDateTime threeDayLater);
|
||||
|
||||
@Select("select * from organize_oa.oa_project_work where "
|
||||
+ "principal_id=#{uid} "
|
||||
+ "AND is_delete = 0 AND type = 1")
|
||||
List<ProjectWorkDO> getAllSubmoduleByUserId(Long uid);
|
||||
|
||||
List<ProjectDO> getProjectByPrincipalUser(Long uid);
|
||||
|
||||
@Select("select * from organize_oa.oa_project_work where "
|
||||
+ "principal_id=#{uid} "
|
||||
+ "AND is_delete = 0 AND type = 0")
|
||||
List<ProjectWorkDO> getAllSubsystemByUserId(Long uid);
|
||||
|
||||
@Select("select * from organize_oa.oa_project where "
|
||||
+ "principal_id=#{uid} "
|
||||
+ "AND is_delete = 0")
|
||||
List<ProjectDO> getProjectByPrincipalUser(Long uid);
|
||||
}
|
||||
|
|
|
@ -8,11 +8,11 @@ import java.util.List;
|
|||
@Mapper
|
||||
public interface ReviewMapper {
|
||||
|
||||
@Select("SELECT * FROM organize_oa.oa_review WHERE project_id = #{projectId}"
|
||||
@Select("SELECT * FROM organize_oa.oa_review WHERE project_id = #{projectId} "
|
||||
+ "AND is_delete = 0")
|
||||
List<ReviewDO> selectAllReviewFromProject(Long projectId);
|
||||
|
||||
@Select("SELECT * FROM organize_oa.oa_review WHERE project_id = #{projectId}"
|
||||
@Select("SELECT * FROM organize_oa.oa_review WHERE project_id = #{projectId} "
|
||||
+ "AND is_delete = 0 AND review_result = #{result}")
|
||||
List<ReviewDO> selectApprovedResultReviewFromProject(Long projectId, short result);
|
||||
|
||||
|
|
|
@ -93,7 +93,6 @@ public class ReviewServiceImpl implements ReviewService {
|
|||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public BaseResponse getUserReview(HttpServletRequest request) {
|
||||
log.info("\t> 执行 Service 层 ReviewService.getUserReview 方法");
|
||||
|
@ -147,7 +146,6 @@ public class ReviewServiceImpl implements ReviewService {
|
|||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public BaseResponse addReview(ReviewAddVO reviewAddVO, HttpServletRequest request) {
|
||||
log.info("\t> 执行 Service 层 ReviewService.addReview 方法");
|
||||
|
@ -176,7 +174,6 @@ public class ReviewServiceImpl implements ReviewService {
|
|||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public BaseResponse updateReviewResult(ReviewUpdateResultVO reviewUpdateResultVO, HttpServletRequest request) {
|
||||
|
||||
|
@ -216,14 +213,19 @@ public class ReviewServiceImpl implements ReviewService {
|
|||
ReviewVO reviewVO = new ReviewVO();
|
||||
// 现将相同的属性赋值
|
||||
Processing.copyProperties(reviewDO, reviewVO);
|
||||
// 赋值其他属性
|
||||
// 赋值其他非空属性
|
||||
reviewVO.setCategory(Processing.turnReviewCategory(reviewDO.getCategory()))
|
||||
.setSenderName(userMapper.getUserById(reviewDO.getSenderId()).getNickname())
|
||||
.setRecipientName(userMapper.getUserById(reviewDO.getRecipientId()).getNickname())
|
||||
.setProjectName(projectDAO.getProjectById(reviewDO.getProjectId()).getName())
|
||||
.setSubsystemName(reviewDAO.getNameBySubproject(reviewDO.getProjectSubsystemId()))
|
||||
.setSubmoduleName(reviewDAO.getNameBySubproject(reviewDO.getProjectSubmoduleId()))
|
||||
.setResult(Processing.turnReviewResult(reviewDO.getReviewResult()));
|
||||
// 赋值可为空属性并进行判断
|
||||
if (reviewDO.getRecipientId() != null) {
|
||||
reviewVO.setRecipientName(userMapper.getUserById(reviewDO.getRecipientId()).getNickname());
|
||||
}
|
||||
if (reviewDO.getProjectSubmoduleId() != null) {
|
||||
reviewVO.setSubmoduleName(reviewDAO.getNameBySubproject(reviewDO.getProjectSubmoduleId()));
|
||||
}
|
||||
// 将封装好的结果添加到结果集
|
||||
resultData.add(reviewVO);
|
||||
}
|
||||
|
@ -232,9 +234,6 @@ public class ReviewServiceImpl implements ReviewService {
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -4,67 +4,90 @@
|
|||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<mapper namespace="com.jsl.oa.mapper.ReviewMapper">
|
||||
<insert id="addReview">
|
||||
insert into organize_oa.oa_review
|
||||
<set>
|
||||
|
||||
<insert id="addReview" >
|
||||
INSERT INTO organize_oa.oa_review
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null and name != ''">
|
||||
name = #{name},
|
||||
name,
|
||||
</if>
|
||||
|
||||
<if test="content != null and content != ''">
|
||||
content = #{content},
|
||||
content,
|
||||
</if>
|
||||
|
||||
<if test="sender_id != null">
|
||||
sender_id = #{sender_id},
|
||||
<if test="senderId != null">
|
||||
sender_id,
|
||||
</if>
|
||||
|
||||
<if test="recipient_id != null">
|
||||
recipient_id = #{recipient_id},
|
||||
<if test="recipientId != null">
|
||||
recipient_id,
|
||||
</if>
|
||||
|
||||
<if test="category != null">
|
||||
category = #{category},
|
||||
category,
|
||||
</if>
|
||||
|
||||
<if test="project_id != null">
|
||||
project_id = #{project_id},
|
||||
<if test="projectId != null">
|
||||
project_id,
|
||||
</if>
|
||||
|
||||
<if test="project_subsystem_id != null">
|
||||
project_subsystem_id = #{project_subsystem_id},
|
||||
<if test="projectSubsystemId != null">
|
||||
project_subsystem_id,
|
||||
</if>
|
||||
|
||||
<if test="project_submodule_id != null">
|
||||
project_submodule_id = #{project_submodule_id},
|
||||
<if test="projectSubmoduleId != null">
|
||||
project_submodule_id,
|
||||
</if>
|
||||
|
||||
<if test="application_time != null">
|
||||
application_time = #{application_time},
|
||||
<if test="applicationTime != null">
|
||||
application_time,
|
||||
</if>
|
||||
|
||||
<if test="review_time != null">
|
||||
review_time = #{review_time},
|
||||
<if test="reviewTime != null">
|
||||
review_time,
|
||||
</if>
|
||||
|
||||
<if test="review_result != null">
|
||||
review_result = #{review_result},
|
||||
<if test="reviewResult != null">
|
||||
review_result,
|
||||
</if>
|
||||
|
||||
<if test="is_delete != null">
|
||||
is_delete = #{is_delete},
|
||||
<if test="isDelete != null">
|
||||
is_delete,
|
||||
</if>
|
||||
|
||||
</set>
|
||||
where id = #{id}
|
||||
</trim>
|
||||
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null and name != ''">
|
||||
#{name},
|
||||
</if>
|
||||
<if test="content != null and content != ''">
|
||||
#{content},
|
||||
</if>
|
||||
<if test="senderId != null">
|
||||
#{senderId},
|
||||
</if>
|
||||
<if test="recipientId != null">
|
||||
#{recipientId},
|
||||
</if>
|
||||
<if test="category != null">
|
||||
#{category},
|
||||
</if>
|
||||
<if test="projectId != null">
|
||||
#{projectId},
|
||||
</if>
|
||||
<if test="projectSubsystemId != null">
|
||||
#{projectSubsystemId},
|
||||
</if>
|
||||
<if test="projectSubmoduleId != null">
|
||||
#{projectSubmoduleId},
|
||||
</if>
|
||||
<if test="applicationTime != null">
|
||||
#{applicationTime},
|
||||
</if>
|
||||
<if test="reviewTime != null">
|
||||
#{reviewTime},
|
||||
</if>
|
||||
<if test="reviewResult != null">
|
||||
#{reviewResult},
|
||||
</if>
|
||||
<if test="isDelete != null">
|
||||
#{isDelete},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
|
||||
<update id="updateReview" parameterType="com.jsl.oa.model.dodata.ReviewDO">
|
||||
update organize_oa.oa_review
|
||||
<set>
|
||||
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="name != null and name != ''">
|
||||
name = #{name},
|
||||
</if>
|
||||
|
@ -73,49 +96,50 @@
|
|||
content = #{content},
|
||||
</if>
|
||||
|
||||
<if test="sender_id != null">
|
||||
sender_id = #{sender_id},
|
||||
<if test="senderId != null">
|
||||
sender_id = #{senderId},
|
||||
</if>
|
||||
|
||||
<if test="recipient_id != null">
|
||||
recipient_id = #{recipient_id},
|
||||
<if test="recipientId != null">
|
||||
recipient_id = #{recipientId},
|
||||
</if>
|
||||
|
||||
<if test="category != null">
|
||||
category = #{category},
|
||||
</if>
|
||||
|
||||
<if test="project_id != null">
|
||||
project_id = #{project_id},
|
||||
<if test="projectId != null">
|
||||
project_id = #{projectId},
|
||||
</if>
|
||||
|
||||
<if test="project_subsystem_id != null">
|
||||
project_subsystem_id = #{project_subsystem_id},
|
||||
<if test="projectSubsystemId != null">
|
||||
project_subsystem_id = #{projectSubsystemId},
|
||||
</if>
|
||||
|
||||
<if test="project_submodule_id != null">
|
||||
project_submodule_id = #{project_submodule_id},
|
||||
<if test="projectSubmoduleId != null">
|
||||
project_submodule_id = #{projectSubmoduleId},
|
||||
</if>
|
||||
|
||||
<if test="application_time != null">
|
||||
application_time = #{application_time},
|
||||
<if test="applicationTime != null">
|
||||
application_time = #{applicationTime},
|
||||
</if>
|
||||
|
||||
<if test="review_time != null">
|
||||
review_time = #{review_time},
|
||||
<if test="reviewTime != null">
|
||||
review_time = #{reviewTime},
|
||||
</if>
|
||||
|
||||
<if test="review_result != null">
|
||||
review_result = #{review_result},
|
||||
<if test="reviewResult != null">
|
||||
review_result = #{reviewResult},
|
||||
</if>
|
||||
|
||||
<if test="is_delete != null">
|
||||
is_delete = #{is_delete},
|
||||
<if test="isDelete != null">
|
||||
is_delete = #{isDelete},
|
||||
</if>
|
||||
|
||||
</set>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
|
||||
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue
Block a user