
MyBatis
@从入门到入土
学无止境
展开
-
Mybatis collection标签实现一对多查询
业务中经常遇到一对多的场景,例如一名员工可能拥有多个职务。 @Data public class UserInfo implements Serializable { private Long id; private String userCode; private String userName; private String sex; private String userPhone; /** * 该员工职务列表 */原创 2020-07-27 15:45:36 · 1063 阅读 · 0 评论 -
MyBatis常用标签(if、foreach、where、set、like等)
select与if <select id="selectUser" resultType="com.xxx.User"> SELECT * FROM t_user WHERE sid = #{sid} <if test="code != null and code != ''"> AND code = #{code} </if> </select> insert与for原创 2020-07-27 14:33:03 · 1242 阅读 · 0 评论