<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.iweb.entity">
<select id="listUser" resultType="User">select * from user</select>
<insert id="addUser" parameterType="User">insert into user values (#{userId},#{username},#{password})</insert>
<delete id="deleteUser" parameterType="String">delete from user where userId = #{userId}</delete>
<update id="updateUser" parameterType="User">update user set username = #{username},password = #{password} where userId = #{userId}</update>
<select id="getUser" parameterType="String" resultType="User">select * from user where userId = #{userId}</select>
<select id="listUserByNameLike" parameterType="String" resultType="User">select * from user where username like concat('%',#{0},'%')</select>
<select id="listUserByIdAndNameLike" parameterType="map" resultType="User">select * from user where userId > #{userId} and username like concat('%',#{username},'%')</select>