zm
2020-05-18 a18bfacbf56b401f6e0fdae8710fbca4df8cff77
commit | author | age
a18bfa 1 <?xml version="1.0" encoding="UTF-8"?>
Z 2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >  
3 <mapper namespace="cn.autoform.web.mapper.process.ProcessStateMapper">
4
5     <resultMap type="cn.autoform.bean.ProcessState" id="stateResult">
6         <result property="processState" column="processState"/>
7         <result property="processLog" column="processLog"/>
8         <result property="processTask" column="processTask"/>
9         <result property="processUser" column="processUser"/>
10     <!--     <result property="orderStatus" column="orderStatus"/>
11         <result property="orderCode" column="orderCode"/> -->
12     </resultMap>
13     
14     <sql id="myCat">
15         /*!mycat:sql= select tenantid from FORMDATAMANAGER WHERE TENANTID = '${tenantId}' AND FORMID = '${formId}' */        
16     </sql>
17     
18     <update id ="updateState" parameterType="cn.autoform.bean.ProcessState">
19     <include refid="myCat"/> 
20         update formdata_${tenantId}_${formId}
21             <trim prefix="set" suffixOverrides="," >
22                 <if test="processState !=null">
23                     processState = #{processState},
24                 </if>
25                 <if test="processLog !=null">
26                     processLog = #{processLog},
27                 </if>
28                 <if test="processTask !=null">
29                     processTask = #{processTask},
30                 </if>
31                 <if test="processUser !=null">
32                     processUser = #{processUser} 
33                 </if>
34             </trim>
35         where dataRowNum = #{dataRowNum}    
36     
37     </update>
38
39     <select id="selectState" resultMap="stateResult" parameterType="cn.autoform.bean.ProcessState">
40         <include refid="myCat"/> 
41             SELECT
42                 processState,
43                 processLog,
44                 processTask,
45                 processUser
46             FROM
47                 formdata_${tenantId}_${formId}
48             WHERE
49                 dataRowNum = #{dataRowNum}
50     </select>
51
52 </mapper>