当前位置: 首页 > news >正文

logo做ppt模板下载网站超级软文

logo做ppt模板下载网站,超级软文,wordpress时间提前,企业信用报告如何获取在垃圾项目中一般都是使用mybatis plus自动返回Page,但是涉及到多表联合或者等等情况最终还是要使用mybatis进行手写sql查询,所以有此文章以便后续使用查询. 首先mysql需要支持多条查询语句,在mysql配置url后加上: &allowMultiQueriestrue&useAffectedRowstrue Mapper…

在垃圾项目中一般都是使用mybatis plus自动返回Page,但是涉及到多表联合或者等等情况最终还是要使用mybatis进行手写sql查询,所以有此文章以便后续使用查询.

首先mysql需要支持多条查询语句,在mysql配置url后加上:

&allowMultiQueries=true&useAffectedRows=true

Mapper查询数据的返回值用Object接收

 List<Object> 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 id="BaseResultMap" type="com.jingli.modules.sys.warning.domain.Warning"><id property="id" column="id" jdbcType="INTEGER"/><result property="warningId" column="warning_id" jdbcType="VARCHAR"/><result property="warningType" column="warning_type" jdbcType="INTEGER"/><result property="warningDesc" column="warning_desc" jdbcType="VARCHAR"/><result property="warningContent" column="warning_content" jdbcType="VARCHAR"/><result property="warningTime" column="warning_time" jdbcType="TIMESTAMP"/><result property="operatorId" column="operator_id" jdbcType="INTEGER"/><result property="deviceId" column="device_id" jdbcType="VARCHAR"/><result property="port" column="port" jdbcType="VARCHAR"/><result property="orderNumber" column="order_number" jdbcType="VARCHAR"/><result property="status" column="status" jdbcType="INTEGER"/><result property="remark" column="remark" jdbcType="VARCHAR"/></resultMap><!--total数据--><resultMap type="java.lang.Integer" id="count"><result column="total"/></resultMap><!--进行多次查询获取到对应数据-->
<select id="getWarningDataFromPage" resultMap="BaseResultMap,count">SELECT 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.remarkFROM`c_warning` AS `cw`LEFT JOIN `c_charging_pile` AS `ccp` ON cw.device_id = ccp.IDWHERE 1 = 1<if test="null != userId">AND ccp.userId = #{userId}</if><if test="null != orderNum and orderNum !=''">AND cw.order_number = #{orderNum}</if><if test="null != deviceId and deviceId !=''">AND cw.device_id = #{deviceId}</if>limit #{pageNo},#{pageSize};###用于获取totalSELECT FOUND_ROWS() as total;</select>

从List<Object>中取出数据:

 @Overridepublic Page<Warning> getWarningPage(@Nullable Long userId, @Nonnull Long pageSize, @Nonnull Long pageNo, @Nullable String deviceId, @Nullable String orderNum) {Long selectNum = (pageNo - 1) * pageSize;List<Object> dtoData = warningMapper.getWarningDataFromPage(userId, orderNum, deviceId, pageSize, selectNum);List<Warning> warningList = (List<Warning>) dtoData.get(0);Integer total =((List<Integer>) dtoData.get(1)).get(0);Page<Warning> 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.15wanjia.com/news/19741.html

相关文章:

  • 网站文章优化怎么做百度推广客户端电脑版
  • 国内做博彩网站代理企业推广平台有哪些
  • 高端网站建设教学市场营销图片高清
  • 有没有做那事的网站网络安全培训机构排名
  • 中国建设网站官网百度搜索指数是怎么计算的
  • 网站备案账号是什么app推广拉新一手渠道代理
  • 如何做二维码跳转到网站软文标题例子
  • 网站定制开发怎么做百度seo关键词排名优化软件
  • 秦皇岛网站制作价格推广恶意点击软件怎样使用
  • 网站app简单做抄一则新闻四年级
  • 阿里云成功备案的网站增加域名临沂seo公司稳健火星
  • 真人做的免费视频网站自己怎么做关键词优化
  • 邹平做网站哪家好seo快速排名源码
  • 安徽网站排名类似火脉的推广平台
  • 做网站如何赢利的seo站点
  • 怎样不让网站被收录扬州seo博客
  • 做威客有什么靠谱网站百度快速排名优化工具
  • 网站开发要什么基础奶茶网络营销策划方案
  • 常见b2c网站有哪些站长工具app
  • 昆明哪些做网站建设的公司上海b2b网络推广外包
  • 有没有做淘宝客网站的搜索引擎网站大全
  • 北京网站设计公司哪家公司好线下广告投放渠道都有哪些
  • 做网站怎么提取视频无广告免费b站推广网站在线
  • 方案 网站广州婚恋网站排名
  • 网站备案流程详细百度6大核心部门
  • 做网站哪家公司好苏州网络营销推广渠道有哪些
  • 哪个网站可以做行程温州企业网站排名优化
  • 淮安做微信网站自动秒收录网
  • 电子商城网站开发多少钱公司网址怎么制作
  • 定制家具价格seocui cn