JxglAppraisalTMapper.xml 8.17 KB
Newer Older
1 2 3 4
<?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.jxgl.JxglAppraisalTMapper">
tangzhaoqian committed
5
    
6 7 8 9 10 11 12
    <resultMap id="BaseResultMap" type="cn.timer.api.bean.jxgl.JxglAppraisalT" >
                <id column="id" property="id" />
                <result column="org_code" property="orgCode" />
                <result column="name" property="name" />
                <result column="appraisal_explain" property="appraisalExplain" />
                <result column="create_time" property="createTime" />
                <result column="update_time" property="updateTime" />
tangzhaoqian committed
13 14 15
                <result column="is_edit" property="isEdit" />
                <result column="is_use_fixd" property="isUseFixd" />
                <result column="is_use_not_fixd" property="isUseNotFixd" />
16
    </resultMap>
17 18 19 20 21
    
    <resultMap id="BaseResultMap_b" type="cn.timer.api.bean.jxgl.JxglAppraisalIndicatorsT" >
                <id column="id" property="id" />
                <result column="appraisal_t_id" property="appraisalTId" />
                <result column="title" property="title" />
22
                <result column="content" property="content" />
23 24 25 26
                <result column="weight" property="weight" />
                <result column="create_time" property="createTime" />
                <result column="update_time" property="updateTime" />
                <result column="type" property="type" />
27
                <result column="is_edit_weight" property="isEditWeight" />
28 29 30 31 32 33 34 35 36 37 38 39
                <collection column="JxglAppraisalItemT_id" property="appraisalItemTs" ofType="cn.timer.api.bean.jxgl.JxglAppraisalItemT" 
	                resultMap="cn.timer.api.dao.jxgl.JxglAppraisalItemTMapper.BaseResultMap" columnPrefix="JxglAppraisalItemT_">
			    </collection>
    </resultMap>
    
    <resultMap id="BaseResultMap_All" type="cn.timer.api.bean.jxgl.JxglAppraisalT" >
                <id column="id" property="id" />
                <result column="org_code" property="orgCode" />
                <result column="name" property="name" />
                <result column="appraisal_explain" property="appraisalExplain" />
                <result column="create_time" property="createTime" />
                <result column="update_time" property="updateTime" />
tangzhaoqian committed
40 41 42
                <result column="is_edit" property="isEdit" />
                <result column="is_use_fixd" property="isUseFixd" />
                <result column="is_use_not_fixd" property="isUseNotFixd" />
43 44 45 46
                <collection column="JxglAppraisalIndicatorsT_id" property="appraisalIndicatorsTs" ofType="cn.timer.api.bean.jxgl.JxglAppraisalIndicatorsT" 
	                resultMap="cn.timer.api.dao.jxgl.JxglAppraisalTMapper.BaseResultMap_b" columnPrefix="JxglAppraisalIndicatorsT_">
			    </collection>
    </resultMap>
47 48 49 50 51 52 53

    <sql id="Base_Column_List">
                id,
                org_code,
                name,
                appraisal_explain,
                create_time,
tangzhaoqian committed
54 55 56 57
                update_time,
                is_edit,
                is_use_fixd,
                is_use_not_fixd
58 59 60 61 62 63 64 65
    </sql>
    
    <sql id="Base_Column_List_Alias">
                id JxglAppraisalT_id,
                org_code JxglAppraisalT_org_code,
                name JxglAppraisalT_name,
                appraisal_explain JxglAppraisalT_appraisal_explain,
                create_time JxglAppraisalT_create_time,
tangzhaoqian committed
66 67 68 69
                update_time JxglAppraisalT_update_time,
                is_edit JxglAppraisalT_is_edit,
                is_use_fixd JxglAppraisalT_is_use_fixd,
                is_use_not_fixd JxglAppraisalT_is_use_not_fixd
70
    </sql>
71 72 73 74 75 76 77
    
    <sql id="Base_Column_List_a">
                a.id,
                a.org_code,
                a.name,
                a.appraisal_explain,
                a.create_time,
