在查询记录集合跟查询记录总记录数的时候,我们需要所写的SQL要一样,那么可以都引用同一个SQL。写法如下:

<sqlMap namespace="Server">
<sql id="sql_select_BeneficiaryUmInfo">
select id_beneficiary, id_um, remark from sibrms_beneficiary_um
<dynamic prepend="where">
<isNotEmpty prepend="and" property="id_beneficiary">
id_beneficiary = #id_beneficiary#
</isNotEmpty>
<isNotEmpty prepend="and" property="id_um">
id_um = #id_um#
</isNotEmpty>
</dynamic>
</sql>
<!-- 查询数据集合 -->
<select id="select_BeneficiaryUmInfo"
parameterClass="java.util.HashMap"
resultClass="server.report.model.BeneficiaryUmInfo">
<include refid="sql_select_BeneficiaryUmInfo" />
</select>
<!-- 查询数据集合总记录数 -->
<select id="select_BeneficiaryUmInfo_count"
parameterClass="java.util.Map" resultClass="java.lang.Integer">
select count(0) from(
<include refid="sql_select_BeneficiaryUmInfo" />
)
</select></sqlMap>

最新文章

  1. PHP工作笔记:yii2各种功能汇总
  2. 软件工程(FZU2015)赛季得分榜,第五回合
  3. C#小小总结(面向对象)
  4. XHTML的若干注意点
  5. Etl之HiveSql调优(union all)
  6. 2015.11.16JQuery 隐藏,显示按钮.
  7. c#中SqlHelper类的编写(三)
  8. Tomcat7.0配置
  9. Android中关于JNI 的学习(三)在JNI层訪问Java端对象
  10. BC#64 4.Tree
  11. jenkins使用1----初始化设置
  12. 使用 ctypes 进行 Python 和 C 的混合编程
  13. pythonweb服务器编程(四)
  14. C# SQLite数据库
  15. 怎样才能提交一个让开发人员拍手叫好的bug单
  16. CRT/LCD/VGA Information and Timing
  17. 开发手记:Linux下更改Oracle表空间大小
  18. Nginx反向代理中使用proxy_redirect重定向url
  19. 微软在线实验室启用谷歌的reCAPTCHA,我们又丢失了一个好东东
  20. Linux-(ps,grep)

热门文章

  1. PTA(Advanced Level)1037.Magic Coupon
  2. select示例
  3. javaweb配置连接mysql数据库
  4. work note
  5. java日志框架系列(3):logback框架配置详解
  6. Ural 1238 Folding 题解
  7. Mysql数据库的优化(本文摘自于网络,文章末端有原文链接)
  8. Graphite简要教程
  9. 怎样快捷获取元素节点body
  10. c++11 用户定义字面量