<?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.kwan.springbootkwan.mapper.UserMapper">
<!-- <select id="getUserByName" resultType="com.kwan.springbootkwan.entity.User">--> <!-- SELECT * from user--> <!-- where 1=1--> <!-- <if test="name != null and name != ''">--> <!-- and name = #{name}--> <!-- </if>--> <!-- </select>-->
<select id="getUserByName" resultType="com.kwan.springbootkwan.entity.User"> SELECT * FROM user WHERE sex = #{sex} </select>
</mapper>