您的位置:首页 > 其它

mybatis简单类型查询

2016-04-01 00:00 281 查看
第一种写法
使用@Param(value="pinyin")
List<EmployeeinfoCustom> selectEmpListByPinYin(@Param(value="pinyin")String pinyin)throws Exception;

<select id="selectEmpListByPinYin" parameterType="java.lang.String" resultType="com.hrm.entity.emp.EmployeeinfoCustom">
select * from employeeinfo
<where>
<if test="#{pinyin!=null}">
pinyin like "%"#{pinyin}"%"
</if>
</where>
</select>

第二种写法
List<EmployeeinfoCustom> selectEmpListByPinYin(String pinyin)throws Exception;

<select id="selectEmpListByPinYin" parameterType="java.lang.String" resultType="com.hrm.entity.emp.EmployeeinfoCustom">
select * from employeeinfo
<where>
<if test="#{_parameter!=null}">
pinyin like "%"#{_parameter}"%"
</if>
</where>
</select>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: