SpmkCustomApprovalMapper.xml 8.37 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
<?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.SpmkCustomApprovalMapper">

    <resultMap id="BaseResultMap" type="cn.timer.api.bean.spmk.SpmkCustomApproval" >
                <id column="id" property="id" />
                <result column="org_code" property="orgCode" />
                <result column="approval_g_id" property="approvalGId" />
                <result column="icon_url" property="iconUrl" />
                <result column="name" property="name" />
                <result column="description" property="description" />
                <result column="is_open" property="isOpen" />
                <result column="ranks" property="ranks" />
                <result column="is_opinion" property="isOpinion" />
                <result column="update_time" property="updateTime" />
                <result column="create_time" property="createTime" />
                <result column="asso_type" property="assoType" />
19
                <result column="is_allvisible" property="isAllvisible" />
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
                <result column="froms" property="froms" />
                <result column="router" property="router" />
    </resultMap>

    <sql id="Base_Column_List">
                id,
                org_code,
                approval_g_id,
                icon_url,
                name,
                description,
                is_open,
                ranks,
                is_opinion,
                update_time,
                create_time,
                asso_type,
37
                is_allvisible,
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
                froms,
                router
    </sql>
    
    <sql id="Base_Column_List_Alias">
                id SpmkCustomApproval_id,
                org_code SpmkCustomApproval_org_code,
                approval_g_id SpmkCustomApproval_approval_g_id,
                icon_url SpmkCustomApproval_icon_url,
                name SpmkCustomApproval_name,
                description SpmkCustomApproval_description,
                is_open SpmkCustomApproval_is_open,
                ranks SpmkCustomApproval_ranks,
                is_opinion SpmkCustomApproval_is_opinion,
                update_time SpmkCustomApproval_update_time,
                create_time SpmkCustomApproval_create_time,
                asso_type SpmkCustomApproval_asso_type,
55
                is_allvisible SpmkCustomApproval_is_allvisible,
56 57 58 59 60 61 62 63 64 65 66 67 68 69 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 103 104 105 106 107
                froms SpmkCustomApproval_froms,
                router SpmkCustomApproval_router
    </sql>
    
    <update id="updateListRandsById" parameterType="list">
        <foreach item="item" index="index" collection="list" open="" separator=";" close="">
	        		UPDATE spmk_custom_approval
			        <set>
			                    <if test ='null != item.ranks'>ranks = #{item.ranks},</if>
			        </set>
			        WHERE id = #{item.id}
		</foreach>
    </update>

	<!-- 

    <insert id="insert" useGeneratedKeys="true" keyColumn="id" parameterType="cn.timer.api.bean.spmk.SpmkCustomApproval">
        INSERT INTO spmk_custom_approval
        <trim prefix="(" suffix=")" suffixOverrides=",">
                        <if test ='null != orgCode'>
                        org_code,
                        </if>
                        <if test ='null != approvalGId'>
                        approval_g_id,
                        </if>
                        <if test ='null != iconUrl'>
                        icon_url,
                        </if>
                        <if test ='null != name'>
                        name,
                        </if>
                        <if test ='null != description'>
                        description,
                        </if>
                        <if test ='null != isOpen'>
                        is_open,
                        </if>
                        <if test ='null != ranks'>
                        ranks,
                        </if>
                        <if test ='null != isOpinion'>
                        is_opinion,
                        </if>
                        <if test ='null != updateTime'>
                        update_time,
                        </if>
                        <if test ='null != createTime'>
                        create_time,
                        </if>
                        <if test ='null != assoType'>
                        asso_type,
                        </if>
108 109 110
                        <if test ='null != isAllvisible'>
                        is_allvisible,
                        </if>
111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151
                        <if test ='null != froms'>
                        froms,
                        </if>
                        <if test ='null != router'>
                        router
                        </if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
                        <if test ='null != orgCode'>
                        #{orgCode},
                        </if>
                        <if test ='null != approvalGId'>
                        #{approvalGId},
                        </if>
                        <if test ='null != iconUrl'>
                        #{iconUrl},
                        </if>
                        <if test ='null != name'>
                        #{name},
                        </if>
                        <if test ='null != description'>
                        #{description},
                        </if>
                        <if test ='null != isOpen'>
                        #{isOpen},
                        </if>
                        <if test ='null != ranks'>
                        #{ranks},
                        </if>
                        <if test ='null != isOpinion'>
                        #{isOpinion},
                        </if>
                        <if test ='null != updateTime'>
                        #{updateTime},
                        </if>
                        <if test ='null != createTime'>
                        #{createTime},
                        </if>
                        <if test ='null != assoType'>
                        #{assoType},
                        </if>
152 153 154
                        <if test ='null != isAllvisible'>
                        #{isAllvisible},
                        </if>
155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182
                        <if test ='null != froms'>
                        #{froms},
                        </if>
                        <if test ='null != router'>
                        #{router}
                        </if>
        </trim>
    </insert>

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

    <update id="update" parameterType="cn.timer.api.bean.spmk.SpmkCustomApproval">
        UPDATE spmk_custom_approval
        <set>
                    <if test ='null != orgCode'>org_code = #{orgCode},</if>
                    <if test ='null != approvalGId'>approval_g_id = #{approvalGId},</if>
                    <if test ='null != iconUrl'>icon_url = #{iconUrl},</if>
                    <if test ='null != name'>name = #{name},</if>
                    <if test ='null != description'>description = #{description},</if>
                    <if test ='null != isOpen'>is_open = #{isOpen},</if>
                    <if test ='null != ranks'>ranks = #{ranks},</if>
                    <if test ='null != isOpinion'>is_opinion = #{isOpinion},</if>
                    <if test ='null != updateTime'>update_time = #{updateTime},</if>
                    <if test ='null != createTime'>create_time = #{createTime},</if>
                    <if test ='null != assoType'>asso_type = #{assoType},</if>
183
                    <if test ='null != isAllvisible'>is_allvisible = #{isAllvisible},</if>
184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210
                    <if test ='null != froms'>froms = #{froms},</if>
                    <if test ='null != router'>router = #{router}</if>
        </set>
        WHERE id = #{id}
    </update>


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

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

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

	 -->

</mapper>