8ea9c133
陈威
初始化提交
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
|
<?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="com.hotent.sys.persistence.dao.SysAppDao">
<resultMap id="SysApp" type="com.hotent.sys.persistence.model.SysApp">
<id property="id" column="ID_" jdbcType="VARCHAR"/>
<result property="name" column="NAME_" jdbcType="VARCHAR"/>
<result property="icon" column="ICON_" jdbcType="VARCHAR"/>
<result property="iconColor" column="ICON_COLOR_" jdbcType="VARCHAR"/>
<result property="type" column="TYPE_" jdbcType="NUMERIC"/>
<result property="menuId" column="MENU_ID_" jdbcType="VARCHAR"/>
<result property="sn" column="SN_" jdbcType="NUMERIC"/>
<result property="isPublish" column="IS_PUBLISH_" jdbcType="NUMERIC"/>
<result property="content" column="CONTENT_" jdbcType="VARCHAR"/>
<result property="createTime" column="CREATE_TIME_" jdbcType="TIMESTAMP"/>
<result property="updateTime" column="UPDATE_TIME_" jdbcType="TIMESTAMP"/>
<result property="createBy" column="CREATE_BY_" jdbcType="VARCHAR"/>
<result property="updateBy" column="UPDATE_BY_" jdbcType="VARCHAR"/>
<result property="desc" column="DESC_" jdbcType="VARCHAR"/>
<result property="menuName" column="menuName" jdbcType="VARCHAR"/>
</resultMap>
<select id="customQuery" parameterType="java.util.Map" resultMap="SysApp">
select * from (
select app.*,m.name_ as menuName
from portal_sys_app app
left join portal_sys_menu m on app.menu_id_ = m.id_) t
${ew.customSqlSegment}
</select>
<select id="queryByFilter" parameterType="java.util.Map" resultMap="SysApp">
SELECT
*
FROM
portal_sys_app app
<where>
is_publish_ = 1
<if test="@com.hotent.base.ognl.Ognl@isNotEmpty(ew.menuId)">
and menu_id_ = #{ew.menuId}
</if>
<if test="@com.hotent.base.ognl.Ognl@isNotEmpty(ew.searchWord)">
and name_ like '%${ew.searchWord}%'
</if>
<if test="@com.hotent.base.ognl.Ognl@isNotEmpty(ew.authIds)">
and (
<if test="@com.hotent.base.ognl.Ognl@isNotEmpty(ew.authIds)">
(id_ in (${ew.authIds})) or
</if>
(CREATE_BY_ = #{ew.userId})
)
</if>
<if test="@com.hotent.base.ognl.Ognl@isNotEmpty(ew.tagIds)">
and EXISTS (
SELECT
app_id_
FROM
portal_app_tags_relation rel
WHERE
rel.APP_ID_ = app.ID_
AND rel.TAG_ID_ in (${ew.tagIds})
)
</if>
</where>
order by sn_
</select>
<select id="getValidMenu" resultType="java.lang.String">
select id_ from portal_sys_menu menu where path_ like '-1.4.%.'
and exists (
select menu_id_ from portal_sys_app app where app.menu_id_ = menu.id_ and app.is_publish_ = 1
)
</select>
</mapper>
|