varchar字段作为查询条件时,Mapper.xml文件中不应加‘’
| | |
| | | bc.name like concat('%', #{name}, '%') and |
| | | </if> |
| | | <if test="num != null"> |
| | | bc.num = '#{num,jdbcType=VARCHAR}' and |
| | | bc.num = #{num,jdbcType=VARCHAR} and |
| | | </if> |
| | | <if test="phone != null"> |
| | | bc.phone = '#{phone,jdbcType=VARCHAR}' and |
| | | bc.phone = #{phone,jdbcType=VARCHAR} and |
| | | </if> |
| | | </trim> |
| | | </select> |
| | |
| | | bc.name like concat('%', #{name}, '%') and |
| | | </if> |
| | | <if test="num != null"> |
| | | bc.num = '#{num,jdbcType=VARCHAR}' and |
| | | bc.num = #{num,jdbcType=VARCHAR} and |
| | | </if> |
| | | <if test="phone != null"> |
| | | bc.phone = '#{phone,jdbcType=VARCHAR}' and |
| | | bc.phone = #{phone,jdbcType=VARCHAR} and |
| | | </if> |
| | | </trim> |
| | | order by bc.id DESC |
| | |
| | | name like concat('%', #{name}, '%') and |
| | | </if> |
| | | <if test="phone != null"> |
| | | phone = '#{phone,jdbcType=VARCHAR}' |
| | | phone = #{phone,jdbcType=VARCHAR} |
| | | </if> |
| | | </trim> |
| | | </select> |
| | |
| | | name like concat('%', #{name}, '%') and |
| | | </if> |
| | | <if test="phone != null"> |
| | | phone = '#{phone,jdbcType=VARCHAR}' |
| | | phone = #{phone,jdbcType=VARCHAR} |
| | | </if> |
| | | </trim> |
| | | order by id DESC |