修改自定义sql中的sys_user
This commit is contained in:
parent
09de047a74
commit
0c432a60ca
@ -26,12 +26,12 @@ public interface LearnMessageDAO extends MyBatisBaseDao<LearnMessage, Long, Lear
|
||||
// "learn_message.unlike AS unlike,\n" +
|
||||
" learn_message.topping AS topping,\n" +
|
||||
" learn_message.user_name AS cgyUserName,\n" +
|
||||
" sys_user.nickname AS creatorNickName,\n" +
|
||||
" sys_user.avatar_path AS creatorAvatarPath\n" +
|
||||
" sys_account.nickname AS creatorNickName,\n" +
|
||||
" sys_account.avatar_path AS creatorAvatarPath\n" +
|
||||
// "learn_comment.id AS commentList\n" +
|
||||
"FROM\n" +
|
||||
" learn_message\n" +
|
||||
"LEFT JOIN sys_user ON learn_message.creator_id = sys_user.id\n" +
|
||||
"LEFT JOIN sys_account ON learn_message.creator_id = sys_account.id\n" +
|
||||
// "learn_comment\n" +
|
||||
"WHERE\n" +
|
||||
" learn_message.post_id = #{postId}\n" +
|
||||
|
@ -22,7 +22,7 @@ public interface RaceQuestionMocksStatsDAO extends MyBatisBaseDao<RaceQuestionMo
|
||||
"t.accuracy AS accuracy, " +
|
||||
"t.mock_time AS mockTime " +
|
||||
"FROM race_question_mocks_stats t " +
|
||||
"JOIN sys_user s ON s.id = t.user_id " +
|
||||
"JOIN sys_account s ON s.id = t.user_id " +
|
||||
"WHERE t.id in(SELECT SUBSTRING_INDEX (GROUP_CONCAT(id ORDER BY score DESC,accuracy DESC,mock_time),',',1) FROM race_question_mocks_stats where project_code = #{projectCode} GROUP BY user_id HAVING user_id IS NOT NULL) " +
|
||||
"ORDER BY t.score DESC,t.accuracy DESC,t.mock_time" +
|
||||
"</script>")
|
||||
|
@ -39,8 +39,8 @@ public interface SysAccountDAO extends MyBatisBaseDao<SysAccount, Long, SysAccou
|
||||
int batchInsert(@Param("list") List<SysAccount> userList);
|
||||
|
||||
@Select("<script>" +
|
||||
"SELECT COUNT(DISTINCT id) as 'quantity', DATE(sys_user.create_time) as 'date' " +
|
||||
" FROM sys_user " +
|
||||
"SELECT COUNT(DISTINCT id) as 'quantity', DATE(sys_account.create_time) as 'date' " +
|
||||
" FROM sys_account " +
|
||||
" WHERE 1=1 " +
|
||||
" AND DATE(create_time) BETWEEN #{beginDate} AND #{endDate}" +
|
||||
" GROUP BY DATE(create_time);" +
|
||||
@ -49,4 +49,4 @@ public interface SysAccountDAO extends MyBatisBaseDao<SysAccount, Long, SysAccou
|
||||
|
||||
List<AccountVO> queryUsersWithCompany(UserQueryVO queryVO);
|
||||
AccountVO queryUserWithCompany(@Param("userId") Long userId);
|
||||
}
|
||||
}
|
||||
|
@ -59,7 +59,7 @@ public interface TrainingDAO extends MyBatisBaseDao<Training, Long, TrainingExam
|
||||
"from user_training_stats ut " +
|
||||
"left join ls_lesson ls on ls.id = ut.lesson_id " +
|
||||
"left join training training on training.id = ut.training_id " +
|
||||
"left join sys_user user on user.id = ut.user_id " +
|
||||
"left join sys_account user on user.id = ut.user_id " +
|
||||
"where 1=1 " +
|
||||
"<when test=\"null != lessonName and '' != lessonName \"> and ls.name like CONCAT('%',#{lessonName},'%') </when>" +
|
||||
"<when test=\"null != trainingName and '' != trainingName \"> and training.name like CONCAT('%',#{trainingName},'%') </when>" +
|
||||
@ -145,4 +145,4 @@ public interface TrainingDAO extends MyBatisBaseDao<Training, Long, TrainingExam
|
||||
"WHERE " +
|
||||
"prd_id=#{prdId}")
|
||||
void fillPrdType(Long prdId, String prdType);
|
||||
}
|
||||
}
|
||||
|
@ -49,7 +49,7 @@ public interface UserExamMapper {
|
||||
"user.nickname as userNickname, " +
|
||||
"user.mobile as userMobile " +
|
||||
"from user_exam ue " +
|
||||
"left join sys_user user on ue.user_id = user.id " +
|
||||
"left join sys_account user on ue.user_id = user.id " +
|
||||
"where 1=1 " +
|
||||
"<when test=\"null != examName and '' != examName \"> and ue.exam_name like CONCAT('%',#{examName},'%') </when>" +
|
||||
"<when test=\"null != userName and '' != userName \"> and user.name like CONCAT('%',#{userName},'%') </when>" +
|
||||
@ -92,7 +92,7 @@ public interface UserExamMapper {
|
||||
"MAX(exam.score) as score, " +
|
||||
"user.nickname AS userNickname " +
|
||||
"FROM user_exam exam " +
|
||||
"LEFT JOIN sys_user user ON user.id = exam.user_id " +
|
||||
"LEFT JOIN sys_account user ON user.id = exam.user_id " +
|
||||
"WHERE exam.exam_id = #{examId} " +
|
||||
"AND result != 01 " +
|
||||
"GROUP BY exam.user_id, user.nickname " +
|
||||
|
@ -37,7 +37,7 @@ public interface UserPermissionDAO extends MyBatisBaseDao<UserPermission, Long,
|
||||
"up.create_time AS createTime " +
|
||||
"FROM " +
|
||||
"user_permission up " +
|
||||
"JOIN sys_user u ON up.user_id = u.id " +
|
||||
"JOIN sys_account u ON up.user_id = u.id " +
|
||||
"JOIN permission p ON up.permission_id = p.id " +
|
||||
"WHERE " +
|
||||
"1=1 " +
|
||||
|
@ -31,7 +31,7 @@ public interface UserSimulationStatsDAO extends MyBatisBaseDao<UserSimulationSta
|
||||
"m.name AS mapName, " +
|
||||
"s.fake AS fake " +
|
||||
"FROM user_simulation_stats s " +
|
||||
"LEFT JOIN sys_user u ON u.id = s.user_id " +
|
||||
"LEFT JOIN sys_account u ON u.id = s.user_id " +
|
||||
"LEFT JOIN map_info m ON m.id = s.map_id " +
|
||||
"<where>" +
|
||||
" <if test=\"queryVO.userName!=null and queryVO.userName!=''\"> " +
|
||||
@ -81,7 +81,7 @@ public interface UserSimulationStatsDAO extends MyBatisBaseDao<UserSimulationSta
|
||||
"s.user_id AS userId " +
|
||||
"FROM user_simulation_stats s " +
|
||||
"LEFT JOIN map_system m ON (m.map_id = s.map_id AND m.prd_type = s.prd_type) " +
|
||||
"LEFT JOIN sys_user u ON u.id = s.user_id " +
|
||||
"LEFT JOIN sys_account u ON u.id = s.user_id " +
|
||||
"WHERE s.map_id = #{mapId} " +
|
||||
"AND s.prd_type = #{prdType}" +
|
||||
"GROUP BY m.id, m.name, s.user_id, u.nickname " +
|
||||
|
@ -53,7 +53,7 @@ public interface UserTrainingStatsMapper {
|
||||
"u.nickname AS userNickname, " +
|
||||
"ut.user_id AS userId " +
|
||||
"FROM user_training_stats ut " +
|
||||
"LEFT JOIN sys_user u ON u.id = ut.user_id " +
|
||||
"LEFT JOIN sys_account u ON u.id = ut.user_id " +
|
||||
"WHERE ut.lesson_id = #{lessonId} " +
|
||||
"GROUP BY ut.lesson_id, u.nickname, ut.user_id " +
|
||||
"ORDER BY duration DESC, count DESC" +
|
||||
@ -66,7 +66,7 @@ public interface UserTrainingStatsMapper {
|
||||
"u.name AS username, " +
|
||||
"ut.user_id AS userId " +
|
||||
"FROM user_training_stats ut " +
|
||||
"LEFT JOIN sys_user u ON u.id = ut.user_id " +
|
||||
"LEFT JOIN sys_account u ON u.id = ut.user_id " +
|
||||
"WHERE u.id = #{userId} AND ut.finish_time >= #{startTime} AND ut.finish_time <= #{endTime} " +
|
||||
"AND ut.lesson_id IN" +
|
||||
"<foreach collection='lessonIds' item='lessonId' open='(' separator=',' close=')'>" +
|
||||
@ -80,7 +80,7 @@ public interface UserTrainingStatsMapper {
|
||||
// "u.name AS username, " +
|
||||
"ut.user_id AS userId " +
|
||||
"FROM user_training_stats ut " +
|
||||
// "LEFT JOIN sys_user u ON u.id = ut.user_id " +
|
||||
// "LEFT JOIN sys_account u ON u.id = ut.user_id " +
|
||||
"WHERE 1 = 1" +
|
||||
"<if test=\"startTime != null\">" +
|
||||
" AND ut.finish_time >= #{startTime}" +
|
||||
|
Loading…
Reference in New Issue
Block a user