【7.2.2】更新统计sql的适配

pull/29/head
fengshuonan 2022-03-16 18:28:13 +08:00
parent 730967e4d8
commit 82cc26fbd3
4 changed files with 66 additions and 2 deletions

View File

@ -17,10 +17,8 @@
<modules> <modules>
<module>monitor-api</module> <module>monitor-api</module>
<module>monitor-integration-beetl</module>
<module>monitor-business-system-info</module> <module>monitor-business-system-info</module>
<module>monitor-spring-boot-starter</module> <module>monitor-spring-boot-starter</module>
<module>monitor-sdk-prometheus</module>
</modules> </modules>
<dependencies> <dependencies>

View File

@ -2,6 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.stylefeng.roses.kernel.system.modular.home.mapper.SysStatisticsUrlMapper"> <mapper namespace="cn.stylefeng.roses.kernel.system.modular.home.mapper.SysStatisticsUrlMapper">
<!--根据统计urlId集合获取菜单id集合-->
<select id="getMenuIdsByStatUrlIdList" resultType="java.lang.Long"> <select id="getMenuIdsByStatUrlIdList" resultType="java.lang.Long">
select stat_menu_id as statMenuId from sys_statistics_url stat select stat_menu_id as statMenuId from sys_statistics_url stat
<where> <where>
@ -18,4 +19,21 @@
</foreach> </foreach>
</select> </select>
<!--根据统计urlId集合获取菜单id集合oracle版本-->
<select id="getMenuIdsByStatUrlIdList" resultType="java.lang.Long" databaseId="oracle">
select stat_menu_id as statMenuId from sys_statistics_url stat
<where>
<if test="statUrlIds != null and statUrlIds.size() > 0">
stat.stat_url_id in
<foreach item="item" collection="statUrlIds" index="index" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</where>
order by instr(
<foreach item="item" collection="statUrlIds" index="index" open="'" separator="," close="'">
#{item}
</foreach>,stat_url_id)
</select>
</mapper> </mapper>

View File

@ -2,6 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.stylefeng.roses.kernel.system.modular.menu.mapper.SysMenuMapper"> <mapper namespace="cn.stylefeng.roses.kernel.system.modular.menu.mapper.SysMenuMapper">
<!--获取一些菜单的统计信息只返回名称路径图标mysql-->
<select id="getMenuStatInfoByMenuIds" resultType="cn.stylefeng.roses.kernel.system.modular.menu.entity.SysMenu"> <select id="getMenuStatInfoByMenuIds" resultType="cn.stylefeng.roses.kernel.system.modular.menu.entity.SysMenu">
select menu_name as menuName, antdv_icon as antdvIcon , antdv_router as antdvRouter from sys_menu menu select menu_name as menuName, antdv_icon as antdvIcon , antdv_router as antdvRouter from sys_menu menu
<where> <where>
@ -18,4 +19,21 @@
</foreach> </foreach>
</select> </select>
<!--获取一些菜单的统计信息只返回名称路径图标oracle版本-->
<select id="getMenuStatInfoByMenuIds" resultType="cn.stylefeng.roses.kernel.system.modular.menu.entity.SysMenu" databaseId="oracle">
select menu_name as menuName, antdv_icon as antdvIcon , antdv_router as antdvRouter from sys_menu menu
<where>
<if test="menuIds != null and menuIds.size() > 0">
menu.menu_id in
<foreach item="item" collection="menuIds" index="index" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</where>
order by instr(
<foreach item="item" collection="menuIds" index="index" open="'" separator="," close="'">
#{item}
</foreach>,menu_id)
</select>
</mapper> </mapper>

View File

@ -15,6 +15,7 @@
<result property="fieldDescription" column="field_description"/> <result property="fieldDescription" column="field_description"/>
</resultMap> </resultMap>
<!--系统主题模板详细查询 mysql版本-->
<select id="sysThemeTemplateDetail" resultMap="sysThemeTemplateResult"> <select id="sysThemeTemplateDetail" resultMap="sysThemeTemplateResult">
SELECT SELECT
stt.template_id, stt.template_id,
@ -38,4 +39,33 @@
AND stt.template_id = #{id} AND stt.template_id = #{id}
</if> </if>
</select> </select>
<!--系统主题模板详细查询 oracle版本-->
<select id="sysThemeTemplateDetail" resultMap="sysThemeTemplateResult" databaseId="oracle">
SELECT
stt.template_id,
stt.template_code,
stt.template_name,
sttf.field_id,
sttf.field_code,
sttf.field_name,
sttf.field_type,
sttf.field_length,
sttf.field_required,
sttf.field_description
FROM
sys_theme_template_field sttf,
sys_theme_template stt,
sys_theme_template_rel sttl
WHERE
sttf.field_code = sttl.field_code
AND stt.template_id = sttl.template_id
<if test="id != null" >
AND stt.template_id = #{id}
</if>
</select>
</mapper> </mapper>