6
jinlin
2023-11-29 d89ef43c4713adf26f74b796653d1dd15ff1f81a
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
<?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.zt.life.sys.dao.SysOssConfigDao">
 
 
    <select id="getList" resultType="com.zt.life.sys.model.SysOssConfig">
        select a.*
        from SYS_OSS_CONFIG a
        <where>
            a.is_delete = 0
            <if test="whereSql!=null">
                and ${whereSql}
            </if>
        </where>
        ORDER BY busi_type, busi_field, sort
    </select>
    <select id="existsSameTypeAndFiledGroup" resultType="java.lang.Integer">
        SELECT
        case when exists(select 1 FROM `sys_oss_config` where is_delete=0 and BUSI_FIELD_GROUP=#{busiFieldGroup} and BUSI_TYPE
        &lt;&gt; #{busiType}  and id  &lt;&gt; #{id})
        then 1
        when exists(select 1 FROM `sys_oss_config` where is_delete=0 and BUSI_FIELD_GROUP=#{busiFieldGroup} and BUSI_TYPE = #{busiType} and id
         &lt;&gt; #{id})
        then 2
        else 0 end
    </select>
    <select id="existsSameGroupById" resultType="java.lang.Integer">
        select count(1) FROM `sys_oss_config` where is_delete=0 and  BUSI_FIELD_GROUP = #{busiFiledGroup}
        <if test="id!=null">
            and busi_type &lt;&gt; #{id}
        </if>
    </select>
    <update id="updateByBusiType">
        update  sys_oss_config set IS_DELETE=1,UPDATE_DATE = CURRENT_TIMESTAMP where BUSI_TYPE=#{busiType}
    </update>
</mapper>