<?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="com.zcxk.process.dao.WorkflowAssignUserMapper">
    <!--auto generated Code-->
    <resultMap id="BaseResultMap" type="com.zcxk.process.entity.WorkflowAssignUser">
        <result column="id" property="id" jdbcType="INTEGER"/>
        <result column="process_def_id" property="processDefId" jdbcType="VARCHAR"/>
        <result column="task_ref_id" property="taskRefId" jdbcType="VARCHAR"/>
        <result column="version" property="version" jdbcType="INTEGER"/>
        <result column="assign_user" property="assignUser" jdbcType="VARCHAR"/>
        <result column="status" property="status" jdbcType="INTEGER"/>
        <result column="create_by" property="createBy" jdbcType="VARCHAR"/>
        <result column="date_create" property="dateCreate" jdbcType="TIMESTAMP"/>
        <result column="update_by" property="updateBy" jdbcType="VARCHAR"/>
        <result column="date_update" property="dateUpdate" jdbcType="TIMESTAMP"/>
    </resultMap>

    <!--auto generated Code-->
    <sql id="Base_Column_List">
        id,
        process_def_id,
        task_ref_id,
        version,
        assign_user,
        status,
        create_by,
        date_create,
        update_by,
        date_update
    </sql>

    <!--auto generated Code-->
    <insert id="insert" useGeneratedKeys="true" keyProperty="workflowAssignUser.id">
        INSERT INTO sc_workflow_assign_user (
        id,
        process_def_id,
        task_ref_id,
        version,
        assign_user,
        status,
        create_by,
        date_create,
        update_by,
        date_update
        ) VALUES (
        #{workflowAssignUser.id,jdbcType=INTEGER},
        #{workflowAssignUser.processDefId,jdbcType=VARCHAR},
        #{workflowAssignUser.taskRefId,jdbcType=VARCHAR},
        #{workflowAssignUser.version,jdbcType=INTEGER},
        #{workflowAssignUser.assignUser,jdbcType=VARCHAR},
        #{workflowAssignUser.status,jdbcType=INTEGER},
        #{workflowAssignUser.createBy,jdbcType=VARCHAR},
        #{workflowAssignUser.dateCreate,jdbcType=TIMESTAMP},
        #{workflowAssignUser.updateBy,jdbcType=VARCHAR},
        #{workflowAssignUser.dateUpdate,jdbcType=TIMESTAMP}
        )
    </insert>

    <!--auto generated Code-->
    <insert id="insertSelective" useGeneratedKeys="true" keyProperty="workflowAssignUser.id">
        INSERT INTO sc_workflow_assign_user
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="workflowAssignUser.id!=null">id,</if>
            <if test="workflowAssignUser.processDefId!=null">process_def_id,</if>
            <if test="workflowAssignUser.taskRefId!=null">task_ref_id,</if>
            <if test="workflowAssignUser.version!=null">version,</if>
            <if test="workflowAssignUser.assignUser!=null">assign_user,</if>
            <if test="workflowAssignUser.status!=null">status,</if>
            <if test="workflowAssignUser.createBy!=null">create_by,</if>
            <if test="workflowAssignUser.dateCreate!=null">date_create,</if>
            <if test="workflowAssignUser.updateBy!=null">update_by,</if>
            <if test="workflowAssignUser.dateUpdate!=null">date_update,</if>
        </trim>
        VALUES
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="workflowAssignUser.id!=null">#{workflowAssignUser.id,jdbcType=INTEGER},
            </if>
            <if test="workflowAssignUser.processDefId!=null">#{workflowAssignUser.processDefId,jdbcType=VARCHAR},
            </if>
            <if test="workflowAssignUser.taskRefId!=null">#{workflowAssignUser.taskRefId,jdbcType=VARCHAR},
            </if>
            <if test="workflowAssignUser.version!=null">#{workflowAssignUser.version,jdbcType=INTEGER},
            </if>
            <if test="workflowAssignUser.assignUser!=null">#{workflowAssignUser.assignUser,jdbcType=VARCHAR},
            </if>
            <if test="workflowAssignUser.status!=null">#{workflowAssignUser.status,jdbcType=INTEGER},
            </if>
            <if test="workflowAssignUser.createBy!=null">#{workflowAssignUser.createBy,jdbcType=VARCHAR},
            </if>
            <if test="workflowAssignUser.dateCreate!=null">#{workflowAssignUser.dateCreate,jdbcType=TIMESTAMP},
            </if>
            <if test="workflowAssignUser.updateBy!=null">#{workflowAssignUser.updateBy,jdbcType=VARCHAR},
            </if>
            <if test="workflowAssignUser.dateUpdate!=null">#{workflowAssignUser.dateUpdate,jdbcType=TIMESTAMP},
            </if>
        </trim>
    </insert>

    <!--auto generated Code-->
    <insert id="insertList">
        INSERT INTO sc_workflow_assign_user (
        id,
        process_def_id,
        task_ref_id,
        version,
        assign_user,
        status,
        create_by,
        date_create,
        update_by,
        date_update
        )VALUES
        <foreach collection="workflowAssignUsers" item="workflowAssignUser" index="index" separator=",">
            (
            #{workflowAssignUser.id,jdbcType=INTEGER},
            #{workflowAssignUser.processDefId,jdbcType=VARCHAR},
            #{workflowAssignUser.taskRefId,jdbcType=VARCHAR},
            #{workflowAssignUser.version,jdbcType=INTEGER},
            #{workflowAssignUser.assignUser,jdbcType=VARCHAR},
            #{workflowAssignUser.status,jdbcType=INTEGER},
            #{workflowAssignUser.createBy,jdbcType=VARCHAR},
            #{workflowAssignUser.dateCreate,jdbcType=TIMESTAMP},
            #{workflowAssignUser.updateBy,jdbcType=VARCHAR},
            #{workflowAssignUser.dateUpdate,jdbcType=TIMESTAMP}
            )
        </foreach>
    </insert>

    <!--auto generated Code-->
    <update id="updateByPrimaryKeySelective">
        UPDATE sc_workflow_assign_user
        <set>
            <if test="workflowAssignUser.processDefId != null">process_def_id=
                #{workflowAssignUser.processDefId,jdbcType=VARCHAR},
            </if>
            <if test="workflowAssignUser.taskRefId != null">task_ref_id=
                #{workflowAssignUser.taskRefId,jdbcType=VARCHAR},
            </if>
            <if test="workflowAssignUser.version != null">version= #{workflowAssignUser.version,jdbcType=INTEGER},</if>
            <if test="workflowAssignUser.assignUser != null">assign_user=
                #{workflowAssignUser.assignUser,jdbcType=VARCHAR},
            </if>
            <if test="workflowAssignUser.status != null">status= #{workflowAssignUser.status,jdbcType=INTEGER},</if>
            <if test="workflowAssignUser.createBy != null">create_by= #{workflowAssignUser.createBy,jdbcType=VARCHAR},
            </if>
            <if test="workflowAssignUser.dateCreate != null">date_create=
                #{workflowAssignUser.dateCreate,jdbcType=TIMESTAMP},
            </if>
            <if test="workflowAssignUser.updateBy != null">update_by= #{workflowAssignUser.updateBy,jdbcType=VARCHAR},
            </if>
            <if test="workflowAssignUser.dateUpdate != null">date_update=
                #{workflowAssignUser.dateUpdate,jdbcType=TIMESTAMP}
            </if>
        </set>
        WHERE id = #{workflowAssignUser.id,jdbcType=INTEGER}
    </update>
    <select id="singleQuery" resultType="com.zcxk.process.entity.WorkflowAssignUser">
        select
        *
        from
        sc_workflow_assign_user
        where 1=1 and status = 1
        <if test="workflowAssignUser.processDefId!=null">and process_def_id =
            #{workflowAssignUser.processDefId,jdbcType=VARCHAR}
        </if>
        <if test="workflowAssignUser.taskRefId!=null">and task_ref_id =
            #{workflowAssignUser.taskRefId,jdbcType=VARCHAR}
        </if>
        <if test="workflowAssignUser.version!=null">and version = #{workflowAssignUser.version,jdbcType=INTEGER}</if>
    </select>
</mapper>

