springboot mybatis 下使用注解组织查询语句(有查询条件传入)
@Select("<script>" +
"select cab.brandpre_id,cab.brandpre_num_app,cab.id,cab.brandpre_num_approve,cab.brandpre_moneyamount,cab.pid ,\n" +
"cbp.material_code,cbp.material_identification,cbp.material_name,cbp.price from crm_activity_brandpre cab \n" +
"left join crm_brand_presentation cbp on cab.brandpre_id=cbp.id\n" +
"<where> " +
"cab.dr=0 " +
"<if test='map !=null'>" +
"<choose>" +
"<when test='map.keys.size > 0'>" +
" <foreach collection='map.keys' item='key' open='and' separator='AND'>" +
" cab.${key} like concat('%',#{map[${key}]},'%') " +
" </foreach>" +
"</when>" +
"<otherwise>" +
" and 1=1 " +
"</otherwise>" +
"</choose>" +
"</if>" +
"</where>" +
"LIMIT #{pageindex},#{pagenum} " +
"</script>")
List<ActivityAppBrandpreInfoDO> selectAppBrandpreAll(@Param("pageindex") Integer pageindex,
@Param("pagenum") Integer pagenum, @Param("map") Map<String, String> map);
springboot mybatis 下使用注解组织查询语句(有查询条件传入)的更多相关文章
- SpringBoot Mybatis整合(注解版),SpringBoot集成Mybatis(注解版)
SpringBoot Mybatis整合(注解版),SpringBoot集成Mybatis(注解版) ================================ ©Copyright 蕃薯耀 2 ...
- T-SQL:SQL Server-数据库查询语句基本查询
ylbtech-SQL Server-Basic:SQL Server-数据库查询语句基本查询 SQL Server 数据库查询语句基本查询. 1,数据库查询语句基本查询 数据库 SQL Serv ...
- SQL查询语句,怎样查询重复数据
SQL查询语句,怎样查询重复数据 2012-02-22 14:50神奇的马骁勇 | 浏览 0 次 有表A, 中有字段id, name, memo现在有很多id重复的数据,怎么把这些重复的都查出来?gr ...
- springBoot + mybatis实现执行多条sql语句出错解决方法
在Idea中执行多条sql语句的修改(mybatis默认的是执行sql语句是执行单条,所以要执行多条的时候需要进行配置) 需要在连接字符串中添加上&allowMultiQueries=true ...
- mysql查询语句select-子查询
1 子查询定义 在一个表表达中可以调用另一个表表达式,这个被调用的表表达式叫做子查询(subquery),我么也称作子选择(subselect)或内嵌选择(inner select).子查询的结果传递 ...
- [Mysql 查询语句]——分组查询group by
group by (1) group by的含义:将查询结果按照1个或多个字段进行分组,字段值相同的为一组(2) group by可用于单个字段分组,也可用于多个字段分组 select * from ...
- 【转】 [MySQL 查询语句]——分组查询group by
group by (1) group by的含义:将查询结果按照1个或多个字段进行分组,字段值相同的为一组(2) group by可用于单个字段分组,也可用于多个字段分组 select * from ...
- mybatis下使用log4j打印sql语句和执行结果
转载自:https://www.cnblogs.com/jeevan/p/3493972.html 本来以为很简单的问题, 结果自己搞了半天还是不行; 然后google, baidu, 搜出来各种方法 ...
- springboot+mybatis环境的坑和sql语句简化技巧
1.springfox-swagger实体类无限递归 https://hacpai.com/article/1525674135818 里面有不完美的解决方案 不用动源码的解决方案也有,在swagge ...
随机推荐
- java poi 读取excel内容
import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.apache.poi.ss.usermodel.Row; import or ...
- Tomcat基础知识
介绍Tomcat之前先介绍下Java相关的知识. 各常见组件: 1.服务器(server):Tomcat的一个实例,通常一个JVM只能包含一个Tomcat实例:因此,一台物理服务器上可以在启动多个JV ...
- 下载安装mysql-connector
执行命令:python -m pip install mysql-connector 测试
- BZOJ 1420: Discrete Root (原根+BSGS)
题意 已知kkk, aaa, ppp. 求 xk≡a (mod p)x^k\equiv a\ (mod\ p)xk≡a (mod p) 的所有根. 根的范围[0,p−1][0,p-1][0,p−1]. ...
- npm报错 This is probably not a problem with npm,there is likely additional logging output above可能的原因
npm WARN Local package.json exists, but node_modules missing, did you mean to install? 解决方法: 输入npm i ...
- SQL 日期转换
), ): :57AMSELECT ), ): ), ): ), ): ), ): ), ): ), ): 06), ): ,06), ): ::46), ): :::827AMSELECT ), ) ...
- PIC - For Resources [ background ]
- VC:检测网络连接的方法
方法一: #include "stdafx.h" #include "windows.h" #include <Sensapi.h> #includ ...
- luogu 3857 [TJOI2008]彩灯 线性基
可以将每一个开关控制的灯的序列看作是0/1组成的二进制. 由于灯的开和关是满足异或的性质的,所以直接求一下线性基大小即可. 答案为 $2^{size}.$ #include <cstdio> ...
- BZOJ 5267 特工 (类FWT)
题意 题解 从大到小枚举\(l\), 把一个序列从\(2^{l+1}\)分成两个独立的\(2^l\),去除两半的影响. 设去除前的序列为\(b\), 去除后序列为\(b'\) 则有\(b_{2^{l+ ...