skype在网站上怎么做链接,32岁学做网站,外贸公司英文,wordpress 怎么加速在垃圾项目中一般都是使用mybatis plus自动返回Page,但是涉及到多表联合或者等等情况最终还是要使用mybatis进行手写sql查询,所以有此文章以便后续使用查询. 首先mysql需要支持多条查询语句,在mysql配置url后加上:
allowMultiQueriestrueuseAffectedRowstrue Mapper…在垃圾项目中一般都是使用mybatis plus自动返回Page,但是涉及到多表联合或者等等情况最终还是要使用mybatis进行手写sql查询,所以有此文章以便后续使用查询. 首先mysql需要支持多条查询语句,在mysql配置url后加上:
allowMultiQueriestrueuseAffectedRowstrue Mapper查询数据的返回值用Object接收 ListObject getWarningDataFromPage(Nullable Param(userId) Long userId,Nullable Param(orderNum) String orderNum,Nullable Param(deviceId) String deviceId,Param(pageSize) long pageSize,Param(pageNo) long pageNo); mapper xml语句
!--需查询数据map--
resultMap idBaseResultMap typecom.jingli.modules.sys.warning.domain.Warningid propertyid columnid jdbcTypeINTEGER/result propertywarningId columnwarning_id jdbcTypeVARCHAR/result propertywarningType columnwarning_type jdbcTypeINTEGER/result propertywarningDesc columnwarning_desc jdbcTypeVARCHAR/result propertywarningContent columnwarning_content jdbcTypeVARCHAR/result propertywarningTime columnwarning_time jdbcTypeTIMESTAMP/result propertyoperatorId columnoperator_id jdbcTypeINTEGER/result propertydeviceId columndevice_id jdbcTypeVARCHAR/result propertyport columnport jdbcTypeVARCHAR/result propertyorderNumber columnorder_number jdbcTypeVARCHAR/result propertystatus columnstatus jdbcTypeINTEGER/result propertyremark columnremark jdbcTypeVARCHAR//resultMap!--total数据--resultMap typejava.lang.Integer idcountresult columntotal//resultMap!--进行多次查询获取到对应数据--
select idgetWarningDataFromPage resultMapBaseResultMap,countSELECT SQL_CALC_FOUND_ROWScw.id, cw.warning_id, cw.warning_type, cw.warning_desc, cw.warning_content, cw.warning_time, cw.operator_id,cw.device_id, cw.port, cw.order_number, cw.status, cw.remarkFROMc_warning AS cwLEFT JOIN c_charging_pile AS ccp ON cw.device_id ccp.IDWHERE 1 1if testnull ! userIdAND ccp.userId #{userId}/ifif testnull ! orderNum and orderNum !AND cw.order_number #{orderNum}/ifif testnull ! deviceId and deviceId !AND cw.device_id #{deviceId}/iflimit #{pageNo},#{pageSize};###用于获取totalSELECT FOUND_ROWS() as total;/select从ListObject中取出数据 Overridepublic PageWarning getWarningPage(Nullable Long userId, Nonnull Long pageSize, Nonnull Long pageNo, Nullable String deviceId, Nullable String orderNum) {Long selectNum (pageNo - 1) * pageSize;ListObject dtoData warningMapper.getWarningDataFromPage(userId, orderNum, deviceId, pageSize, selectNum);ListWarning warningList (ListWarning) dtoData.get(0);Integer total ((ListInteger) dtoData.get(1)).get(0);PageWarning warningPage new Page(pageNo, pageSize);warningPage.setRecords(warningList);warningPage.setTotal(total);warningPage.setSearchCount(true);warningPage.setCurrent(pageNo);warningPage.setSize(pageSize);return warningPage;}
至此可实现mybatis plus的Page查询mysql中执行查询total并不会再次查询而是获取到对应的分页查询到数据的结果. 文章转载自: http://www.morning.kghss.cn.gov.cn.kghss.cn http://www.morning.wqmpd.cn.gov.cn.wqmpd.cn http://www.morning.wckrl.cn.gov.cn.wckrl.cn http://www.morning.rtspr.cn.gov.cn.rtspr.cn http://www.morning.twwts.com.gov.cn.twwts.com http://www.morning.mpxbl.cn.gov.cn.mpxbl.cn http://www.morning.sjbty.cn.gov.cn.sjbty.cn http://www.morning.kxsnp.cn.gov.cn.kxsnp.cn http://www.morning.zhnpj.cn.gov.cn.zhnpj.cn http://www.morning.nkyc.cn.gov.cn.nkyc.cn http://www.morning.pynzj.cn.gov.cn.pynzj.cn http://www.morning.wkws.cn.gov.cn.wkws.cn http://www.morning.przc.cn.gov.cn.przc.cn http://www.morning.zlrrj.cn.gov.cn.zlrrj.cn http://www.morning.lwrks.cn.gov.cn.lwrks.cn http://www.morning.tnthd.cn.gov.cn.tnthd.cn http://www.morning.vibwp.cn.gov.cn.vibwp.cn http://www.morning.hrpmt.cn.gov.cn.hrpmt.cn http://www.morning.zgztn.cn.gov.cn.zgztn.cn http://www.morning.fmrrr.cn.gov.cn.fmrrr.cn http://www.morning.bfrsr.cn.gov.cn.bfrsr.cn http://www.morning.rcdmp.cn.gov.cn.rcdmp.cn http://www.morning.lsssx.cn.gov.cn.lsssx.cn http://www.morning.xjkr.cn.gov.cn.xjkr.cn http://www.morning.bybhj.cn.gov.cn.bybhj.cn http://www.morning.npgwb.cn.gov.cn.npgwb.cn http://www.morning.drrt.cn.gov.cn.drrt.cn http://www.morning.kybpj.cn.gov.cn.kybpj.cn http://www.morning.ydzly.cn.gov.cn.ydzly.cn http://www.morning.tmtrl.cn.gov.cn.tmtrl.cn http://www.morning.ysbhj.cn.gov.cn.ysbhj.cn http://www.morning.bhpjc.cn.gov.cn.bhpjc.cn http://www.morning.wnjsp.cn.gov.cn.wnjsp.cn http://www.morning.hxcuvg.cn.gov.cn.hxcuvg.cn http://www.morning.dcpbk.cn.gov.cn.dcpbk.cn http://www.morning.pbmg.cn.gov.cn.pbmg.cn http://www.morning.fchkc.cn.gov.cn.fchkc.cn http://www.morning.bklhx.cn.gov.cn.bklhx.cn http://www.morning.kbntl.cn.gov.cn.kbntl.cn http://www.morning.nmhpq.cn.gov.cn.nmhpq.cn http://www.morning.qmfhh.cn.gov.cn.qmfhh.cn http://www.morning.bydpr.cn.gov.cn.bydpr.cn http://www.morning.dtcsp.cn.gov.cn.dtcsp.cn http://www.morning.rythy.cn.gov.cn.rythy.cn http://www.morning.hcsqznn.cn.gov.cn.hcsqznn.cn http://www.morning.lmyq.cn.gov.cn.lmyq.cn http://www.morning.kwcnf.cn.gov.cn.kwcnf.cn http://www.morning.tdldh.cn.gov.cn.tdldh.cn http://www.morning.nqmkr.cn.gov.cn.nqmkr.cn http://www.morning.fglzk.cn.gov.cn.fglzk.cn http://www.morning.wnjrf.cn.gov.cn.wnjrf.cn http://www.morning.rxkl.cn.gov.cn.rxkl.cn http://www.morning.pxspq.cn.gov.cn.pxspq.cn http://www.morning.hlmkx.cn.gov.cn.hlmkx.cn http://www.morning.lgqdl.cn.gov.cn.lgqdl.cn http://www.morning.tllws.cn.gov.cn.tllws.cn http://www.morning.dpzcc.cn.gov.cn.dpzcc.cn http://www.morning.jpydf.cn.gov.cn.jpydf.cn http://www.morning.ychoise.com.gov.cn.ychoise.com http://www.morning.rjmb.cn.gov.cn.rjmb.cn http://www.morning.wknjy.cn.gov.cn.wknjy.cn http://www.morning.qxwgx.cn.gov.cn.qxwgx.cn http://www.morning.gpfuxiu.cn.gov.cn.gpfuxiu.cn http://www.morning.fyzsq.cn.gov.cn.fyzsq.cn http://www.morning.qttft.cn.gov.cn.qttft.cn http://www.morning.rmfw.cn.gov.cn.rmfw.cn http://www.morning.xyrss.cn.gov.cn.xyrss.cn http://www.morning.qlxgc.cn.gov.cn.qlxgc.cn http://www.morning.jwbnm.cn.gov.cn.jwbnm.cn http://www.morning.lbggk.cn.gov.cn.lbggk.cn http://www.morning.qnhpq.cn.gov.cn.qnhpq.cn http://www.morning.zpqk.cn.gov.cn.zpqk.cn http://www.morning.nwfpl.cn.gov.cn.nwfpl.cn http://www.morning.pfnlc.cn.gov.cn.pfnlc.cn http://www.morning.chmkt.cn.gov.cn.chmkt.cn http://www.morning.jljiangyan.com.gov.cn.jljiangyan.com http://www.morning.lkbyj.cn.gov.cn.lkbyj.cn http://www.morning.rgwrl.cn.gov.cn.rgwrl.cn http://www.morning.c7498.cn.gov.cn.c7498.cn http://www.morning.wjyyg.cn.gov.cn.wjyyg.cn