刘光辉
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
<?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.DmsWenjianMingchengBiangengShenqingMapper">
 
    <resultMap id="BaseResultMap" type="jnpf.dmsEntity.DmsWenjianMingchengBiangengShenqingEntity">
        <id column="f_id" property="id"/>
        <result column="f_tenant_id" property="tenantId"/>
        <result column="f_flow_id" property="flowId"/>
        <result column="f_flow_task_id" property="flowTaskId"/>
        <result column="f_flow_state" property="flowState"/>
        <result column="f_delete_mark" property="deleteMark"/>
        <result column="bianhao_id" property="bianhaoId"/>
        <result column="yuan_wenjian_mingcheng" property="yuanWenjianMingcheng"/>
        <result column="yuan_mingcheng_banben" property="yuanMingchengBanben"/>
        <result column="biangeng_hou_wenjian_mingcheng" property="biangengHouWenjianMingcheng"/>
    </resultMap>
 
    <select id="selectByFlowForUpdate" resultMap="BaseResultMap">
        SELECT f_id, f_tenant_id, f_flow_id, f_flow_task_id, f_flow_state,
               f_delete_mark, bianhao_id, yuan_wenjian_mingcheng,
               yuan_mingcheng_banben, biangeng_hou_wenjian_mingcheng
        FROM dms_wenjian_mingcheng_biangeng_shenqing
        WHERE f_tenant_id = #{tenantId}
          AND f_flow_id = #{flowId}
          AND f_flow_task_id = #{taskId}
          AND (f_delete_mark IS NULL OR f_delete_mark &lt;&gt; 1)
        FOR UPDATE
    </select>
 
    <select id="countActiveByNumber" resultType="int">
        SELECT COUNT(1)
        FROM dms_wenjian_mingcheng_biangeng_shenqing
        WHERE f_tenant_id = #{tenantId}
          AND bianhao_id = #{numberId}
          AND f_id &lt;&gt; #{excludedId}
          AND f_flow_state IN (1, 5, 6, 8, 10)
          AND (f_delete_mark IS NULL OR f_delete_mark &lt;&gt; 1)
    </select>
 
</mapper>