<select id = "" resultMap = ""> select * from table <choose> <when test=" type == 'x1' '"> ...
<select id = "" resultMap = ""> select * from table <choose> <when test=" type == 'x1' '"> ...
一、需求 后台使用orcale数据库,mybatis做持久层,前台搜索功能,根据类型搜索,但是数据库中没有类型字段, 所以需要在where条件语句中进行判断,当type == x1 时和type == x2时where中的判断条件不同 二、解决 <select id ...
...
需求:模拟实际业务情况,传入多条件进行查询 /** * 需求:模拟实际业务,用户传入多个条件,进行用户列表信息的查询 * @param roleids * @return */ public Li ...
mysql 中类似php switch case 的语句。 select xx字段, case 字段 when 条件1 then 值1 when 条件2 then 值2 else 其他值 END 别名 from ...
一、<choose><when><otherwise> 这是一套标签, 功能类似于 switch...case... ...