Commit 297a786e by fengshuonan

适配CONCAT关键字

parent faa9e71c
...@@ -60,6 +60,19 @@ ...@@ -60,6 +60,19 @@
order by sort ASC order by sort ASC
</select> </select>
<select id="list" resultType="map" databaseId="oracle">
select
<include refid="Base_Column_List"/>
from sys_dept where 1 = 1
<if test="condition != null and condition != ''">
and simple_name like ('%' || #{condition} || '%') or full_name like ('%' || #{condition} || '%')
</if>
<if test="deptId != null and deptId != ''">
and (dept_id = #{deptId} or dept_id in ( select dept_id from sys_dept where pids like '%[' || #{deptId} || ']%' ))
</if>
order by sort ASC
</select>
<select id="treeviewNodes" resultType="cn.stylefeng.guns.core.common.node.TreeviewNode"> <select id="treeviewNodes" resultType="cn.stylefeng.guns.core.common.node.TreeviewNode">
select dept_id AS tags, pid as "parentId", simple_name as text from sys_dept select dept_id AS tags, pid as "parentId", simple_name as text from sys_dept
</select> </select>
...@@ -73,4 +86,13 @@ ...@@ -73,4 +86,13 @@
</if> </if>
</select> </select>
<select id="likePids" resultType="cn.stylefeng.guns.modular.system.entity.Dept" databaseId="oracle">
select
<include refid="Base_Column_List"/>
from sys_dept where 1 = 1
<if test="deptId != null and deptId != ''">
and pids LIKE '%[' || #{deptId} || ']%'
</if>
</select>
</mapper> </mapper>
...@@ -57,4 +57,13 @@ ...@@ -57,4 +57,13 @@
</if> </if>
</select> </select>
<select id="likeParentIds" resultType="cn.stylefeng.guns.modular.system.entity.Dict" databaseId="oracle">
select
<include refid="Base_Column_List"></include>
from sys_dict where 1 = 1
<if test="dictId != null and dictId != ''">
and parent_ids LIKE '%$[' || #{dictId} || ']%'
</if>
</select>
</mapper> </mapper>
...@@ -31,4 +31,17 @@ ...@@ -31,4 +31,17 @@
</if> </if>
</select> </select>
<select id="getLoginLogs" resultType="map" parameterType="com.baomidou.mybatisplus.extension.plugins.pagination.Page" databaseId="oracle">
select
<include refid="Base_Column_List"/>
from sys_login_log
where 1 = 1
<if test="beginTime != null and beginTime !='' and endTime != null and endTime != ''">
and (create_time between CONCAT(#{beginTime},' 00:00:00') and CONCAT(#{endTime},' 23:59:59'))
</if>
<if test="logName != null and logName !=''">
and log_name like '%' || #{logName} || '%'
</if>
</select>
</mapper> </mapper>
...@@ -45,6 +45,22 @@ ...@@ -45,6 +45,22 @@
</if> </if>
</select> </select>
<select id="selectMenus" resultType="map" databaseId="oracle">
select
<include refid="Base_Column_List"/>
from sys_menu
where status = 'ENABLE'
<if test="condition != null and condition != ''">
and (name like '%' || #{condition} || '%' or code like '%' || #{condition} || '%')
</if>
<if test="level != null and level != ''">
and levels = #{level}
</if>
<if test="menuId != null and menuId != 0">
and (menu_id = #{menuId} or menu_id in ( select menu_id from sys_menu where pcodes like '%[' || #{code} ']%' ))
</if>
</select>
<select id="getMenuIdsByRoleId" resultType="long"> <select id="getMenuIdsByRoleId" resultType="long">
select menu_id from select menu_id from
sys_relation where role_id = #{roleId} sys_relation where role_id = #{roleId}
...@@ -274,6 +290,19 @@ ...@@ -274,6 +290,19 @@
</if> </if>
</select> </select>
<select id="selectMenuTree" resultType="java.util.Map" databaseId="oracle">
select
<include refid="Base_Column_List"/>
from sys_menu
where status = 'ENABLE'
<if test="condition != null and condition != ''">
and (name like '%' || #{condition} || '%' or code like '%' || #{condition} || '%')
</if>
<if test="level != null and level != ''">
and levels = #{level}
</if>
</select>
<select id="getMenusLikePcodes" resultType="cn.stylefeng.guns.modular.system.entity.Menu"> <select id="getMenusLikePcodes" resultType="cn.stylefeng.guns.modular.system.entity.Menu">
select select
<include refid="Base_Column_List"></include> <include refid="Base_Column_List"></include>
...@@ -283,4 +312,13 @@ ...@@ -283,4 +312,13 @@
</if> </if>
</select> </select>
<select id="getMenusLikePcodes" resultType="cn.stylefeng.guns.modular.system.entity.Menu" databaseId="oracle">
select
<include refid="Base_Column_List"></include>
from sys_menu where 1 = 1
<if test="code != null and code != ''">
and pcodes LIKE '%[' || #{code} || ']%'
</if>
</select>
</mapper> </mapper>
...@@ -27,4 +27,14 @@ ...@@ -27,4 +27,14 @@
</if> </if>
order by create_time DESC order by create_time DESC
</select> </select>
<select id="list" resultType="map" databaseId="oracle">
select
<include refid="Base_Column_List"></include>
from sys_notice
<if test="condition != null and condition != ''">
where title like '%' || #{condition} || '%' or content like '%' || #{condition} || '%'
</if>
order by create_time DESC
</select>
</mapper> </mapper>
...@@ -35,4 +35,19 @@ ...@@ -35,4 +35,19 @@
</if> </if>
</select> </select>
<select id="getOperationLogs" resultType="map" databaseId="oracle">
select
<include refid="Base_Column_List"/>
from sys_operation_log where 1 = 1
<if test="beginTime != null and beginTime !='' and endTime != null and endTime != ''">
and (create_time between CONCAT(#{beginTime},' 00:00:00') and CONCAT(#{endTime},' 23:59:59'))
</if>
<if test="logName != null and logName !=''">
and log_name like '%' || #{logName} || '%'
</if>
<if test="logType != null and logType !=''">
and log_type like '%' || #{logType} || '%'
</if>
</select>
</mapper> </mapper>
...@@ -31,6 +31,16 @@ ...@@ -31,6 +31,16 @@
order by sort asc order by sort asc
</select> </select>
<select id="selectRoles" resultType="map" databaseId="oracle">
select
<include refid="Base_Column_List"/>
from sys_role
<if test="condition != null">
where name like '%' || #{condition} || '%'
</if>
order by sort asc
</select>
<delete id="deleteRolesById"> <delete id="deleteRolesById">
delete from sys_relation where role_id = #{roleId} delete from sys_relation where role_id = #{roleId}
</delete> </delete>
......
...@@ -51,6 +51,24 @@ ...@@ -51,6 +51,24 @@
</if> </if>
</select> </select>
<select id="selectUsers" resultType="map" databaseId="oracle">
select
<include refid="Base_Column_List"/>
from sys_user
where status != 'DELETED'
<if test="name != null and name != ''">
and (phone like '%' || #{name} || '%'
or account like '%' || #{name} || '%'
or name like '%' || #{name} || '%')
</if>
<if test="deptId != null and deptId != 0">
and (dept_id = #{deptId} or dept_id in ( select dept_id from sys_dept where pids like '%[' || #{deptId} || ']%'))
</if>
<if test="beginTime != null and beginTime != '' and endTime != null and endTime != ''">
and (create_time between CONCAT(#{beginTime},' 00:00:00') and CONCAT(#{endTime},' 23:59:59'))
</if>
</select>
<update id="setStatus"> <update id="setStatus">
update sys_user set status = #{status} where user_id = #{userId} update sys_user set status = #{status} where user_id = #{userId}
</update> </update>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment