1
13693261870
2022-09-16 762f2fb45db004618ba099aa3c0bd89dba1eb843
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
75
76
77
78
79
80
81
82
83
84
85
86
87
<?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.OthMenuvisitDao">
 
    <!-- 可根据自己的需求,是否要使用 -->
    <resultMap type="com.landtool.lanbase.modules.sys.entity.OthMenuvisit" id="menuvisitMap">
        <result property="visitid" column="VISITID"/>
        <result property="menu" column="MENU"/>
        <result property="visittotal" column="VISITTOTAL"/>
        <result property="userid" column="USERID"/>
        <result property="lastvisitdate" column="LASTVISITDATE"/>
    </resultMap>
 
    <select id="queryObject" resultType="com.landtool.lanbase.modules.sys.entity.OthMenuvisit">
        select * from OTH_MENUVISIT where VISITID = #{value}
    </select>
 
    <select id="queryList" resultType="com.landtool.lanbase.modules.sys.entity.OthMenuvisit">
 
        SELECT /*+ FIRST_ROWS */ * FROM
        (
        SELECT A.*, row_number() over() as  RN
        FROM (
 
        select * from OTH_MENUVISIT
        order by ${sidx} ${order}<choose>
                        <when test="sidx != null and sidx.trim() != ''">
                            order by ${sidx} ${order}
                        </when>
                        <otherwise>
                            order by VISITID desc
                        </otherwise>
                    </choose>
 
            ) A
            WHERE RN <![CDATA[<=]]>  #{upperOffset}
        ) tmp
        WHERE RN > #{lowerOffset}
    </select>
    
     <select id="queryTotal" resultType="int">
        select count(*) from OTH_MENUVISIT
    </select>
     
    <insert id="save" parameterType="com.landtool.lanbase.modules.sys.entity.OthMenuvisit">
        insert into SERVERRG
        (
            serverurl, 
            resouceid, 
            ispublic, 
            urlid
        )
        values
        (
            #{serverurl}, 
            #{resouceid}, 
            #{ispublic}, 
            #{urlid}
        )
    </insert>
     
    <update id="update" parameterType="com.landtool.lanbase.modules.sys.entity.OthMenuvisit">
        update OTH_MENUVISIT
        <set>
            <if test="menu != null">MENU = #{menu}, </if>
            <if test="visittotal != null">VISITTOTAL = #{visittotal}, </if>
            <if test="userid != null">USERID = #{userid}, </if>
            <if test="lastvisitdate != null">LASTVISITDATE = #{lastvisitdate}</if>
        </set>
        where VISITID = #{visitid}
    </update>
    
    <delete id="delete">
        delete from OTH_MENUVISIT where VISITID = #{value}
    </delete>
    
    <delete id="deleteBatch">
        delete from OTH_MENUVISIT where VISITID in
        <foreach item="visitid" collection="array" open="(" separator="," close=")">
            #{visitid}
        </foreach>
    </delete>
 
    <select id="selectByMenuVisitid" parameterType="com.landtool.lanbase.modules.sys.entity.OthMenuvisit" resultType="com.landtool.lanbase.modules.sys.entity.OthMenuvisit">
        SELECT * FROM OTH_MENUVISIT WHERE MENU = #{menu} AND USERID = #{userid}
    </select>
</mapper>