QueryWrapper<Employee> qw=new QueryWrapper<>();
(R column, Collection<?> coll);
List<Employee> list = (qw);
亲测:①List集合存在重复变量,in方法查询的时候只查询一次;②List集合中含有数据库不存在的值,不报错,该值不查。
((()), "title", ());
3.查询部分字段
("id");
3.去重查询
("name", "age")
//去除重复
("DISTINCT 字段名");
原生:
<select id="getReceiveBatchList" parameterType="map" resultType="string">
select distinct receive_batch from stereo_receive_package where receive_batch like #{month} and is_submit = '1' order by receive_batch desc
</select>
注意:``xml中写sql语句输入参数必须使用单引号
一般情况下,单引号bai用的多,双引号用的好。
插入、更新du、删除、查询zhi:
insert into xx(name) values('单引号');
delete from xx where name = '单引号';
select * from xx where name = '单引号';
update xx set name = '单引号' where id = 1;
下面是双引号情况:
select name as "姓名" from xx;