MyBatis splicing sentences /LIKE in the form of annotations, the processing method of'%'

Keywords: COCAT()

 @Select("SELECT * FROM layer_parameters WHERE p_name_cn like CONCAT('%',#{cstr},'%') OR p_name_en like CONCAT('%',#{cstr},'%') OR p_info like CONCAT('%',#{cstr},'%')")
    List<LayerParameters> selectByString(@Param("cstr")String cstr);

Operation: ${}

@Select("SELECT * from collection_plan order by co_id limit #{size} offset ${(start*size)}")

Guess you like

Origin blog.csdn.net/weixin_42547014/article/details/108789452