mybatis动态sql中的bind绑定

快来打我* 2022-03-14 18:42 271阅读 0赞
  1. List<RoleDTO> getRoleList(@Param("record")RoleQUERY role);
  2. <select id="getRoleList" parameterType="map" resultMap="RoleDtoResultMap">
  3. <bind name="cur" value="(record.currentPage-1)*record.pageSize"/>
  4. select
  5. <include refid="com.hanshow.wise.base.privileges.dao.RoleMapper.Base_Column_List" />
  6. from role
  7. <include refid="roleListSql"/>
  8. <if test="record.currentPage!=null and record.pageSize!=null">
  9. limit #{cur,jdbcType=INTEGER}, #{record.pageSize,jdbcType=INTEGER}
  10. </if>
  11. </select>
  12. public class RoleQUERY implements Serializable {
  13. /**
  14. * app编号
  15. */
  16. private String appId;
  17. /**
  18. * 用户编号
  19. */
  20. private String userId;
  21. /**
  22. * 角色编号
  23. */
  24. private String roleId;
  25. /**
  26. * 商户编号
  27. */
  28. private String merchantId;
  29. /**
  30. * 当前页数
  31. */
  32. private Integer currentPage;
  33. /**
  34. * 每页条数
  35. */
  36. private Integer pageSize;

}

发表评论

表情:
评论列表 (有 0 条评论,271人围观)

还没有评论,来说两句吧...

相关阅读

    相关 03-Bind

    1.什么是绑定 每一种依赖注入的框架其实都只是将一种类型绑定到实例的框架。 在Zenject中,绑定就是向容器注册给定的类型,然后容器通过递归解析给定对象的所有依赖关系,

    相关 MyBatis--动态sqlbind标签

    <bing>标签 在进行模糊查询时,如果使用“$\{\}”拼接字符串,则无法防止 SQL 注入问题。如果使用字符串拼接函数或连接符号,但不同数据库的拼接函数或连接符号不同