<?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.MenuKeySetMapper">
	<resultMap type="MenuKeySet" id="MenuKeySet">
		<id column="menuKeySetNo" property="menuKeySetNo" />
		<result column="keyWord" property="keyWord" />
		<result column="wxpublicNo" property="wxpublicNo" />
		<result column="reType" property="reType" />
		<result column="refText" property="refText" />
		<result column="refImageTextId" property="refImageTextId" />
		<result column="refVedioId" property="refVedioId" />
		<result column="createTime" property="createTime" />
		<result column="menuId" property="menuId" />
		<result column="vchar1" property="vchar1" />
		<result column="vchar2" property="vchar2" />
		<result column="vchar3" property="vchar3" />
		<result column="vchar4" property="vchar4" />
		<result column="keyType" property="keyType" />
	</resultMap>

	<select id="selectByPubNoAndKeyWord" resultMap="MenuKeySet">
		select * from tb_wx_menukeyset where wxpublicNo=#{0} and keyWord=#{1}
	</select>

	<insert id="insert">
		INSERT INTO tb_wx_menukeyset
		(menuKeySetNo,
		createTime,
		keyType,
		keyWord,
		menuId,
		reType,
		refImageTextId,
		refText,
		refVedioId,
		vchar1,
		vchar2,
		vchar3,
		vchar4,
		wxpublicNo
		)
		VALUES
		(#{menuKeySetNo},
		#{createTime},
		#{keyType},
		#{keyWord},
		#{menuId},
		#{reType},
		#{refImageTextId},
		#{refText},
		#{refVedioId},
		#{vchar1},
		#{vchar2},
		#{vchar3},
		#{vchar4},
		#{wxpublicNo}
		);
	</insert>

	<update id="update">
		UPDATE tb_wx_menukeyset
		SET
		menuKeySetNo = #{menuKeySetNo} ,
		createTime = #{createTime} ,
		keyType = #{keyType} ,
		keyWord = #{keyWord} ,
		menuId = #{menuId} ,
		reType = #{reType} ,
		refImageTextId = #{refImageTextId} ,
		refText = #{refText} ,
		refVedioId = #{refVedioId} ,
		vchar1 = #{vchar1},
		vchar2 = #{vchar2} ,
		vchar3 = #{vchar3} ,
		vchar4 = #{vchar4} ,
		wxpublicNo = #{wxpublicNo}

		WHERE
		menuKeySetNo = #{menuKeySetNo} ;
	</update>

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