build: 优化模块命名 continew-webapi => continew-server,continew-module-system => continew-system

This commit is contained in:
2025-06-14 21:08:38 +08:00
parent 23fbb3d877
commit 71fee0f58d
291 changed files with 29 additions and 29 deletions

View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="top.continew.admin.system.mapper.DeptMapper">
</mapper>

View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="top.continew.admin.system.mapper.DictItemMapper">
<select id="listByDictCode" resultType="top.continew.starter.extension.crud.model.resp.LabelValueResp">
SELECT t1.label, t1.value, t1.color AS extra
FROM sys_dict_item AS t1
LEFT JOIN sys_dict AS t2 ON t1.dict_id = t2.id
WHERE t1.status = 1 AND t2.code = #{dictCode}
ORDER BY t1.sort
</select>
</mapper>

View File

@@ -0,0 +1,155 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="top.continew.admin.system.mapper.LogMapper">
<select id="selectLogPage" resultType="top.continew.admin.system.model.resp.log.LogResp">
SELECT
t1.id,
t1.description,
t1.module,
t1.time_taken,
t1.ip,
t1.address,
t1.browser,
t1.os,
t1.status,
t1.error_msg,
t1.create_user,
t1.create_time,
t2.nickname AS createUserString
FROM sys_log AS t1
LEFT JOIN sys_user AS t2 ON t2.id = t1.create_user
${ew.customSqlSegment}
</select>
<select id="selectLogList" resultType="top.continew.admin.system.model.resp.log.LogResp">
SELECT
t1.id,
t1.description,
t1.module,
t1.time_taken,
t1.ip,
t1.address,
t1.browser,
t1.os,
t1.status,
t1.error_msg,
t1.create_user,
t1.create_time,
t2.nickname AS createUserString
FROM sys_log AS t1
LEFT JOIN sys_user AS t2 ON t2.id = t1.create_user
${ew.customSqlSegment}
</select>
<select id="selectDashboardOverviewPv" resultType="top.continew.admin.system.model.resp.dashboard.DashboardOverviewCommonResp">
SELECT
(SELECT COUNT(*) FROM sys_log) AS total,
(SELECT COUNT(*) FROM sys_log WHERE create_time >= CURDATE() AND create_time &lt; DATE_ADD(CURDATE(), INTERVAL 1 DAY)) AS today,
(SELECT COUNT(*) FROM sys_log WHERE create_time >= DATE_SUB(CURDATE(), INTERVAL 1 DAY) AND create_time &lt; CURDATE()) AS yesterday
</select>
<select id="selectDashboardOverviewIp" resultType="top.continew.admin.system.model.resp.dashboard.DashboardOverviewCommonResp">
SELECT
(SELECT COUNT(DISTINCT ip) FROM sys_log) AS total,
(SELECT COUNT(DISTINCT ip) FROM sys_log WHERE create_time >= CURDATE() AND create_time &lt; DATE_ADD(CURDATE(), INTERVAL 1 DAY)) AS today,
(SELECT COUNT(DISTINCT ip) FROM sys_log WHERE create_time >= DATE_SUB(CURDATE(), INTERVAL 1 DAY) AND create_time &lt; CURDATE()) AS yesterday
</select>
<select id="selectListDashboardAnalysisPv"
resultType="top.continew.admin.system.model.resp.dashboard.DashboardChartCommonResp">
SELECT
DATE_FORMAT(create_time, '%Y-%m') AS name,
COUNT(*) AS value
FROM sys_log
WHERE DATE_FORMAT(create_time, '%Y-%m' ) IN
<foreach collection="months" item="month" separator="," open="(" close=")">
#{month}
</foreach>
GROUP BY name
ORDER BY name
</select>
<select id="selectListDashboardAnalysisIp"
resultType="top.continew.admin.system.model.resp.dashboard.DashboardChartCommonResp">
SELECT
DATE_FORMAT(create_time, '%Y-%m') AS name,
COUNT(DISTINCT ip) AS value
FROM sys_log
WHERE DATE_FORMAT(create_time, '%Y-%m' ) IN
<foreach collection="months" item="month" separator="," open="(" close=")">
#{month}
</foreach>
GROUP BY name
ORDER BY name
</select>
<select id="selectListDashboardAnalysisGeo" resultType="top.continew.admin.system.model.resp.dashboard.DashboardChartCommonResp">
SELECT
CASE
WHEN POSITION(' ' IN address) > 0 THEN SUBSTRING(address FROM 1 FOR POSITION(' ' IN address) - 1)
ELSE address
END AS name,
COUNT(*) AS value
FROM sys_log
WHERE address LIKE '中国%'
GROUP BY name
</select>
<select id="selectListDashboardAccessTrend"
resultType="top.continew.admin.system.model.resp.dashboard.DashboardAccessTrendResp">
SELECT
DATE(create_time) AS date,
COUNT(*) AS pvCount,
COUNT(DISTINCT ip) AS ipCount
FROM sys_log
WHERE create_time BETWEEN #{startTime} AND #{endTime}
GROUP BY date
ORDER BY date
</select>
<select id="selectListDashboardAnalysisTimeslot"
resultType="top.continew.admin.system.model.resp.dashboard.DashboardChartCommonResp">
SELECT
LPAD(CONCAT(FLOOR(HOUR(create_time) / 2) * 2, ':00'), 5, '0') AS name,
COUNT(*) AS value
FROM sys_log
GROUP BY name
ORDER BY name
</select>
<select id="selectListDashboardAnalysisModule"
resultType="top.continew.admin.system.model.resp.dashboard.DashboardChartCommonResp">
SELECT
module AS name,
COUNT(*) AS value
FROM sys_log
WHERE module != '验证码' AND module != '登录'
GROUP BY name
ORDER BY value DESC
LIMIT #{top}
</select>
<select id="selectListDashboardAnalysisOs"
resultType="top.continew.admin.system.model.resp.dashboard.DashboardChartCommonResp">
SELECT
os AS name,
COUNT(*) AS value
FROM sys_log
WHERE os IS NOT NULL
GROUP BY name
ORDER BY value DESC
LIMIT #{top}
</select>
<select id="selectListDashboardAnalysisBrowser"
resultType="top.continew.admin.system.model.resp.dashboard.DashboardChartCommonResp">
SELECT
SUBSTRING_INDEX(browser, ' ', 1) AS name,
COUNT(*) AS value
FROM sys_log
WHERE browser IS NOT NULL
GROUP BY name
ORDER BY value DESC
LIMIT #{top}
</select>
</mapper>

