QyzxEmpEntAssoMapper.xml 4 KB
Newer Older
yuquan.zhu committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
<?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.qyzx.QyzxEmpEntAssoMapper">

    <resultMap id="BaseResultMap" type="cn.timer.api.bean.qyzx.QyzxEmpEntAsso" >
                <id column="id" property="id" />
                <result column="emp_num" property="empNum" />
                <result column="org_code" property="orgCode" />
                <result column="user_type" property="userType" />
    </resultMap>

    <sql id="Base_Column_List">
                id,
                emp_num,
                org_code,
                user_type
    </sql>

    <resultMap id="adminlistdto" type="cn.timer.api.dto.qyzx.AdminListDto" >
        <result column="emp_num" property="empNum" />
        <result column="user_type" property="userType" />
        <result column="status" property="status" />
        <result column="org_id" property="orgId" />
        <result column="email" property="email" />
        <result column="reg_time" property="regTime" />
        <result column="head_url" property="headUrl" />
        <result column="phone" property="phone" />
        <result column="username" property="username" />
        <result column="name" property="empName" />
        <result column="english_name" property="enName" />
        <result column="bmgw_id" property="bmgwId" />
        <result column="sex" property="sex" />
        <result column="job_num" property="jobNum" />
    </resultMap>

    <select id="adminlist"
38 39
        resultMap="adminlistdto" ><!-- b.email,b.end_time,b.reg_time, -->
        select a.emp_num,a.user_type,a.status,b.org_id,b.email,b.reg_time,b.head_url,b.phone,b.username,c.name,c.sex,c.job_num,c.english_name,c.bmgw_id
yuquan.zhu committed
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 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 108 109
         from qyzx_emp_ent_asso a 
        left join qyzx_emp_login b on a.emp_num = b.id 
        left join yggl_main_emp c on a.emp_num = c.emp_num and a.org_code = c.org_code
        where a.org_code = #{org_code} 
    </select>

	<!-- 

    <insert id="insert" useGeneratedKeys="true" keyColumn="id" parameterType="cn.timer.api.bean.qyzx.QyzxEmpEntAsso">
        INSERT INTO qyzx_emp_ent_asso
        <trim prefix="(" suffix=")" suffixOverrides=",">
                        <if test ='null != empNum'>
                        emp_num,
                        </if>
                        <if test ='null != orgCode'>
                        org_code,
                        </if>
                        <if test ='null != userType'>
                        user_type
                        </if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
                        <if test ='null != empNum'>
                        #{empNum},
                        </if>
                        <if test ='null != orgCode'>
                        #{orgCode},
                        </if>
                        <if test ='null != userType'>
                        #{userType}
                        </if>
        </trim>
    </insert>

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

    <update id="update" parameterType="cn.timer.api.bean.qyzx.QyzxEmpEntAsso">
        UPDATE qyzx_emp_ent_asso
        <set>
                    <if test ='null != empNum'>emp_num = #{empNum},</if>
                    <if test ='null != orgCode'>org_code = #{orgCode},</if>
                    <if test ='null != userType'>user_type = #{userType}</if>
        </set>
        WHERE id = #{id}
    </update>


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

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

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

	 -->

</mapper>