<?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.ProcessApprovalMapper">
|
|
<resultMap type="cn.autoform.db.entity.ProcessApproval" id="ApprovalMap">
|
<id property="id" column="id"/>
|
<result property="formId" column="form_id"/>
|
<result property="organizationId" column="organization_id"/>
|
<result property="processDefId" column="processDef_id"/>
|
<result property="defJson" column="def_json"/>
|
<result property="processDefName" column="processDef_Name"/>
|
<result property="templateProcessDefId" column="templateProcessDefId"/>
|
<result property="version" column="version"/>
|
<result property="companyId" column="company_id"/>
|
</resultMap>
|
|
<select id="getApproval" resultMap="ApprovalMap">
|
SELECT
|
id,
|
form_id,
|
organization_id,
|
processDef_id,
|
processDef_Name,
|
templateProcessDefId,
|
def_json,
|
dataState,
|
version
|
FROM
|
process_approval
|
WHERE
|
dataState = 0
|
and organization_id = #{pro.organizationId}
|
and form_id = #{pro.formId}
|
and tenant_id = #{tenantID}
|
LIMIT 1
|
</select>
|
|
<select id="selectProcessApproval" resultMap="ApprovalMap">
|
SELECT
|
id,
|
form_id,
|
organization_id,
|
processDef_id,
|
processDef_Name,
|
templateProcessDefId,
|
def_json,
|
dataState,
|
version
|
FROM
|
process_approval
|
WHERE
|
dataState = 0 and processDef_id = #{processDefId}
|
LIMIT 1
|
</select>
|
|
<select id="select" resultMap="ApprovalMap">
|
SELECT
|
id,
|
form_id,
|
organization_id,
|
processDef_id,
|
processDef_Name,
|
templateProcessDefId,
|
def_json,
|
dataState,
|
version
|
FROM
|
process_approval
|
WHERE
|
dataState = 0
|
and organization_id = #{orgId}
|
and form_id = #{formId}
|
and tenant_id = #{tenantId}
|
LIMIT 1
|
</select>
|
|
<select id="selectApp" resultMap="ApprovalMap">
|
SELECT
|
id,
|
form_id,
|
organization_id,
|
processDef_id,
|
processDef_Name,
|
templateProcessDefId,
|
def_json,
|
dataState,
|
version
|
FROM
|
process_approval
|
WHERE
|
dataState = 0
|
and form_id = #{formId}
|
and tenant_id = #{tenantId}
|
LIMIT 1
|
</select>
|
|
<update id="deleteProcessApproval">
|
UPDATE process_approval
|
SET dataState = 99
|
WHERE
|
processDef_id = #{id}
|
</update>
|
|
<update id="updateDefInfo" parameterType="cn.autoform.db.entity.ProcessApproval">
|
update process_approval
|
<trim prefix="set" suffix="where" suffixOverrides=",">
|
<if test="defJson !=null">
|
def_json = #{defJson},
|
</if>
|
<if test="version != null">
|
version = #{version},
|
</if>
|
</trim>
|
processDef_id = #{processDefId}
|
</update>
|
|
<insert id="addProcessApproval" parameterType="cn.autoform.db.entity.ProcessApproval">
|
INSERT INTO process_approval
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="formId !=null">
|
form_id,
|
</if>
|
<!-- <if test="organizationId !=null">
|
organization_id,
|
</if> -->
|
<if test="processDefId !=null">
|
processDef_id,
|
</if>
|
<if test="processDefName !=null">
|
processDef_Name,
|
</if>
|
<if test="defJson !=null">
|
def_json,
|
</if>
|
<if test="true">
|
dataState,
|
</if>
|
<if test="templateProcessDefId !=null">
|
templateProcessDefId,
|
</if>
|
<if test="version !=null">
|
version,
|
</if>
|
<if test="tenantID !=null">
|
tenant_id
|
</if>
|
</trim>
|
VALUES
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="formId !=null">
|
#{formId},
|
</if>
|
<!-- <if test="organizationId !=null">
|
#{organizationId},
|
</if> -->
|
<if test="processDefId !=null">
|
#{processDefId},
|
</if>
|
<if test="processDefName">
|
#{processDefName},
|
</if>
|
<if test="defJson !=null">
|
#{defJson},
|
</if>
|
<if test="true">
|
0,
|
</if>
|
<if test="templateProcessDefId !=null">
|
#{templateProcessDefId},
|
</if>
|
<if test="version !=null">
|
#{version},
|
</if>
|
<if test="tenantID !=null">
|
#{tenantID}
|
</if>
|
</trim>
|
|
</insert>
|
|
|
|
|
|
|
|
|
</mapper>
|