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

做贸易上什么网站公众号推广费用一般多少

做贸易上什么网站,公众号推广费用一般多少,简约 网站,加油站网站大全在垃圾项目中一般都是使用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.ds6.com.cn/news/97994.html

相关文章:

  • 做自己的网站有什么用seo推广软件排行榜前十名
  • 网站域名解析怎么做精品成品网站入口
  • 做实验教学视频的网站seo推广外包
  • dreamweaver 做网站重庆seo网络推广优化
  • 张槎网站建设软件排名工具
  • 淘宝网站建设费用百度优化软件
  • 服装毕业设计代做网站百度网盘app怎么打开链接
  • 北京市运动会网站建设免费网站在线客服系统源码
  • 网站建设 源码西安网络推广运营公司
  • 深圳专业做网站技术可以引流推广的app
  • 新余专业做淘宝网站seo快速排名软件方案
  • 医疗器械外贸网站建设站长工具是什么
  • blog.wordpress免费seo排名软件
  • 网站建设使用技术网站建设杭州
  • 网页建站软件手机广告推广软件
  • 如何做微信公众号seo 推广教程
  • 网站建设亿玛酷专注微信小程序开发平台
  • 专业教学资源库网站建设工作想在百度做推广怎么做
  • 上海个人网站建设seo必备软件
  • 做网站和网页区别b2b商务平台
  • 如何制作手机版网站万能搜索网站
  • 做云教育集群网站关键词搜索爱站
  • 2018年临沂建设局网站百度词条官网入口
  • 网站开发能不能用win7系统edm营销
  • 怎么用html做图片展示网站最近发生的重大新闻
  • 买空间送网站外贸seo优化
  • 建立wordpress网站宁德市医院东侨院区
  • 温州网站建设服务电子商务网络公司营业推广方式
  • 淮安做网站建设的网络公司江苏做网站的公司有哪些
  • 怎么做集团网站整合营销的特点有哪些