tangzhaoqian committed
78 79 80 81
                a.update_time,
                a.is_edit,
                a.is_use_fixd,
                a.is_use_not_fixd
82 83 84 85 86 87
    </sql>
    
    <sql id="Base_Column_List_Alias_b">
                b.id JxglAppraisalIndicatorsT_id,
                b.appraisal_t_id JxglAppraisalIndicatorsT_appraisal_t_id,
                b.title JxglAppraisalIndicatorsT_title,
88
                b.content JxglAppraisalIndicatorsT_content,
89 90 91
                b.weight JxglAppraisalIndicatorsT_weight,
                b.create_time JxglAppraisalIndicatorsT_create_time,
                b.update_time JxglAppraisalIndicatorsT_update_time,
92 93
                b.type JxglAppraisalIndicatorsT_type,
                b.is_edit_weight JxglAppraisalIndicatorsT_is_edit_weight
94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114
    </sql>
    
    <sql id="Base_Column_List_Alias_c">
                c.id JxglAppraisalIndicatorsT_JxglAppraisalItemT_id,
                c.appraisal_indicators_t_id JxglAppraisalIndicatorsT_JxglAppraisalItemT_appraisal_indicators_t_id,
                c.title JxglAppraisalIndicatorsT_JxglAppraisalItemT_title,
                c.content JxglAppraisalIndicatorsT_JxglAppraisalItemT_content,
                c.ranks JxglAppraisalIndicatorsT_JxglAppraisalItemT_ranks
    </sql>
    
    <select id="selectDetailById" resultMap="BaseResultMap_All">
        SELECT 
        	<include refid="Base_Column_List_a" />,
        	<include refid="Base_Column_List_Alias_b" />,
        	<include refid="Base_Column_List_Alias_c" />
        FROM jxgl_appraisal_t a
        LEFT JOIN jxgl_appraisal_indicators_t b ON a.id = b.appraisal_t_id
        LEFT JOIN jxgl_appraisal_item_t c ON b.id = c.appraisal_indicators_t_id
        WHERE a.id = #{id}
    </select>
    
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 152 153 154 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 183 184 185 186 187 188 189 190 191
	<!-- 
    <insert id="insert" useGeneratedKeys="true" keyColumn="id" parameterType="cn.timer.api.bean.jxgl.JxglAppraisalT">
        INSERT INTO jxgl_appraisal_t
        <trim prefix="(" suffix=")" suffixOverrides=",">
                        <if test ='null != orgCode'>
                        org_code,
                        </if>
                        <if test ='null != name'>
                        name,
                        </if>
                        <if test ='null != appraisalExplain'>
                        appraisal_explain,
                        </if>
                        <if test ='null != createTime'>
                        create_time,
                        </if>
                        <if test ='null != updateTime'>
                        update_time
                        </if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
                        <if test ='null != orgCode'>
                        #{orgCode},
                        </if>
                        <if test ='null != name'>
                        #{name},
                        </if>
                        <if test ='null != appraisalExplain'>
                        #{appraisalExplain},
                        </if>
                        <if test ='null != createTime'>
                        #{createTime},
                        </if>
                        <if test ='null != updateTime'>
                        #{updateTime}
                        </if>
        </trim>
    </insert>

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

    <update id="update" parameterType="cn.timer.api.bean.jxgl.JxglAppraisalT">
        UPDATE jxgl_appraisal_t
        <set>
                    <if test ='null != orgCode'>org_code = #{orgCode},</if>
                    <if test ='null != name'>name = #{name},</if>
                    <if test ='null != appraisalExplain'>appraisal_explain = #{appraisalExplain},</if>
                    <if test ='null != createTime'>create_time = #{createTime},</if>
                    <if test ='null != updateTime'>update_time = #{updateTime}</if>
        </set>
        WHERE id = #{id}
    </update>


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

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

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

	 -->

</mapper>