zm
2020-05-18 a18bfacbf56b401f6e0fdae8710fbca4df8cff77
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
<?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="cn.autoform.web.mapper.process.ProcessStateMapper">
 
    <resultMap type="cn.autoform.bean.ProcessState" id="stateResult">
        <result property="processState" column="processState"/>
        <result property="processLog" column="processLog"/>
        <result property="processTask" column="processTask"/>
        <result property="processUser" column="processUser"/>
    <!--     <result property="orderStatus" column="orderStatus"/>
        <result property="orderCode" column="orderCode"/> -->
    </resultMap>
    
    <sql id="myCat">
        /*!mycat:sql= select tenantid from FORMDATAMANAGER WHERE TENANTID = '${tenantId}' AND FORMID = '${formId}' */        
    </sql>
    
    <update id ="updateState" parameterType="cn.autoform.bean.ProcessState">
    <include refid="myCat"/> 
        update formdata_${tenantId}_${formId}
            <trim prefix="set" suffixOverrides="," >
                <if test="processState !=null">
                    processState = #{processState},
                </if>
                <if test="processLog !=null">
                    processLog = #{processLog},
                </if>
                <if test="processTask !=null">
                    processTask = #{processTask},
                </if>
                <if test="processUser !=null">
                    processUser = #{processUser} 
                </if>
            </trim>
        where dataRowNum = #{dataRowNum}    
    
    </update>
 
    <select id="selectState" resultMap="stateResult" parameterType="cn.autoform.bean.ProcessState">
        <include refid="myCat"/> 
            SELECT
                processState,
                processLog,
                processTask,
                processUser
            FROM
                formdata_${tenantId}_${formId}
            WHERE
                dataRowNum = #{dataRowNum}
    </select>
 
</mapper>