StudentMapper.xml
616 Bytes
<?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.meishu.mapper.StudentMapper">
<select id="students" parameterType="string" resultType="com.meishu.model.StudentDO">
SELECT
t.id,
t.user_name,
t.id_card,
t.company_name
FROM
student t
WHERE
t.delete_date IS NULL
<if test="userName != null and userName != ''">
and t.user_name like concat('%',#{userName} ,'%')
</if>
</select>
</mapper>