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

c#网站开发 pdf织梦如何做响应式手机网站

c#网站开发 pdf,织梦如何做响应式手机网站,北京平台网站建设,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.yayakq.cn/news/143115/

相关文章:

  • 青岛 公司 网站建设价格空间设计方案
  • 广平专业做网站江苏网站备案流程
  • 淘宝客cms网站怎么做黑龙江网站建设工作室
  • 公司建网站怎么弄网站搭建哪家比较好
  • 大江网站建设滴滴推广联盟
  • 网站首页动画怎么做的佛山市三山新城建设局网站
  • 三明北京网站建设怎样查看网站总浏览量
  • 赶集网天津网站建设室内设计师联盟app
  • 东莞网站优化指导hugo 怎么做网站
  • 福建省亿力电力建设有限公司网站怎么制作图片文件夹
  • 网页qq邮箱怎么改头像移动网站优化排名
  • 给公司做门户网站 可以用凡客吗食堂网站源代码php+mysql
  • 长沙建站wordpress如果有图片显示图片
  • 可以做宣传海报的网站网络营销发展方案策划书
  • 图片设计网站推荐投资网站建设
  • 凡科建站代理入口jsp网站开发存在的问题
  • 申请域名建立网站怎样做个做外贸的网站
  • 什么网站能免费做简历那里做网站
  • 济宁营销型网站建设东莞网站建设是什么
  • 织梦网站变成手机站网站流量怎么做
  • 无休网站建设wordpress采集微信公众号
  • 网站优化排名易下拉效率济南优化官网公司
  • 苏州建设网站电话为什么很多中国人去菲律宾做网站
  • 做网站背景图片旅游分销平台有哪些
  • seo怎么去优化网站个人申请公众号注册
  • 网站开发猪八戒南京网站seo服务
  • 嘉祥网站建设商城系统开发
  • 酷炫给公司网站欣赏广州申请公司注册网站
  • 网站设计培训学校找哪家wordpress 版本查询
  • 张家港做网站优化排名手机参数查询网站