郑永安
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
<?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.safeCheck.repository.SafeCheckQuotaRepository" >
    <resultMap id="BaseResultMap" type="com.gkhy.safePlatform.safeCheck.entity.SafeCheckQuota" >
        <id column="id" property="id" />
        <result column="quota" property="quota"/>
        <result column="quota_unit" property="quotaUnit"/>
        <result column="quota_type" property="quotaType"/>
        <result column="delete_status" property="deleteStatus" />
        <result column="gmt_create" property="gmtCreate" />
        <result column="create_user_name" property="createUserName" />
        <result column="gmt_moditify" property="gmtModitify" />
        <result column="last_edit_user_name" property="lastEditUserName" />
    </resultMap>
    <update id="deleteQuotaById" >
        update safe_check_quota set
            delete_status = #{quota.deleteStatus},
            gmt_moditify = #{quota.gmtModitify},
            last_edit_user_name = #{quota.lastEditUserName}
        where id = #{quota.id} and delete_status = #{deleteStatus}
    </update>
 
    <update id="updateQuotaById"  >
        update safe_check_quota set
            quota = #{safeCheckQuota.quota},
            quota_unit = #{safeCheckQuota.quotaUnit},
            quota_type = #{safeCheckQuota.quotaType},
            gmt_moditify = #{safeCheckQuota.gmtModitify},
            last_edit_user_name = #{safeCheckQuota.lastEditUserName}
        where id = #{safeCheckQuota.id} and delete_status = #{status}
    </update>
 
    <select id="getQuotaByName" resultType="com.gkhy.safePlatform.safeCheck.entity.SafeCheckQuota">
        select id,
               quota,
               quota_unit,
               quota_type,
               delete_status,
               gmt_create,
               create_user_name,
               gmt_moditify,
               last_edit_user_name
        from safe_check_quota
        where quota = #{quotaName} and  delete_status = #{deleteStatus}
    </select>
 
    <select id="getQuataById" resultType="com.gkhy.safePlatform.safeCheck.entity.SafeCheckQuota">
        select id,
               quota,
               quota_unit,
               quota_type,
               delete_status,
               gmt_create,
               create_user_name,
               gmt_moditify,
               last_edit_user_name
        from safe_check_quota
        where id = #{id} and  delete_status = #{deleteStatus}
    </select>
 
</mapper>