@Override public boolean updateRiskverificationFlag(String acptracctName) { BmsBillRiskverification bbr = new BmsBillRiskverification(); bbr.setWarnflag("1"); bbr.setUpdateBy("job"); int num = billRiskverificationMapper.update(bbr, new QueryWrapper<BmsBillRiskverification>().eq("ACPTRACCT_NAME", acptracctName).eq("WARNFLAG", "0")); if (num == 0) { return false; } else { return true; } }
//以上sql执行为
update bms_bill_riskverification set warnflag = '1',update_by = 'job' where ACPTRACCT_NAME = 'zhangsan' and warnflag = '0';
QueryWrapper in条件用法
@Override public boolean updateWaitSignWarnFlag(String acptracctName) { BusBillWaitsign bw = new BusBillWaitsign(); bw.setWarnflag("1"); bw.setUpdateBy("job"); List<String> list = new ArrayList<>(); list.add("0"); list.add("2"); int num = billWaitsignMapper.update(bw,new QueryWrapper<BusBillWaitsign>() .eq("ACPTRACCT_NAME",acptracctName) .eq("BILLTYPE","2") .eq("WARNFLAG","0") .in("CHECKFLAG",list)); if (num == 0) { return false; } else { return true; } }
//执行的sql为:
update
bus_bill_waitsign
set
warnflag ='1',
update_by ='job'
where
(ACPTRACCT_NAME = 'ceshi'
and BILLTYPE = '2'
and WARNFLAG = '0'
and CHECKFLAG in ('0','2'))
update BUS_BILL_INFO_CUST t set t.UPDATE_TIME = sysdate(), t.UPDATE_BY ='222', t.SYS_ORG_CODE ='2223' where t.ID = '0a41ca95d6a549219bfaea22bb72cdb0';
mybatis-plus指定实体类字段不查询
前端需要的字段,但是数据库不需要。
mybatis-plus中selectList用法
SELECT * FROM user_info WHERE tom_age = '20' and name='tom';
等同于
QueryWrapper<UserInfo> queryWrapper = new QueryWrapper(); queryWrapper.eq("tom_age", '20');//tom_age必须是数据库中的字段 queryWrapper.eq("name",'tom'); List<UserInfo> list = userInfoMapper.selectList(queryWrapper );
标签:list,update,plus,mybatis,new,eq From: https://www.cnblogs.com/chuangsi/p/17343685.html