<?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.landtool.lanbase.modules.sys.dao.SysSysteminfoDao">
|
|
<!-- 可根据自己的需求,是否要使用 -->
|
<resultMap type="com.landtool.lanbase.modules.sys.entity.SysSysteminfo" id="systeminfoMap">
|
<result property="appid" column="APPID"/>
|
<result property="appfullname" column="APPFULLNAME"/>
|
<result property="appname" column="APPNAME"/>
|
<result property="appcode" column="APPCODE"/>
|
<result property="systype" column="SYSTYPE"/>
|
<result property="version" column="VERSION"/>
|
<result property="sysaddress" column="SYSADDRESS"/>
|
<result property="sysimgurl" column="SYSIMGURL"/>
|
<result property="sysdescription" column="SYSDESCRIPTION"/>
|
<result property="sysstatus" column="SYSSTATUS"/>
|
<result property="logintimes" column="LOGINTIMES"/>
|
<result property="magunitname" column="MAGUNITNAME"/>
|
<result property="maguser" column="MAGUSER"/>
|
<result property="magtechuser" column="MAGTECHUSER"/>
|
<result property="techusertel" column="TECHUSERTEL"/>
|
<result property="rcreateuser" column="RCREATEUSER"/>
|
<result property="rcreatedate" column="RCREATEDATE"/>
|
<result property="rlasteditdate" column="RLASTEDITDATE"/>
|
<result property="remark" column="REMARK"/>
|
<result property="iscaslogin" column="ISCASLOGIN"/>
|
<result property="isnavigationshow" column="ISNAVIGATIONSHOW"/>
|
<result property="orderid" column="ORDERID"/>
|
<result property="referenceurl" column="REFERENCEURL"/>
|
<result property="browser" column="BROWSER"/>
|
</resultMap>
|
|
<resultMap type="com.landtool.lanbase.modules.sys.entity.SysUserApplist" id="userAppMap">
|
<result property="userId" column="USERID"/>
|
<result property="appId" column="APPID"/>
|
<result property="rcreateUser" column="RCREATEUSER"/>
|
<result property="rcreateDate" column="RCREATEDATE"/>
|
<result property="remark" column="REMARK"/>
|
</resultMap>
|
|
<select id="queryObject" resultType="com.landtool.lanbase.modules.sys.entity.SysSysteminfo">
|
select a.*,b.unitname,c.chinesename from SYS_SYSTEMINFO a
|
left join ORG_UNIT b on a.magunitname = b.unitid
|
left join ORG_USER c on a.maguser = c.userid
|
where APPID = #{value}
|
</select>
|
|
<select id="queryList" resultType="com.landtool.lanbase.modules.sys.entity.SysSysteminfo">
|
select * from (
|
SELECT *
|
FROM(
|
SELECT ROW_NUMBER() OVER(ORDER BY B.orderid) AS rownumber,B.*
|
FROM (
|
|
SELECT a.*,b.unitname,c.chinesename FROM SYS_SYSTEMINFO a
|
left join ORG_UNIT b on a.magunitname = b.unitid
|
left join ORG_USER c on a.maguser = c.userid
|
<where>
|
<if test="isadmin != 1">
|
AND (a.maguser =#{userid} or a.rcreateuser = #{userid}
|
or (#{userid} in (select userid from ORG_USERUNIT where unitid = b.unitid))
|
or (#{userid} in (select userid from ORG_UNITMANAGER where ORG_UNITMANAGER.unitid = b.unitid)))
|
</if>
|
<if test="appfullName != null and appfullName!=''">
|
AND a.appfullname LIKE ('%' || #{appfullName} || '%')
|
</if>
|
<if test="systype != null and systype!=''">
|
AND a.systype LIKE ('%' || #{systype} || '%')
|
</if>
|
<if test="iscaslogin != null and iscaslogin != '' and (iscaslogin==0 ? '0' : iscaslogin)">
|
and a.iscaslogin = #{iscaslogin}
|
</if>
|
</where>
|
|
) B
|
) A
|
WHERE rownumber > #{lowerOffset} AND <![CDATA[ rownumber <= ${upperOffset} ]]>
|
)a order by
|
<choose>
|
<when test="sidx != null and sidx != ''">
|
${sidx} ${order}
|
</when>
|
<otherwise>
|
orderid
|
</otherwise>
|
</choose>
|
</select>
|
|
<select id="queryTotal" resultType="int">
|
SELECT count(*) FROM SYS_SYSTEMINFO a
|
left join ORG_UNIT b on a.magunitname = b.unitid
|
left join ORG_USER c on a.maguser = c.userid
|
<where>
|
<if test="isadmin != 1">
|
AND (a.maguser =#{userid} or a.rcreateuser = #{userid}
|
or (#{userid} in (select userid from ORG_USERUNIT where unitid = b.unitid))
|
or (#{userid} in (select userid from ORG_UNITMANAGER where ORG_UNITMANAGER.unitid = b.unitid)))
|
</if>
|
<if test="appfullName != null and appfullName!=''">
|
AND a.appfullname LIKE ('%' || #{appfullName} || '%')
|
</if>
|
<if test="systype != null and systype!=''">
|
AND a.systype LIKE ('%' || #{systype} || '%')
|
</if>
|
<if test="iscaslogin != null and iscaslogin != '' and (iscaslogin==0 ? '0' : iscaslogin)">
|
and a.iscaslogin = #{iscaslogin}
|
</if>
|
</where>
|
</select>
|
|
<insert id="save" parameterType="com.landtool.lanbase.modules.sys.entity.SysSysteminfo">
|
insert into SYS_SYSTEMINFO
|
(
|
APPFULLNAME,
|
APPNAME,
|
APPCODE,
|
SYSTYPE,
|
VERSION,
|
SYSADDRESS,
|
SYSIMGURL,
|
SYSDESCRIPTION,
|
SYSSTATUS,
|
LOGINTIMES,
|
MAGUNITNAME,
|
MAGUSER,
|
MAGTECHUSER,
|
TECHUSERTEL,
|
RCREATEUSER,
|
RCREATEDATE,
|
RLASTEDITDATE,
|
REMARK,
|
ISCASLOGIN,
|
ISNAVIGATIONSHOW,
|
ORDERID,
|
REFERENCEURL,
|
BROWSER
|
)
|
values
|
(
|
#{appfullname,jdbcType=VARCHAR},
|
#{appname,jdbcType=VARCHAR},
|
#{appcode,jdbcType=VARCHAR},
|
#{systype,jdbcType=VARCHAR},
|
#{version,jdbcType=VARCHAR},
|
#{sysaddress,jdbcType=VARCHAR},
|
#{sysimgurl,jdbcType=VARCHAR},
|
#{sysdescription,jdbcType=VARCHAR},
|
1,
|
#{logintimes,jdbcType=BIGINT},
|
#{magunitname,jdbcType=BIGINT},
|
#{maguser,jdbcType=BIGINT},
|
#{magtechuser,jdbcType=VARCHAR},
|
#{techusertel,jdbcType=VARCHAR},
|
#{rcreateuser,jdbcType=BIGINT},
|
now(),
|
now(),
|
#{remark,jdbcType=VARCHAR},
|
#{iscaslogin},
|
#{isnavigationshow},
|
#{orderid,jdbcType=BIGINT},
|
#{referenceurl,jdbcType=VARCHAR},
|
#{browser,jdbcType=VARCHAR}
|
)
|
</insert>
|
|
<update id="update" parameterType="com.landtool.lanbase.modules.sys.entity.SysSysteminfo">
|
update SYS_SYSTEMINFO
|
<set>
|
RLASTEDITDATE=now(),
|
<if test="appfullname != null">APPFULLNAME = #{appfullname},</if>
|
<if test="appname != null">APPNAME = #{appname},</if>
|
<if test="appcode != null">APPCODE = #{appcode},</if>
|
<if test="systype != null">SYSTYPE = #{systype},</if>
|
<if test="version != null">VERSION = #{version},</if>
|
<if test="sysaddress != null">SYSADDRESS = #{sysaddress},</if>
|
<if test="sysimgurl != null">SYSIMGURL = #{sysimgurl},</if>
|
<if test="sysdescription != null">SYSDESCRIPTION = #{sysdescription},</if>
|
<if test="syslanguagetype != null">SYSLANGUAGETYPE = #{syslanguagetype},</if>
|
<if test="sysstatus != null">SYSSTATUS = #{sysstatus},</if>
|
<if test="logintimes != null">LOGINTIMES = #{logintimes},</if>
|
<if test="magunitname != null">MAGUNITNAME = #{magunitname},</if>
|
<if test="maguser != null">MAGUSER = #{maguser},</if>
|
<if test="magtechuser != null">MAGTECHUSER = #{magtechuser},</if>
|
<if test="techusertel != null">TECHUSERTEL = #{techusertel},</if>
|
<if test="rcreateuser != null">RCREATEUSER = #{rcreateuser},</if>
|
<if test="rcreatedate != null">RCREATEDATE = #{rcreatedate},</if>
|
<if test="remark != null">REMARK = #{remark},</if>
|
<if test="iscaslogin != null">ISCASLOGIN = #{iscaslogin},</if>
|
<if test="orderid != null">ORDERID = #{orderid},</if>
|
<if test="isnavigationshow != null">ISNAVIGATIONSHOW = #{isnavigationshow},</if>
|
<if test="referenceurl != null">REFERENCEURL = #{referenceurl},</if>
|
<if test="browser != null">BROWSER = #{browser}</if>
|
</set>
|
where APPID = #{appid}
|
</update>
|
|
<delete id="delete">
|
delete from SYS_SYSTEMINFO where APPID = #{value}
|
</delete>
|
|
<delete id="deleteBatch">
|
delete from SYS_SYSTEMINFO where APPID in
|
<foreach item="appid" collection="array" open="(" separator="," close=")">
|
#{appid}
|
</foreach>
|
</delete>
|
|
<select id="findList" resultType="com.landtool.lanbase.modules.sys.entity.SysSysteminfo">
|
select * from SYS_SYSTEMINFO where SYSSTATUS = 1 order by orderid
|
</select>
|
|
<select id="queryListByUserId" resultType="com.landtool.lanbase.modules.sys.entity.SysUserApplist">
|
SELECT
|
su.USERID,
|
su.APPID,
|
su.RCREATEDATE,
|
su.RCREATEUSER,
|
su.REMARK
|
FROM SYS_USERAPPLIST su
|
INNER JOIN ORG_USER ou ON su.USERID = ou.USERID
|
WHERE 1=1
|
AND ou.USERID = #{userId}
|
</select>
|
|
<select id="getInfoById" resultType="com.landtool.lanbase.modules.sys.entity.SysSysteminfo">
|
select * from SYS_SYSTEMINFO where appid=#{appid} order by orderid
|
</select>
|
|
<select id="queryListAll" resultType="com.landtool.lanbase.modules.sys.entity.SysSysteminfo">
|
select APPID,APPFULLNAME from SYS_SYSTEMINFO order by orderid
|
</select>
|
|
<select id="querySysteminfoWithSEQ" resultType="int">
|
SELECT currval('SYS_SYSTEMINFO_SEQ') FROM DUAL
|
</select>
|
<insert id="addUserList">
|
insert into SYS_USERAPPLIST (appId,userId,rcreatedate)
|
values(#{appId,jdbcType=BIGINT},
|
#{userId,jdbcType=BIGINT},
|
now()
|
)
|
</insert>
|
|
<delete id="deleteUserList">
|
delete SYS_USERAPPLIST where appid=#{appid}
|
</delete>
|
<select id="queryTopList" resultType="com.landtool.lanbase.modules.sys.entity.SysSysteminfo">
|
select * from (
|
select A.*,row_number() over() as rownumber from SYS_SYSTEMINFO A where isnavigationshow = 1
|
<if test="type != null and type.size() > 0">
|
and systype in
|
<foreach collection="type" index="index" item="item" open="(" separator="," close=")">
|
#{item}
|
</foreach>
|
</if>
|
) A where <![CDATA[ rownumber <= ${num} ]]> order by orderid
|
</select>
|
<select id="queryTopUserList" resultType="com.landtool.lanbase.modules.sys.entity.SysSysteminfo">
|
select * from (
|
select tmp.*,row_number() over() as rownumber from (
|
select b.*,a.id from SYS_DIYAPP a
|
left join SYS_SYSTEMINFO b on a.appid=b.appid
|
where a.userid=#{userid} and isnavigationshow = 1
|
<if test="type != null">
|
and type = #{type}
|
</if>
|
order by b.orderid
|
) tmp
|
) A where <![CDATA[ rownumber <= ${num} ]]>
|
</select>
|
<select id="getSysListByUserId" resultType="com.landtool.lanbase.modules.sys.entity.SysSysteminfo">
|
select * from SYS_SYSTEMINFO WHERE maguser=#{userId} order by orderid
|
</select>
|
|
<select id="queryAllList" resultType="com.landtool.lanbase.modules.sys.entity.SysSysteminfo">
|
SELECT a.*,c.chinesename,b.unitname FROM SYS_SYSTEMINFO a
|
left join ORG_UNIT b on a.magunitname = b.unitid
|
left join ORG_USER c on a.maguser = c.userid
|
<where>
|
<if test="isadmin != 1">
|
AND (a.maguser =#{userid} or a.rcreateuser = #{userid}
|
or (#{userid} in (select userid from ORG_USERUNIT where unitid = b.unitid))
|
or (#{userid} in (select userid from ORG_UNITMANAGER where org_unitmanager.unitid = b.unitid)))
|
</if>
|
<if test="appfullname != null and appfullname!=''">
|
AND a.appfullname LIKE ('%' || #{appfullname} || '%')
|
</if>
|
<if test="systype != null and systype!=''">
|
AND a.systype LIKE ('%' || #{systype} || '%')
|
</if>
|
<if test="sysstatus != null and sysstatus!=0">
|
AND a.sysstatus = #{sysstatus}
|
</if>
|
<if test="iscaslogin != null ">
|
AND a.iscaslogin = #{iscaslogin}
|
</if>
|
<if test="currentsystemid != null and currentsystemid != 0">
|
and a.appid != #{currentsystemid}
|
</if>
|
</where>
|
order by isnavigationshow desc, orderid asc --客户建议应用程序-更多页面,前面8个要和平台门户顺序一样,所以用isnavigationshow优先排序 ccr modify 2019-01-23
|
</select>
|
|
<update id="updateRorder" parameterType="com.landtool.lanbase.modules.sys.entity.SysSysteminfo">
|
update SYS_SYSTEMINFO
|
<set>
|
RLASTEDITDATE=now(),
|
<if test="orderid != null">orderid = #{orderid}</if>
|
</set>
|
where appid = #{appid}
|
</update>
|
|
<select id="queryMaxOrderid" resultType="int">
|
select case when max(orderid) > 0 then max(orderid) else 0 end as orderid from SYS_SYSTEMINFO
|
</select>
|
|
<select id="getSysListIgnoredUserId" resultType="com.landtool.lanbase.modules.sys.entity.SysSysteminfo">
|
select * from (
|
SELECT *
|
FROM(
|
SELECT ROW_NUMBER() OVER(ORDER BY B.appid) AS rownumber,B.*
|
FROM (
|
select * from SYS_SYSTEMINFO
|
WHERE isnavigationshow = 1
|
and sysstatus = 1
|
<if test="otherids != null and otherids != ''">
|
and appid not in( ${otherids} )
|
</if>
|
<if test="appfullname != null and appfullname != ''">
|
and appfullname like ('%' || #{appfullname} || '%')
|
</if>
|
<if test="systype != null and systype != ''">
|
and systype = #{systype}
|
</if>
|
) B
|
) A
|
WHERE rownumber > #{lowerOffset} AND <![CDATA[ rownumber <= ${upperOffset} ]]>
|
)a order by
|
<choose>
|
<when test="sidx != null and sidx != ''">
|
${sidx} ${order}
|
</when>
|
<otherwise>
|
orderid
|
</otherwise>
|
</choose>
|
</select>
|
<select id="querySysListIgnoredUserIdTotal" resultType="int">
|
select COUNT(*)
|
from SYS_SYSTEMINFO
|
WHERE isnavigationshow = 1
|
and sysstatus = 1
|
<if test="otherids != null and otherids != ''">
|
and appid not in( ${otherids} )
|
</if>
|
<if test="appfullname != null and appfullname != ''">
|
and appfullname like ('%' || #{appfullname} || '%')
|
</if>
|
<if test="systype != null and systype != ''">
|
and systype = #{systype}
|
</if>
|
</select>
|
|
<select id="queryAppByUrl" resultType="com.landtool.lanbase.modules.sys.entity.SysSysteminfo">
|
SELECT * from SYS_SYSTEMINFO where SYSADDRESS LIKE (#{appurl} || '%')
|
</select>
|
|
<select id="queryNavigAtionShowCount" resultType="int">
|
SELECT count(*) from SYS_SYSTEMINFO where isnavigationshow = 1 and appid != #{appid}
|
</select>
|
|
<select id="isAdmitSysByUserid" resultType="int" parameterType="hashmap">
|
/** modified by qufangxu**/
|
SELECT count(*) FROM SYS_SYSTEMINFO_APPLY
|
</select>
|
</mapper>
|