郑永安
2023-06-19 7a6abd05683528032687c75e80e0bd2030a3e46c
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
<?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.gkhy.safePlatform.account.repository.AppVersionInfoRepository" >
 
    <resultMap id="AppVersionInfo" type="com.gkhy.safePlatform.account.entity.app.AppVersionInfo">
        <result property="id" column="id"/>
        <result property="name" column="name"/>
        <result property="info" column="info"/>
        <result property="customVersion" column="custom_version"/>
        <result property="version" column="version"/>
        <result property="status" column="status"/>
        <result property="appType" column="app_type"/>
        <result property="objectName" column="object_name"/>
        <result property="gmtCreate" column="gmt_create"/>
        <result property="createUid" column="create_uid"/>
        <result property="createUname" column="create_uname"/>
        <result property="gmtModified" column="gmt_modified"/>
        <result property="modifiedUid" column="modified_uid"/>
        <result property="modifiedUname" column="modified_uname"/>
    </resultMap>
    <insert id="insertAppInfo"
            parameterType="com.gkhy.safePlatform.account.entity.app.AppVersionInfo">
        insert
        into sys_app
        <trim prefix="(" suffix=") values" suffixOverrides=",">
            name,
            info,
            custom_version,
            version,
            status,
            app_type,
            object_name,
            gmt_create,
            create_uid,
            create_uname,
        </trim>
        <trim prefix="(" suffix=")" suffixOverrides=",">
            #{name},
            #{info},
            #{customVersion},
            #{version},
            #{status},
            #{appType},
            #{objectName},
            #{gmtCreate},
            #{createUid},
            #{createUname},
        </trim>
    </insert>
    <update id="updateAppInfo"
            parameterType="com.gkhy.safePlatform.account.entity.app.AppVersionInfo">
        update
        sys_app
        <set>
            <if test="name != null and name != ''">
                name = #{name},
            </if>
            <if test="customVersion != null and customVersion != ''">
                custom_version = #{customVersion},
            </if>
            <if test="appType != null">
                app_type = #{appType},
            </if>
            <if test="objectName != null">
                object_name = #{objectName},
            </if>
            <if test="status != null">
                status = #{status},
            </if>
            <if test="gmtModified != null">
                gmt_modified = #{gmtModified},
            </if>
            <if test="modifiedUid != null">
                modified_uid = #{modifiedUid},
            </if>
            <if test="modifiedUname != null and modifiedUname != ''">
                modified_uname = #{modifiedUname},
            </if>
            <if test="info != null">
                info = #{info},
            </if>
        </set>
        where id = #{id}
    </update>
    <select id="listAppVersionInfoByPage"
            resultMap="AppVersionInfo">
        select
        appInfo.id,
        appInfo.name,
        appInfo.info,
        appInfo.custom_version,
        appInfo.version,
        appInfo.status,
        appInfo.app_type,
        appInfo.object_name,
        appInfo.gmt_create,
        appInfo.create_uid,
        appInfo.create_uname,
        appInfo.gmt_modified,
        appInfo.modified_uid,
        appInfo.modified_uname
        from sys_app as appInfo
        where appInfo.status = 1
        <if test="query.appType != null">
            and appInfo.app_type = #{query.appType}
        </if>
        <if test="query.customVersion != null and query.customVersion != ''">
            and appInfo.custom_version like concat("%",#{query.customVersion},"%")
        </if>
        <if test="query.appName != null and query.appName != ''">
            and appInfo.name like concat("%",#{query.appName},"%")
        </if>
        order by appInfo.gmt_create desc
 
 
    </select>
    <select id="getLastestAppRelease"
            resultMap="AppVersionInfo">
        select
        appInfo.id,
        appInfo.name,
        appInfo.info,
        appInfo.custom_version,
        appInfo.version,
        appInfo.status,
        appInfo.app_type,
        appInfo.object_name,
        appInfo.gmt_create,
        appInfo.create_uid,
        appInfo.create_uname,
        appInfo.gmt_modified,
        appInfo.modified_uid,
        appInfo.modified_uname
        from sys_app as appInfo
        where appInfo.status = 1
        order by version desc
        limit 1
    </select>
 
 
</mapper>