ZzglPostMenuMapper.xml 2.64 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
<?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.ZzglPostMenuMapper">

    <resultMap id="BaseResultMap" type="cn.timer.api.bean.zzgl.ZzglPostMenu" >
                <result column="bmgw_id" property="bmgwId" />
                <result column="menu_id" property="menuId" />
    </resultMap>

    <sql id="Base_Column_List">
                bmgw_id,
                menu_id
    </sql>
    
    <sql id="Base_Column_List_Alias">
                bmgw_id ZzglPostMenu_bmgw_id,
                menu_id ZzglPostMenu_menu_id
    </sql>
    <insert id="insertPostMenus" useGeneratedKeys="true" keyColumn="id">
        INSERT INTO zzgl_post_menu
        	(bmgw_id,menu_id)
        values 
        <foreach item="item" index="index" collection="menus" open="" separator="," close="">
        (
        	#{id},#{item}
        )
		</foreach>
    </insert>
    
	<!-- 

    <insert id="insert" useGeneratedKeys="true" keyColumn="id" parameterType="cn.timer.api.bean.zzgl.ZzglPostMenu">
        INSERT INTO zzgl_post_menu
        <trim prefix="(" suffix=")" suffixOverrides=",">
                        <if test ='null != bmgwId'>
                        bmgw_id,
                        </if>
                        <if test ='null != menuId'>
                        menu_id
                        </if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
                        <if test ='null != bmgwId'>
                        #{bmgwId},
                        </if>
                        <if test ='null != menuId'>
                        #{menuId}
                        </if>
        </trim>
    </insert>

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

    <update id="update" parameterType="cn.timer.api.bean.zzgl.ZzglPostMenu">
        UPDATE zzgl_post_menu
        <set>
                    <if test ='null != bmgwId'>bmgw_id = #{bmgwId},</if>
                    <if test ='null != menuId'>menu_id = #{menuId}</if>
        </set>
        WHERE id = #{id}
    </update>


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

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

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

	 -->

</mapper>