mybatis choose when用法
来源:互联网 发布:淘宝卖家多少分一个钻 编辑:程序博客网 时间:2024/06/08 06:21
mybatis choose when的用法:
mapper.xml:
<select id="query" resultType="map" parameterType="map"> select <choose> <when test="cityId == '00' "> a.city_id as CITYID, </when> <otherwise> <choose> <when test="cityId == '0001' and statsDimension==1"> a.level1_maintain_unit_id as CITYID, </when> <otherwise> a.county_id as CITYID, </otherwise> </choose> </otherwise> </choose> sum(ONUNUM) as ONUNUM, sum(ONTNUM) as ONTNUM from new_olt_upopt_sp_month_${tableDate} a where 1 = 1 <if test="cityId == '0001' and statsDimension==1"> and a.city_id = '0001' </if> <![CDATA[and a.gather_time >= ${startDate}]]> <![CDATA[and a.gather_time <= ${endDate}]]> group by <choose> <when test="cityId == '00' "> a.city_id </when> <otherwise> <choose> <when test="cityId == '0001' and statsDimension==1"> a.level1_maintain_unit_id </when> <otherwise> a.county_id having a.county_id in (select city_id from tab_city where city_id= #{cityId} or parent_id=#{cityId}) </otherwise> </choose> </otherwise> </choose> </select>
1 0
- mybatis choose when用法
- MyBatis choose(when, otherwise)标签
- Mybatis choose (when, otherwise)标签
- mybatis include choose when if
- Mybatis choose (when, otherwise)标签
- mybatis choose用法
- [c.y.j]mybatis choose when otherwise
- mybatis where,foreach,choose when ,set
- mybatis choose标签的用法
- c标签中的<c:choose><c:when></c:when></c:choose>的用法
- jstl <c:choose></c:choose>,<c:when></c:when>和<c:otherwise></c:otherwise>标签用法
- Mybatis最入门---动态查询(choose,when,otherwise)
- Mybatis最入门---动态查询(choose,when,otherwise)
- mybatis语句中使用choose when和otherwise
- Mybatis最入门---动态查询(choose,when,otherwise)
- mybatis学习之路----动态sql之choose when otherwise
- MyBatis-动态SQL的if、choose、when、otherwise、trim、where、set、foreach使用
- MyBatis-动态SQL的if、choose、when、otherwise、trim、where、set、foreach使用
- Android studio 升级问题
- 2.12.2_编辑贝赛尔曲线
- Linux环境下非root用户安装Python及相关库
- 2.14_图像合成
- Android 数据库,解决Failed to read row 6, column -1 from a CursorWindow which has 11 rows, 14 columns.
- mybatis choose when用法
- HDU 5674 Function(斐波那契模数列循环节)
- 项目解析-spring异步线程池配置与使用
- Java并发编程:Lock(上)
- 2.15.1_通过剪辑区域来擦除图像
- Android Studio Gradle 基础
- 图-最小生成数-prims算法
- Map 和HashMap
- nyoj_257郁闷的c小加(一)