关于数据源为授权车辆、企业车辆的判断(限foton)
int mode = carInfoService.getCompanyCarMode(companyId);
public int getCompanyCarMode(Long companyId) {
String sql = "select t.id from iov_biz_car_info t join iov_biz_device d on d.iov_biz_car_info_id = t.id and d.is_primary = 1 where d.cbm_mag_company_id = ? and rownum = 1";
List<Number> create = findBySQL(sql, new Object[] { companyId });
sql = "select t.id from iov_biz_car_info t join iov_biz_device d on d.iov_biz_car_info_id = t.id and d.is_primary = 1 join iov_biz_l_car_info_company lc on lc.iov_biz_car_info_id =t.id where lc.cbm_mag_company_id = ? and rownum = 1";
List<Number> link = findBySQL(sql, new Object[] { companyId });
if (create.size() > 0 && link.size() < 1) {//本企业
return 1;
}
if (create.size() < 1 && link.size() > 0) {//授权
return 2;
}
return 0;
}
objectList = getService().findCountGroupByProvince(companyId, companyIds, posIds, mode);
public List<Object[]> findCountByProvince(Long companyId, List<Long> companyIds, List<Long> posIds, int carMode) {
Map<String, Object> params = Maps.newHashMap();
StringBuilder hql = new StringBuilder();
hql.append("select t.province, count(distinct t.id) as count from ");
hql.append(Device.class.getName()).append(" t inner join t.carInfo t10 left join t10.companies t3 ");
if (CollectionUtils.isNotEmpty(posIds)) {
hql.append(" join t10.positions t2 ");
}
hql.append(" where 1=1 ");
switch (carMode) {
case 1:
hql.append(" and t.company.id in (:companyIds) ");
params.put("companyIds", companyIds);
break;
case 2:
hql.append(" and t3.id =:companyId ");
params.put("companyId", companyId);
break;
default:
hql.append(" and (t.company.id in (:companyIds) or t3.id =:companyId) ");
params.put("companyId", companyId);
params.put("companyIds", companyIds);
break;
}
if (CollectionUtils.isNotEmpty(posIds)) {
hql.append(" and t2.id in (:posIds) ");
params.put("posIds", posIds);
}
hql.append(" and t.primary=1 group by t.province order by count(distinct t.id) desc");
return findByNamedParam(hql.toString(), params);
}
关于数据源为授权车辆、企业车辆的判断(限foton)的更多相关文章
- 2016中国人工智能企业TOP100, CBinsight2016年100家人工智能公司
2016中国人工智能企业TOP100 不论在学界还是业界,均有代表人物对人工智能表示了担忧,如史蒂芬·霍金和比尔·盖茨.尽管如此,国内外科技巨头都积极发力人工智能,一波波创业者也相继涌入.人工智能成为 ...
- ActiveReports 报表控件V12新特性 -- 无需ETL处理,即可实现跨数据源分析数据
ActiveReports是一款专注于 .NET 平台的报表控件,全面满足 HTML5 / WinForms / ASP.NET / ASP.NET MVC / WPF 等平台下报表设计和开发工作需求 ...
- 详解登录认证及授权--Shiro系列(一)
Apache Shiro 是一个强大而灵活的开源安全框架,它干净利落地处理身份认证,授权,企业会话管理和加密.Apache Shiro 的首要目标是易于使用和理解.安全有时候是很复杂的,甚至是痛苦的, ...
- Rshare Pro是否可以放入至客户企业App Store?
现在很多客户内部部署了苹果授权的企业内部的AppStore,我们的Rshare Pro 是完全允许放入企业搭建的AppStore平台中.但每份需要收费20美元,换成人民币是120元.
- Apache shiro集群实现 (四)shiro授权(Authentication)--访问控制
Apache shiro集群实现 (一) shiro入门介绍 Apache shiro集群实现 (二) shiro 的INI配置 Apache shiro集群实现 (三)shiro身份认证(Shiro ...
- ASP.NET Core Identity 实战(4)授权过程
这篇文章我们将一起来学习 Asp.Net Core 中的(注:这样描述不准确,稍后你会明白)授权过程 前情提要 在之前的文章里,我们有提到认证和授权是两个分开的过程,而且认证过程不属于Identity ...
- Java实现网易企业邮箱发送邮件
最近项目需要用网易企业邮箱发送邮件,特意来将实现过程记录一下: maven导入jar包 <!-- javax.mai 核心包 --> <dependency> <grou ...
- JEECG 多数据源设计
转至元数据起始 为什么要有多数据源? 通常一个系统只需要连接一个数据库就可以了,Jeecg数据源是配置在spring-mvc-hibernate.xml文件中,这种数据源我们叫做主数据源.但是在企 ...
- 课程分享 企业普及版贝斯OA与工作流系统
企业普及版贝斯OA与工作流系统 基于J2EE+JBPM3.x/JBPM4.3+Flex流程设计器+Jquery+授权认证企业普及版贝斯OA与工作流系统 假设对这个课程有兴趣的.能够和我联系.QQ205 ...
随机推荐
- 性能测试Jmeter安装
一. Jmeter下载地址: http://jmeter.apache.org/download_jmeter.cgi 二. JDK下载地址: https://www.oracle.com/tec ...
- Lua设计与实现--读书笔记
目录 lua简介 一种通用的数据类型:lua_TValue 字符串 Table lua实现一个队列 lua简介 C++底层核心模块,暴露核心接口给lua脚本层,网络的收发都在c++层完成,本书简述lu ...
- win10 配置 maven | 下载与配置
<!-- 阿里云仓库 --> <mirrors> <mirror> <id>nexus-aliyun</id> <mirrorOf&g ...
- Arduino 串行外设接口——W3Cschool
来源:https://www.w3cschool.cn/arduino/arduino_serial_peripheral_interface.html Arduino 串行外设接口 由 drbear ...
- 使用HTML的基本结构创建网页
1. 网页的扩展名--html或htm 2. 如何新建网页? 步骤1: 在电脑的空白处,右键选择-->新建--文本文档 步骤2: 把txt的扩展名,改成html或htm, ...
- 程序员你是如何使用Nacos作为配置中心的?
假如你使用的是spring-cloud-alibaba微服务技术栈 单个服务独有配置文件 即去除应用程序的状态,配置统一外部化管理,方便进行水平的伸缩. 集成步骤: 假如我有一个应用app-desig ...
- Vue结合Django-Rest-Frameword结合实现登录认证(二)
作者:小土豆biubiubiu 博客园:https://www.cnblogs.com/HouJiao/ 掘金:https://juejin.im/user/2436173500265335 微信公众 ...
- C# 生成chart图表的三种方式
.net中,微软给我们提供了画图类(system.drawing.imaging),在该类中画图的基本功能都有.比如:直线.折线.矩形.多边形.椭圆形.扇形.曲线等等,因此一般的图形都可以直接通过代码 ...
- ubuntu19.10如何添加开机启动项
$sudo vi /lib/systemd/system/rc-local.service内容如下[Unit]Description=/etc/rc.local CompatibilityDocume ...
- mysql5.7.23 解压版 密码忘记了咋办??
mysql 5.7.23 err文件: 查看log中保存的 密码 记下密码,重新启动MySQL服务,并进入CMD命令行,在此使用mysql -u root -p登陆,键入密码 进入数据库后,使用se ...