This commit is contained in:
2026-02-28 23:19:07 +08:00
parent 4aa6a8ff6a
commit 37cdfe2b68
8 changed files with 11304 additions and 7 deletions

View File

@@ -156,8 +156,8 @@ VALUES
INSERT INTO family_elder(family_id, elder_id, relationship)
VALUES
(3, 1, '儿子'),
(3, 2, '女儿');
(4, 1, '儿子'),
(4, 2, '女儿');
INSERT INTO schedule(nurse_id, date, shift, task)
VALUES

View File

@@ -11,6 +11,6 @@ public interface NoticeMapper {
@Options(useGeneratedKeys = true, keyProperty = "id")
int insert(Notice notice);
@Select("<script>SELECT * FROM notice WHERE 1=1 <if test='targetUserId != null'> AND target_user_id = #{targetUserId}</if> <if test='targetRole != null'> AND (target_role = #{targetRole} OR target_role = 'ALL')</if> ORDER BY created_at DESC</script>")
@Select("<script>SELECT * FROM notice WHERE 1=1 <if test='targetUserId != null'> AND (target_user_id = #{targetUserId} OR target_user_id IS NULL)</if> <if test='targetRole != null'> AND (target_role = #{targetRole} OR target_role = 'ALL')</if> ORDER BY created_at DESC</script>")
List<Notice> listByTarget(@Param("targetRole") String targetRole, @Param("targetUserId") Long targetUserId);
}

View File

@@ -3,7 +3,7 @@ server:
spring:
datasource:
url: jdbc:mysql://localhost:3307/nursing_home?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai
url: jdbc:mysql://localhost:3306/nursing_home?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai
username: root
password: qq5211314
driver-class-name: com.mysql.cj.jdbc.Driver