View File

@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="top.continew.admin.system.mapper.MenuMapper">
<select id="selectPermissionByUserId" resultType="java.lang.String">
SELECT DISTINCT t1.permission
FROM sys_menu AS t1
LEFT JOIN sys_role_menu AS t2 ON t2.menu_id = t1.id
LEFT JOIN sys_role AS t3 ON t3.id = t2.role_id
LEFT JOIN sys_user_role AS t4 ON t4.role_id = t3.id
LEFT JOIN sys_user AS t5 ON t5.id = t4.user_id
WHERE t5.id = #{userId}
AND t1.status = 1
AND t1.permission IS NOT NULL
</select>
<select id="selectListByRoleId" resultType="top.continew.admin.system.model.entity.MenuDO">
SELECT t1.*
FROM sys_menu AS t1
LEFT JOIN sys_role_menu AS t2 ON t2.menu_id = t1.id
LEFT JOIN sys_role AS t3 ON t3.id = t2.role_id
WHERE t3.id = #{roleId}
AND t1.status = 1
</select>
</mapper>

View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="top.continew.admin.system.mapper.MessageLogMapper">
</mapper>

View File

@@ -0,0 +1,72 @@
<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="top.continew.admin.system.mapper.MessageMapper">
<select id="selectMessagePage" resultType="top.continew.admin.system.model.resp.message.MessageResp">
SELECT
t1.id,
t1.title,
t1.type,
t1.path,
t1.scope,
t1.users,
t1.create_time,
t2.read_time IS NOT NULL AS isRead,
t2.read_time AS readTime
FROM sys_message AS t1
LEFT JOIN sys_message_log AS t2 ON t2.message_id = t1.id
<where>
<if test="query.userId != null">
(t1.scope = 1 OR (t1.scope = 2 AND JSON_EXTRACT(t1.users, "$[0]") = CAST(#{query.userId} AS CHAR)))
</if>
<if test="query.title != null and query.title != ''">
AND t1.title LIKE CONCAT('%', #{query.title}, '%')
</if>
<if test="query.type != null and query.type != ''">
AND t1.type = #{query.type}
</if>
<if test="query.isRead != null">
AND t2.read_time IS <if test="query.isRead">NOT</if> NULL
</if>
</where>
ORDER BY t1.create_time DESC
</select>
<select id="selectMessageById" resultType="top.continew.admin.system.model.resp.message.MessageDetailResp">
SELECT
t1.id,
t1.title,
t1.content,
t1.type,
t1.path,
t1.scope,
t1.users,
t1.create_time,
t2.read_time IS NOT NULL AS isRead,
t2.read_time AS readTime
FROM sys_message AS t1
LEFT JOIN sys_message_log AS t2 ON t2.message_id = t1.id
WHERE t1.id = #{id}
</select>
<select id="selectUnreadListByUserId" resultType="top.continew.admin.system.model.entity.MessageDO">
SELECT
t1.*
FROM sys_message AS t1
LEFT JOIN sys_message_log AS t2 ON t2.message_id = t1.id
WHERE (t1.scope = 1 OR (t1.scope = 2 AND JSON_CONTAINS(t1.users, CONCAT('"', #{userId}, '"'))))
AND t2.read_time IS NULL
</select>
<select id="selectUnreadCountByUserIdAndType" resultType="java.lang.Long">
SELECT
COUNT(1)
FROM sys_message AS t1
LEFT JOIN sys_message_log AS t2 ON t2.message_id = t1.id
WHERE (t1.scope = 1 OR (t1.scope = 2 AND JSON_CONTAINS(t1.users, CONCAT('"', #{userId}, '"'))))
AND t2.read_time IS NULL
<if test="type != null">
AND t1.type = #{type}
</if>
</select>
</mapper>

View File

@@ -0,0 +1,68 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="top.continew.admin.system.mapper.NoticeMapper">
<resultMap id="notice" type="top.continew.admin.system.model.resp.notice.NoticeResp">
<id property="id" column="id" />
<result property="noticeMethods" column="notice_methods" typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler" />
</resultMap>
<select id="selectNoticePage" resultMap="notice">
SELECT
t1.id,
t1.title,
t1.type,
t1.notice_scope,
t1.notice_methods,
t1.is_timing,
t1.publish_time,
t1.is_top,
t1.status,
t1.create_user,
t2.read_time IS NOT NULL AS isRead
FROM sys_notice AS t1
LEFT JOIN sys_notice_log AS t2 ON t2.notice_id = t1.id
<where>
<if test="query.userId != null">
(t1.notice_scope = 1 OR (t1.notice_scope = 2 AND JSON_CONTAINS(t1.notice_users, CONCAT('"', #{query.userId}, '"'))))
</if>
<if test="query.title != null and query.title != ''">
AND t1.title LIKE CONCAT('%', #{query.title}, '%')
</if>
<if test="query.type != null and query.type != ''">
AND t1.type = #{query.type}
</if>
</where>
<if test="query.userId != null">
ORDER BY t1.is_top DESC, t1.publish_time DESC
</if>
<if test="query.userId == null">
ORDER BY t1.create_time DESC
</if>
</select>
<select id="selectUnreadIdsByUserId" resultType="java.lang.Long">
SELECT
t1.id
FROM sys_notice AS t1
LEFT JOIN sys_notice_log AS t2 ON t2.notice_id = t1.id
WHERE (t1.notice_scope = 1 OR (t1.notice_scope = 2 AND JSON_CONTAINS(t1.notice_users, CONCAT('"', #{userId}, '"'))))
<if test="noticeMethod != null">
AND JSON_CONTAINS(t1.notice_methods, CAST(#{noticeMethod} AS CHAR))
</if>
AND t2.read_time IS NULL
</select>
<select id="selectDashboardList"
resultType="top.continew.admin.system.model.resp.dashboard.DashboardNoticeResp">
SELECT
id, title, type, is_top
FROM sys_notice
WHERE status = 3
<if test="userId != null">
AND (notice_scope = 1 OR (notice_scope = 2 AND JSON_CONTAINS(notice_users, CONCAT('"', #{userId}, '"'))))
</if>
ORDER BY is_top DESC, publish_time DESC
LIMIT 5
</select>
</mapper>

View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="top.continew.admin.system.mapper.RoleMapper">
</mapper>

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="top.continew.admin.system.mapper.RoleMenuMapper">
<select id="selectMenuIdByRoleIds" resultType="java.lang.Long">
SELECT menu_id
FROM sys_role_menu
WHERE role_id IN
<foreach collection="list" item="roleId" open="(" close=")" separator=",">
#{roleId}
</foreach>
</select>
</mapper>

View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="top.continew.admin.system.mapper.SmsConfigMapper">
</mapper>

View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="top.continew.admin.system.mapper.SmsLogMapper">
</mapper>

View File

@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="top.continew.admin.system.mapper.UserRoleMapper">
<select id="selectUserPage" resultType="top.continew.admin.system.model.resp.role.RoleUserResp">
SELECT
t1.*,
t2.nickname,
t2.username,
t2.status,
t2.gender,
t2.dept_id,
t2.description,
t2.is_system,
t3.name AS deptName
FROM sys_user_role AS t1
LEFT JOIN sys_user AS t2 ON t2.id = t1.user_id
LEFT JOIN sys_dept AS t3 ON t3.id = t2.dept_id
${ew.customSqlSegment}
</select>
</mapper>

View File

@@ -0,0 +1,56 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="top.continew.admin.system.mapper.user.UserMapper">
<sql id="selectUser">
SELECT
t1.id,
t1.create_user,
t1.create_time,
t1.update_user,
t1.update_time,
t1.username,
t1.nickname,
t1.password,
t1.gender,
t1.email,
t1.phone,
t1.avatar,
t1.description,
t1.status,
t1.is_system,
t1.pwd_reset_time,
t1.dept_id,
t2.name AS deptName
FROM sys_user AS t1
LEFT JOIN sys_dept AS t2 ON t2.id = t1.dept_id
</sql>
<select id="selectUserPage" resultType="top.continew.admin.system.model.resp.user.UserDetailResp">
<include refid="selectUser" />
${ew.customSqlSegment}
</select>
<select id="selectUserList" resultType="top.continew.admin.system.model.resp.user.UserDetailResp">
<include refid="selectUser" />
${ew.customSqlSegment}
</select>
<select id="selectCountByEmail" resultType="java.lang.Long">
SELECT count(*)
FROM sys_user
WHERE email = #{email}
<if test="id != null">
AND id != #{id}
</if>
</select>
<select id="selectCountByPhone" resultType="java.lang.Long">
SELECT count(*)
FROM sys_user
WHERE phone = #{phone}
<if test="id != null">
AND id != #{id}
</if>
</select>
</mapper>

View File

@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="top.continew.admin.system.mapper.user.UserPasswordHistoryMapper">
<delete id="deleteExpired">
DELETE t1 FROM sys_user_password_history AS t1
LEFT JOIN (
SELECT id
FROM sys_user_password_history
WHERE user_id = #{userId}
ORDER BY create_time DESC
LIMIT #{count}
) AS t2 ON t2.id = t1.id
WHERE t2.id IS NULL
</delete>
</mapper>

View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="top.continew.admin.system.mapper.user.UserSocialMapper">
<select id="selectBySourceAndOpenId"
resultType="top.continew.admin.system.model.entity.user.UserSocialDO">
SELECT t1.*
FROM sys_user_social AS t1
LEFT JOIN sys_user AS t2 ON t2.id = t1.user_id
WHERE t1.source = #{source} AND t1.open_id = #{openId}
</select>
</mapper>