<?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">
<!-- 命名，每一个映射对象不一样 namespace:必须与对应的接口全类名一致 -->
<mapper namespace="com.iamberry.wechat.service.mapper.MenuInfoMapper">
	<resultMap type="MenuInfo" id="MenuInfo">
		<id column="id" property="id" />
		<result column="menuId" property="menuId" />
		<result column="wxpublicNo" property="wxpublicNo" />
		<result column="menuName" property="menuName" />
		<result column="orderNo" property="orderNo" />
		<result column="parentMenuId" property="parentMenuId" />
		<result column="menuType" property="menuType" />
		<result column="url" property="url" />
		<result column="opTime" property="opTime" />
		<result column="vchar1" property="vchar1" />
		<result column="vchar2" property="vchar2" />
		<result column="vchar3" property="vchar3" />
		<result column="vchar4" property="vchar4" />
		<result column="wxpublicNo" property="wxpublicNo" />
	</resultMap>

	<select id="selectOne" parameterType="MenuInfo"
		resultMap="MenuInfo">
		SELECT * FROM tb_wx_menuinfo WHERE wxpublicNo=#{0} limit 1
	</select>

	<select id="selectByMenuIdAndPubNo" resultMap="MenuInfo">
		select * from
		tb_wx_menuinfo where menuId=#{0} and wxpublicNo=#{1}
	</select>

	<insert id="insert">
		INSERT INTO tb_wx_menuinfo
		(id,
		menuId,
		menuName,
		menuType,
		opTime,
		orderNo,
		parentMenuId,
		url,
		vchar1,
		vchar2,
		vchar3,
		vchar4,
		wxpublicNo
		)
		VALUES
		(#{id},
		#{menuId},
		#{menuName},
		#{menuType},
		#{opTime},
		#{orderNo},
		#{parentMenuId},
		#{url},
		#{vchar1},
		#{vchar2},
		#{vchar3},
		#{vchar4},
		#{wxpublicNo}
		);
	</insert>

	<update id="update">
		UPDATE tb_wx_menuinfo
		SET
		id = #{id} ,
		menuId =
		#{menuId} ,
		menuName = #{menuName} ,
		menuType = #{menuType} ,
		opTime =
		#{opTime} ,
		orderNo = #{orderNo} ,
		parentMenuId = #{parentMenuId} ,
		url =
		#{url} ,
		vchar1 = #{vchar1} ,
		vchar2 = #{vchar2} ,
		vchar3 = #{vchar3} ,
		vchar4 = #{vchar4} ,
		wxpublicNo = #{wxpublicNo}
		WHERE
		id = #{id} ;
	</update>

	<delete id="deleteByPubNo" parameterType="java.lang.String">
		delete from
		tb_wx_menuinfo
		where wxpublicNo = #{wxpublicNo}
	</delete>
</mapper>
