<?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.SysSysteminfoApplyDao">
|
|
<!-- 可根据自己的需求,是否要使用 -->
|
<resultMap type="com.landtool.lanbase.modules.sys.entity.SysSysteminfoApply" id="systeminfoapplyMap">
|
<result property="id" column="ID"/>
|
<result property="appid" column="APPID"/>
|
<result property="userid" column="USERID"/>
|
<result property="applytime" column="APPLYTIME"/>
|
<result property="auditresult" column="AUDITRESULT"/>
|
<result property="auditopinion" column="AUDITOPINION"/>
|
</resultMap>
|
<insert id="add" parameterType="com.landtool.lanbase.modules.sys.entity.SysSysteminfoApply">
|
<selectKey keyProperty="id" resultType="java.lang.Integer" order="BEFORE">
|
select NEXTVAL('SYS_SYSTEMINFO_APPLY_INS_SEQ') from dual
|
</selectKey>
|
insert into SYS_SYSTEMINFO_APPLY
|
<trim prefix="(" suffix=")" suffixOverrides="," >
|
<if test="id != null" >
|
ID,
|
</if>
|
<if test="appid != null" >
|
APPID,
|
</if>
|
<if test="userid != null" >
|
USERID,
|
</if>
|
<if test="applytime != null" >
|
APPLYTIME,
|
</if>
|
<if test="auditresult != null" >
|
AUDITRESULT,
|
</if>
|
<if test="auditopinion != null" >
|
AUDITOPINION,
|
</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides="," >
|
<if test="id != null" >
|
#{id,jdbcType=DECIMAL},
|
</if>
|
<if test="appid != null" >
|
#{appid,jdbcType=DECIMAL},
|
</if>
|
<if test="userid != null" >
|
#{userid,jdbcType=DECIMAL},
|
</if>
|
<if test="applytime != null" >
|
#{applytime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="auditresult != null" >
|
#{auditresult,jdbcType=DECIMAL},
|
</if>
|
<if test="auditopinion != null" >
|
#{auditopinion,jdbcType=VARCHAR},
|
</if>
|
</trim>
|
</insert>
|
<select id="byId" resultType="com.landtool.lanbase.modules.sys.entity.SysSysteminfoApply">
|
SELECT * FROM SYS_SYSTEMINFO_APPLY where appid = #{appid} and userid = #{userid}
|
</select>
|
<select id="queryListByAppid" resultType="com.landtool.lanbase.modules.sys.entity.SysSysteminfoApplyJoinOrgUser">
|
select * from (
|
SELECT *
|
FROM(
|
SELECT ROW_NUMBER() OVER(ORDER BY B.id) AS rownumber,B.*
|
FROM (
|
select a.*,b.CHINESENAME,c.UNITNAME from SYS_SYSTEMINFO_APPLY a
|
left join ORG_USER b on a.userid = b.userid
|
left join (
|
SELECT
|
ouu.USERID,
|
max(ou.UNITNAME) AS UNITNAME,
|
max(ouu.RCREATEDATE) AS RCREATEDATE
|
FROM ORG_USERUNIT ouu
|
LEFT JOIN ORG_UNIT ou ON ouu.unitid=ou.unitid where ouu.WORKTYPE = 1
|
GROUP BY ouu.USERID
|
)c ON a.USERID = c.USERID
|
where appid = #{appid}
|
<if test="auditresult != null">
|
and auditresult = #{auditresult}
|
</if>
|
) B
|
) A
|
WHERE rownumber > #{lowerOffset} AND <![CDATA[ rownumber <= ${upperOffset} ]]>
|
)a order by id
|
</select>
|
|
<select id="queryTotalByAppid" resultType="java.lang.Integer">
|
select count(*) from SYS_SYSTEMINFO_APPLY
|
where appid = #{appid}
|
<if test="auditresult != null">
|
and auditresult = #{auditresult}
|
</if>
|
</select>
|
|
<select id="selectCount" resultType="java.lang.Integer">
|
select count(*) appcount from SYS_SYSTEMINFO_APPLY where appid = #{appid}
|
<if test="auditresult != null">
|
and auditresult = #{auditresult}
|
</if>
|
</select>
|
|
<update id="updateResult">
|
update SYS_SYSTEMINFO_APPLY set auditresult = #{auditresult}, auditopinion = #{auditopinion} where id = #{id}
|
</update>
|
</mapper>
|