ZzglBmgwMMapper.xml 6.66 KB
Newer Older
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 38 39 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 110 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 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
<?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.zzgl.ZzglBmgwMMapper">

    <resultMap id="BaseResultMap" type="cn.timer.api.bean.zzgl.ZzglBmgwM" >
                <id column="id" property="id" />
                <result column="org_code" property="orgCode" />
                <result column="up_id" property="upId" />
                <result column="name" property="name" />
                <result column="sts" property="sts" />
                <result column="is_admin" property="isAdmin" />
                <result column="is_update" property="isUpdate" />
                <result column="type" property="type" />
                <result column="remark" property="remark" />
                <result column="update_time" property="updateTime" />
                <result column="create_time" property="createTime" />
    </resultMap>

    <sql id="Base_Column_List">
                a.id,
                a.org_code,
                a.up_id,
                a.name,
                a.sts,
                a.is_admin,
                a.is_update,
                a.type,
                a.remark,
                a.update_time,
                a.create_time
    </sql>
    
    <sql id="Base_Column_List_Alias">
                id ZzglBmgwM_id,
                org_code ZzglBmgwM_org_code,
                up_id ZzglBmgwM_up_id,
                name ZzglBmgwM_name,
                sts ZzglBmgwM_sts,
                is_admin ZzglBmgwM_is_admin,
                is_update ZzglBmgwM_is_update,
                type ZzglBmgwM_type,
                remark ZzglBmgwM_remark,
                update_time ZzglBmgwM_update_time,
                create_time ZzglBmgwM_create_time
    </sql>



	<select id="selectListByDepts" resultType="cn.timer.api.dto.zzgl.ZzglBmgwMEmpDto" parameterType="list">
        SELECT 
        	<include refid="Base_Column_List" />,b.name username
        FROM 
            zzgl_bmgw_m a,yggl_main_emp b
        WHERE 
        	b.bmgw_id = a.id 
        	<if test="list != null">
        		and a.id in 
	        	<foreach item="item" index="index" collection="list" open="(" separator="," close=")">
	        		#{item}
				</foreach>  
        	</if>
    </select>
    
	<select id="selectOtherListByOrgCode" resultType="cn.timer.api.dto.zzgl.ZzglBmgwMEmpDto">
        SELECT 
        	<include refid="Base_Column_List" />,b.name username
        FROM 
        	zzgl_bmgw_m a,yggl_main_emp b
        WHERE 
        	b.bmgw_id = a.id and
        	a.org_code = #{orgCode} and
        	a.id not in (#{id})
    </select>

	<!-- 

    <insert id="insert" useGeneratedKeys="true" keyColumn="id" parameterType="cn.timer.api.bean.zzgl.ZzglBmgwM">
        INSERT INTO zzgl_bmgw_m
        <trim prefix="(" suffix=")" suffixOverrides=",">
                        <if test ='null != orgCode'>
                        org_code,
                        </if>
                        <if test ='null != upId'>
                        up_id,
                        </if>
                        <if test ='null != name'>
                        name,
                        </if>
                        <if test ='null != sts'>
                        sts,
                        </if>
                        <if test ='null != isAdmin'>
                        is_admin,
                        </if>
                        <if test ='null != isUpdate'>
                        is_update,
                        </if>
                        <if test ='null != type'>
                        type,
                        </if>
                        <if test ='null != remark'>
                        remark,
                        </if>
                        <if test ='null != updateTime'>
                        update_time,
                        </if>
                        <if test ='null != createTime'>
                        create_time
                        </if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
                        <if test ='null != orgCode'>
                        #{orgCode},
                        </if>
                        <if test ='null != upId'>
                        #{upId},
                        </if>
                        <if test ='null != name'>
                        #{name},
                        </if>
                        <if test ='null != sts'>
                        #{sts},
                        </if>
                        <if test ='null != isAdmin'>
                        #{isAdmin},
                        </if>
                        <if test ='null != isUpdate'>
                        #{isUpdate},
                        </if>
                        <if test ='null != type'>
                        #{type},
                        </if>
                        <if test ='null != remark'>
                        #{remark},
                        </if>
                        <if test ='null != updateTime'>
                        #{updateTime},
                        </if>
                        <if test ='null != createTime'>
                        #{createTime}
                        </if>
        </trim>
    </insert>

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

    <update id="update" parameterType="cn.timer.api.bean.zzgl.ZzglBmgwM">
        UPDATE zzgl_bmgw_m
        <set>
                    <if test ='null != orgCode'>org_code = #{orgCode},</if>
                    <if test ='null != upId'>up_id = #{upId},</if>
                    <if test ='null != name'>name = #{name},</if>
                    <if test ='null != sts'>sts = #{sts},</if>
                    <if test ='null != isAdmin'>is_admin = #{isAdmin},</if>
                    <if test ='null != isUpdate'>is_update = #{isUpdate},</if>
                    <if test ='null != type'>type = #{type},</if>
                    <if test ='null != remark'>remark = #{remark},</if>
                    <if test ='null != updateTime'>update_time = #{updateTime},</if>
                    <if test ='null != createTime'>create_time = #{createTime}</if>
        </set>
        WHERE id = #{id}
    </update>


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

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

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

	 -->

</mapper>