修改自定义sql中的sys_user

This commit is contained in:
joylink_zhangsai 2021-06-10 11:10:31 +08:00
parent 09de047a74
commit 0c432a60ca
8 changed files with 17 additions and 17 deletions

View File

@ -26,12 +26,12 @@ public interface LearnMessageDAO extends MyBatisBaseDao<LearnMessage, Long, Lear
// "learn_message.unlike AS unlike,\n" + // "learn_message.unlike AS unlike,\n" +
" learn_message.topping AS topping,\n" + " learn_message.topping AS topping,\n" +
" learn_message.user_name AS cgyUserName,\n" + " learn_message.user_name AS cgyUserName,\n" +
" sys_user.nickname AS creatorNickName,\n" + " sys_account.nickname AS creatorNickName,\n" +
" sys_user.avatar_path AS creatorAvatarPath\n" + " sys_account.avatar_path AS creatorAvatarPath\n" +
// "learn_comment.id AS commentList\n" + // "learn_comment.id AS commentList\n" +
"FROM\n" + "FROM\n" +
" learn_message\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" + // "learn_comment\n" +
"WHERE\n" + "WHERE\n" +
" learn_message.post_id = #{postId}\n" + " learn_message.post_id = #{postId}\n" +

View File

@ -22,7 +22,7 @@ public interface RaceQuestionMocksStatsDAO extends MyBatisBaseDao<RaceQuestionMo
"t.accuracy AS accuracy, " + "t.accuracy AS accuracy, " +
"t.mock_time AS mockTime " + "t.mock_time AS mockTime " +
"FROM race_question_mocks_stats t " + "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) " + "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" + "ORDER BY t.score DESC,t.accuracy DESC,t.mock_time" +
"</script>") "</script>")

View File

@ -39,8 +39,8 @@ public interface SysAccountDAO extends MyBatisBaseDao<SysAccount, Long, SysAccou
int batchInsert(@Param("list") List<SysAccount> userList); int batchInsert(@Param("list") List<SysAccount> userList);
@Select("<script>" + @Select("<script>" +
"SELECT COUNT(DISTINCT id) as 'quantity', DATE(sys_user.create_time) as 'date' " + "SELECT COUNT(DISTINCT id) as 'quantity', DATE(sys_account.create_time) as 'date' " +
" FROM sys_user " + " FROM sys_account " +
" WHERE 1=1 " + " WHERE 1=1 " +
" AND DATE(create_time) BETWEEN #{beginDate} AND #{endDate}" + " AND DATE(create_time) BETWEEN #{beginDate} AND #{endDate}" +
" GROUP BY DATE(create_time);" + " GROUP BY DATE(create_time);" +

View File

@ -59,7 +59,7 @@ public interface TrainingDAO extends MyBatisBaseDao<Training, Long, TrainingExam
"from user_training_stats ut " + "from user_training_stats ut " +
"left join ls_lesson ls on ls.id = ut.lesson_id " + "left join ls_lesson ls on ls.id = ut.lesson_id " +
"left join training training on training.id = ut.training_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 " + "where 1=1 " +
"<when test=\"null != lessonName and '' != lessonName \"> and ls.name like CONCAT('%',#{lessonName},'%') </when>" + "<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>" + "<when test=\"null != trainingName and '' != trainingName \"> and training.name like CONCAT('%',#{trainingName},'%') </when>" +

View File

@ -49,7 +49,7 @@ public interface UserExamMapper {
"user.nickname as userNickname, " + "user.nickname as userNickname, " +
"user.mobile as userMobile " + "user.mobile as userMobile " +
"from user_exam ue " + "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 " + "where 1=1 " +
"<when test=\"null != examName and '' != examName \"> and ue.exam_name like CONCAT('%',#{examName},'%') </when>" + "<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>" + "<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, " + "MAX(exam.score) as score, " +
"user.nickname AS userNickname " + "user.nickname AS userNickname " +
"FROM user_exam exam " + "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} " + "WHERE exam.exam_id = #{examId} " +
"AND result != 01 " + "AND result != 01 " +
"GROUP BY exam.user_id, user.nickname " + "GROUP BY exam.user_id, user.nickname " +

View File

@ -37,7 +37,7 @@ public interface UserPermissionDAO extends MyBatisBaseDao<UserPermission, Long,
"up.create_time AS createTime " + "up.create_time AS createTime " +
"FROM " + "FROM " +
"user_permission up " + "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 " + "JOIN permission p ON up.permission_id = p.id " +
"WHERE " + "WHERE " +
"1=1 " + "1=1 " +

View File

@ -31,7 +31,7 @@ public interface UserSimulationStatsDAO extends MyBatisBaseDao<UserSimulationSta
"m.name AS mapName, " + "m.name AS mapName, " +
"s.fake AS fake " + "s.fake AS fake " +
"FROM user_simulation_stats s " + "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 " + "LEFT JOIN map_info m ON m.id = s.map_id " +
"<where>" + "<where>" +
" <if test=\"queryVO.userName!=null and queryVO.userName!=''\"> " + " <if test=\"queryVO.userName!=null and queryVO.userName!=''\"> " +
@ -81,7 +81,7 @@ public interface UserSimulationStatsDAO extends MyBatisBaseDao<UserSimulationSta
"s.user_id AS userId " + "s.user_id AS userId " +
"FROM user_simulation_stats s " + "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 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} " + "WHERE s.map_id = #{mapId} " +
"AND s.prd_type = #{prdType}" + "AND s.prd_type = #{prdType}" +
"GROUP BY m.id, m.name, s.user_id, u.nickname " + "GROUP BY m.id, m.name, s.user_id, u.nickname " +

View File

@ -53,7 +53,7 @@ public interface UserTrainingStatsMapper {
"u.nickname AS userNickname, " + "u.nickname AS userNickname, " +
"ut.user_id AS userId " + "ut.user_id AS userId " +
"FROM user_training_stats ut " + "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} " + "WHERE ut.lesson_id = #{lessonId} " +
"GROUP BY ut.lesson_id, u.nickname, ut.user_id " + "GROUP BY ut.lesson_id, u.nickname, ut.user_id " +
"ORDER BY duration DESC, count DESC" + "ORDER BY duration DESC, count DESC" +
@ -66,7 +66,7 @@ public interface UserTrainingStatsMapper {
"u.name AS username, " + "u.name AS username, " +
"ut.user_id AS userId " + "ut.user_id AS userId " +
"FROM user_training_stats ut " + "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 &gt;= #{startTime} AND ut.finish_time &lt;= #{endTime} " + "WHERE u.id = #{userId} AND ut.finish_time &gt;= #{startTime} AND ut.finish_time &lt;= #{endTime} " +
"AND ut.lesson_id IN" + "AND ut.lesson_id IN" +
"<foreach collection='lessonIds' item='lessonId' open='(' separator=',' close=')'>" + "<foreach collection='lessonIds' item='lessonId' open='(' separator=',' close=')'>" +
@ -80,7 +80,7 @@ public interface UserTrainingStatsMapper {
// "u.name AS username, " + // "u.name AS username, " +
"ut.user_id AS userId " + "ut.user_id AS userId " +
"FROM user_training_stats ut " + "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" + "WHERE 1 = 1" +
"<if test=\"startTime != null\">" + "<if test=\"startTime != null\">" +
" AND ut.finish_time &gt;= #{startTime}" + " AND ut.finish_time &gt;= #{startTime}" +