s.login_total_times, count(case when ob.apply_status > 0 then ob.apply_status end) as sumLoanAppCount, count(case when ob.apply_status > 1 and ob.apply_status < 6 then ob.apply_status end) as sumInProgressCount, count(case when ob.apply_status = 7 then ob.apply_status end) as ...
count(case when ob.apply_status = 7 then ob.apply_status end) as sumFailLoanCount, count(case when ob.release_status = 1 then ob.release_status end) as sumReleaseCount, sum(case when ob.release_status = 1 then ob.release_money end) as sumReleaseAmount, c.channel_name as channelName...
查询: case when then end select id,nick_name,casewhen `type`= 1 then '正常用户'when `type`= 2 then '马甲用户'else'无数据'end as 用户类型 from user ; update goods set prize=casewhen level= '1' then prize * 1when level= '2' then prize * 1.5when level= '3' then prize * 2...
set ismale = <foreach collection="idMaleList" item="item" index="index" separator=" " open="(case id" close="end)"> when #{item.id,jdbcType=INTEGER} then #{item.ismale,jdbcType=INTEGER} </foreach> where id in <foreach collection="idMaleList" index="index" item="item" open="(...
choose(when ,otherwise)语句 有时候我们不想用到所有的查询条件,只想选择其中一个,查询条件有一个满足即可,使用choose标签可以解决这种情况,类似java的switch语句。 SELECT * FROM student_score sc <where> <choose> <when test="name !=null and name...
--查找总用户数-->selectcount(id)from user;<!--根据queryVo的条件查询用户-->select*from user where username like #{user.userName}</mapper> 一、mybatis简介 MyBatis是一流的持久性框架,支持自定义SQL,存储过程和高级映射。MyBatis消除了几乎所有的JDBC代码以及参数的手动设置和结果检索。My...
CaseQueryColumn.Builder else_(Object elseValue) CaseQueryColumn end() CaseQueryColumn.Builder.Then when(QueryCondition condition) Methods inherited from class java.lang.Object clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitConstructor Detail Builder publ...
SELECT * FROM user ORDER BY CASE WHEN last_login_time IS NULL THEN 1 ELSE 0 END, last_login_time DESC; 这里,我们首先根据last_login_time是否为null进行排序,然后再按照last_login_time的实际值进行降序排序。这样,null值就会被放到结果集的最后。 2. 在MybatisPlus中实现 要在MybatisPlus中实现类似的...
mybatisPlus的一些用法(一)trim、foreach、if、case、when、then 2019-12-23 09:51 −1、在项目开发中遇到一些新的知识点、在这里做以总结。 (1) <trim></trim>标签、 <foreach></foreach>标签 <update id="updateBatch" param... 岷州李斌 ...
select * from student limit #{currIndex} , #{pageSize} 2、拦截器分页 /** * @Intercepts 说明是一个拦截器 * @Signature 拦截器的签名 * type 拦截的类型 四大对象之一( Executor,ResultSetHandler,ParameterHandler,StatementHandler) * method 拦截的方法 * args 参数,高版本需要加个Integer.class...