阅读背景:

mybatis中使用mysql的模糊查询字符串拼接(like)_u011649691的博客_mybatis中like拼接

来源:互联网 

方法一:

List<Hospital> getHospitalLike(@Param("selectword") String selectword);
<select id="getHospitalLike" resultType="com.hand.hand.domain.Hospital">
    SELECT *
    FROM hospital
    where hid=cast(#{selectword} as signed INTEGER ) OR  hname like concat('%',#{selectword},'%')
    OR  grade like concat('%',#{selectword},'%')
</select>
List<Hospital> getHospitalLike(@P



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: