SpmkApproveExecuteRecordMapper.xml 6.47 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12
<?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.timer.api.dao.spmk.SpmkApproveExecuteRecordMapper">

    <resultMap id="BaseResultMap" type="cn.timer.api.bean.spmk.SpmkApproveExecuteRecord" >
                <id column="id" property="id" />
                <result column="approve_summary_id" property="approveSummaryId" />
                <result column="name" property="name" />
                <result column="type" property="type" />
                <result column="sts" property="sts" />
                <result column="create_time" property="createTime" />
13
                <result column="update_time" property="updateTime" />
14 15 16 17 18 19 20 21 22
    </resultMap>
    
    <resultMap id="BaseResultMapDto" type="cn.timer.api.bean.spmk.SpmkApproveExecuteRecord" >
                <id column="id" property="id" />
                <result column="approve_summary_id" property="approveSummaryId" />
                <result column="name" property="name" />
                <result column="type" property="type" />
                <result column="sts" property="sts" />
                <result column="create_time" property="createTime" />
23
                <result column="update_time" property="updateTime" />
24 25 26 27 28 29 30 31 32 33 34
                <collection column="SpmkExecutor_id" property="spmkExecutors" ofType="cn.timer.api.bean.spmk.SpmkExecutor" 
                resultMap="cn.timer.api.dao.spmk.SpmkExecutorMapper.BaseResultMap" columnPrefix="SpmkExecutor_">
		        </collection>
    </resultMap>

    <sql id="Base_Column_List">
                id,
                approve_summary_id,
                name,
                type,
                sts,
35 36
                create_time,
                update_time
37 38 39 40 41 42 43 44
    </sql>
    
    <sql id="Base_Column_List_a">
                a.id,
                a.approve_summary_id,
                a.name,
                a.type,
                a.sts,
45 46
                a.create_time,
                a.update_time
47 48 49 50 51 52 53 54 55 56
    </sql>
    
    <sql id="Base_Column_List_Alias_b">
            b.id SpmkExecutor_id,
            b.approve_execute_record_id SpmkExecutor_approve_execute_record_id,
            b.emp_num SpmkExecutor_emp_num,
            b.executor_name SpmkExecutor_executor_name,
            b.operator_header_url SpmkExecutor_operator_header_url,
            b.opinion SpmkExecutor_opinion,
            b.sts SpmkExecutor_sts,
57
            b.create_time SpmkExecutor_create_time,
龙于生 committed
58 59
            b.update_time SpmkExecutor_update_time,
            b.signature_img SpmkExecutor_signature_img
60 61 62 63 64 65 66 67
    </sql>
    
    <sql id="Base_Column_List_Alias">
                id SpmkApproveExecuteRecord_id,
                approve_summary_id SpmkApproveExecuteRecord_approve_summary_id,
                name SpmkApproveExecuteRecord_name,
                type SpmkApproveExecuteRecord_type,
                sts SpmkApproveExecuteRecord_sts,
68 69
                create_time SpmkApproveExecuteRecord_create_time,
                update_time SpmkApproveExecuteRecord_update_time
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102
    </sql>
    
    
    <select id="selectListByAsId" resultMap="BaseResultMapDto">
        SELECT 
        	<include refid="Base_Column_List_a" />,
        	<include refid="Base_Column_List_Alias_b" />
        FROM spmk_approve_execute_record a
         
        LEFT JOIN spmk_executor b ON a.id = b.approve_execute_record_id
        
        WHERE a.approve_summary_id = #{id}  
        ORDER BY a.id, b.id
    </select>

	<!-- 

    <insert id="insert" useGeneratedKeys="true" keyColumn="id" parameterType="cn.timer.api.bean.spmk.SpmkApproveExecuteRecord">
        INSERT INTO spmk_approve_execute_record
        <trim prefix="(" suffix=")" suffixOverrides=",">
                        <if test ='null != approveSummaryId'>
                        approve_summary_id,
                        </if>
                        <if test ='null != name'>
                        name,
                        </if>
                        <if test ='null != type'>
                        type,
                        </if>
                        <if test ='null != sts'>
                        sts,
                        </if>
                        <if test ='null != createTime'>
103 104 105 106
                        create_time,
                        </if>
                        <if test ='null != updateTime'>
                        update_time
107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123
                        </if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
                        <if test ='null != approveSummaryId'>
                        #{approveSummaryId},
                        </if>
                        <if test ='null != name'>
                        #{name},
                        </if>
                        <if test ='null != type'>
                        #{type},
                        </if>
                        <if test ='null != sts'>
                        #{sts},
                        </if>
                        <if test ='null != createTime'>
                        #{createTime}
124 125 126
                        </if>,
                        <if test ='null != updateTime'>
                        #{updateTime}
127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142
                        </if>
        </trim>
    </insert>

    <delete id="delete" >
        DELETE FROM spmk_approve_execute_record
        WHERE id = #{id}
    </delete>

    <update id="update" parameterType="cn.timer.api.bean.spmk.SpmkApproveExecuteRecord">
        UPDATE spmk_approve_execute_record
        <set>
                    <if test ='null != approveSummaryId'>approve_summary_id = #{approveSummaryId},</if>
                    <if test ='null != name'>name = #{name},</if>
                    <if test ='null != type'>type = #{type},</if>
                    <if test ='null != sts'>sts = #{sts},</if>
143 144
                    <if test ='null != createTime'>create_time = #{createTime},</if>
                    <if test ='null != updateTime'>update_time = #{updateTime}</if>
145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169
        </set>
        WHERE id = #{id}
    </update>


    <select id="load" resultMap="BaseResultMap">
        SELECT <include refid="Base_Column_List" />
        FROM spmk_approve_execute_record
        WHERE id = #{id}
    </select>

    <select id="pageList" resultMap="BaseResultMap">
        SELECT <include refid="Base_Column_List" />
        FROM spmk_approve_execute_record
        LIMIT #{offset}, #{pageSize}
    </select>

    <select id="pageListCount" resultType="java.lang.Integer">
        SELECT count(1)
        FROM spmk_approve_execute_record
    </select>

	 -->

</mapper>