刘光辉
15 小时以前 34981c30a78e8bbd7791131059a9210f9928b62c
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
<?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="jnpf.dmsMapper.DmsWenjianBanbenKongzhiMapper">
 
    <resultMap id="BaseResultMap" type="jnpf.dmsEntity.DmsWenjianBanbenKongzhiEntity">
        <id column="f_id" property="id"/>
        <result column="f_tenant_id" property="tenantId"/>
        <result column="wenjian_id" property="wenjianId"/>
        <result column="banben_xuhao" property="banbenXuhao"/>
        <result column="biangeng_xuhao" property="biangengXuhao"/>
        <result column="zuihou_shengxiao_leixing" property="zuihouShengxiaoLeixing"/>
        <result column="zuihou_shengxiao_danju_id" property="zuihouShengxiaoDanjuId"/>
        <result column="biz_status" property="bizStatus"/>
        <result column="f_creator_user_id" property="creatorUserId"/>
        <result column="f_creator_time" property="creatorTime"/>
        <result column="f_last_modify_user_id" property="lastModifyUserId"/>
        <result column="f_last_modify_time" property="lastModifyTime"/>
        <result column="f_delete_mark" property="deleteMark"/>
    </resultMap>
 
    <sql id="BaseColumns">
        f_id, f_tenant_id, wenjian_id, banben_xuhao, biangeng_xuhao,
        zuihou_shengxiao_leixing, zuihou_shengxiao_danju_id, biz_status,
        f_creator_user_id, f_creator_time, f_last_modify_user_id,
        f_last_modify_time, f_delete_mark
    </sql>
 
    <select id="selectByFileForUpdate" resultMap="BaseResultMap">
        SELECT <include refid="BaseColumns"/>
        FROM dms_wenjian_banben_kongzhi
        WHERE f_tenant_id = #{tenantId}
          AND wenjian_id = #{wenjianId}
          AND (f_delete_mark IS NULL OR f_delete_mark &lt;&gt; 1)
        FOR UPDATE
    </select>
 
    <insert id="insertControl">
        INSERT INTO dms_wenjian_banben_kongzhi (
            f_id, f_tenant_id, wenjian_id, banben_xuhao, biangeng_xuhao,
            zuihou_shengxiao_leixing, zuihou_shengxiao_danju_id, biz_status,
            f_creator_user_id, f_creator_time, f_last_modify_user_id,
            f_last_modify_time, f_delete_mark
        ) VALUES (
            #{id}, #{tenantId}, #{wenjianId}, #{banbenXuhao}, #{biangengXuhao},
            #{zuihouShengxiaoLeixing}, #{zuihouShengxiaoDanjuId}, #{bizStatus},
            #{creatorUserId}, #{creatorTime}, #{lastModifyUserId},
            #{lastModifyTime}, #{deleteMark}
        )
    </insert>
 
    <update id="advance">
        UPDATE dms_wenjian_banben_kongzhi
        SET banben_xuhao = #{entity.banbenXuhao},
            biangeng_xuhao = #{entity.biangengXuhao},
            zuihou_shengxiao_leixing = #{entity.zuihouShengxiaoLeixing},
            zuihou_shengxiao_danju_id = #{entity.zuihouShengxiaoDanjuId},
            biz_status = #{entity.bizStatus},
            f_last_modify_user_id = #{entity.lastModifyUserId},
            f_last_modify_time = #{entity.lastModifyTime}
        WHERE f_id = #{entity.id}
          AND f_tenant_id = #{entity.tenantId}
          AND banben_xuhao = #{expectedBanbenXuhao}
          AND biangeng_xuhao = #{expectedBiangengXuhao}
          AND (f_delete_mark IS NULL OR f_delete_mark &lt;&gt; 1)
    </update>
 
</mapper>