mybatis里面的时间段写法
来源:互联网 发布:php csrf漏洞 编辑:程序博客网 时间:2024/05/19 14:17
<!-- 雨情数据查询-->
<select id="queryRain" parameterType="java.util.HashMap" resultType="java.util.HashMap">
select * from (select row_number() over (order by a.id desc) rn, a.*,b.stnm
from
dt_rain a inner join tb_station b on a.stcd=b.stcd
<where>
<if test="null != stcd and stcd != ''">
and a.stcd=#{stcd}
</if>
<if test="null != tmbegin and tmbegin != ''">
and
tm>=#{tmbegin}
</if>
<if test="null != tmend and tmend != ''">
and
tm<=#{tmend}
</if>
</where>
) t
<where>
<if test="null != pageInfo">
t.rn>=#{pageInfo.startRow} and t.rn<=#{pageInfo.endRow}
</if>
</where>
order by t.rn desc
</select>
<select id="queryRaincount" parameterType="java.util.HashMap" resultType="java.lang.Integer">
select count(*)
from
dt_rain
<where>
<if test="null != stcd and stcd != ''">
and stcd=#{stcd}
</if>
<if test="null != tmbegin and tmbegin != ''">
and
tm>=#{tmbegin}
</if>
<if test="null != tmend and tmend != ''">
and
tm<=#{tmend}
</if>
</where>
</select>
<select id="queryRain" parameterType="java.util.HashMap" resultType="java.util.HashMap">
select * from (select row_number() over (order by a.id desc) rn, a.*,b.stnm
from
dt_rain a inner join tb_station b on a.stcd=b.stcd
<where>
<if test="null != stcd and stcd != ''">
and a.stcd=#{stcd}
</if>
<if test="null != tmbegin and tmbegin != ''">
and
tm>=#{tmbegin}
</if>
<if test="null != tmend and tmend != ''">
and
tm<=#{tmend}
</if>
</where>
) t
<where>
<if test="null != pageInfo">
t.rn>=#{pageInfo.startRow} and t.rn<=#{pageInfo.endRow}
</if>
</where>
order by t.rn desc
</select>
<select id="queryRaincount" parameterType="java.util.HashMap" resultType="java.lang.Integer">
select count(*)
from
dt_rain
<where>
<if test="null != stcd and stcd != ''">
and stcd=#{stcd}
</if>
<if test="null != tmbegin and tmbegin != ''">
and
tm>=#{tmbegin}
</if>
<if test="null != tmend and tmend != ''">
and
tm<=#{tmend}
</if>
</where>
</select>
0 0
- mybatis里面的时间段写法
- mybatis查询mysql的时间段
- mybatis的时间段动态查询
- SQL查询时间段的语句写法
- MongoDB中对限定的时间段的写法
- mybatis时间段查询,数组
- mybatis查询时间段
- Mybatis like查询的写法
- Mybatis like查询的写法
- Mybatis like查询的写法
- mybatis 的like语句写法
- mybatis OR语句的写法
- mybatis中 like的写法
- Mybatis模糊查询的写法
- Mybatis like查询的写法
- Mybatis中xml文件的时间段动态查询
- 用mybatis取出介于两个时间段之间的记录
- Mybatis中如何查询时间段内的数据
- ViewPager+TabLayout
- 搭建odoo开发调试环境
- 单链表反转的非递归与递归算法
- Aspose word导出照片代码实现
- Android中级教程之----Log图文详解(Log.v,Log.d,Log.i,Log.w,Log.e)!
- mybatis里面的时间段写法
- 无需root,清除清理安卓,android的cache,缓存
- 将文件复制到SD卡根目录下
- linux内核自旋锁API
- [BZOJ1040] [ZJOI2008] 骑士 - 基环外向树 + 树形DP
- Android动画之图片循环动画
- Percent百分比布局用法
- IOS SCNetworkReachability和Reachability监测网络连接状态
- 关于Xib使用AutoLayout动态设置cell高度