Finish/models/system/target/classes/mapper/MenuMapper.xml

35 lines
1.2 KiB
XML

<?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="com.bwie.system.mapper.MenuMapper">
<resultMap id="Menu" type="com.bwie.common.domain.Menu">
<id property="menuId" column="menu_id"/>
<result property="menuName" column="menu_name"/>
<result property="menuPrice" column="menu_price"/>
<result property="pic" column="pic"/>
</resultMap>
<insert id="insertMyMenu">
insert into t_my_menu(
<if test="null!=myId and ''!=myId">my_id,</if>
<if test="null!=userId and ''!=userId">user_id,</if>
<if test="null!=menuId and ''!=menuId">menu_id,</if>
<if test="null!=pay and ''!=pay">pay</if>
)values (
<if test="null!=myId and ''!=myId">#{myId},</if>
<if test="null!=userId and ''!=userId">#{userId},</if>
<if test="null!=menuId and ''!=menuId">#{menuId},</if>
<if test="null!=pay and ''!=pay">#{pay}</if>
)
</insert>
<select id="ShowMenuAll" resultMap="Menu">
select menu_id,
menu_name,
menu_price,
pic
from t_menu
</select>
</mapper>