关于数据源为授权车辆、企业车辆的判断(限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 ...
随机推荐
- mybatis动态条件组合分页查询
一.动态条件处理 需要使用mybatis的动态sql 1 <select id="selectItemByCondition" parameterType="com ...
- 理解pytorch几个高级选择函数(如gather)
目录 1. 引言 2. 维度的理解 3. gather函数 4. index_select函数 5. masked_select函数 6. nonzero函数 1. 引言 最近在刷开源的Pytor ...
- Git入门教程,详解Git文件的四大状态
大家好,欢迎来到周一git专题. git clone 在上一篇文章当中我们聊了怎么在github当中创建一个属于自己的项目(repository),简称repo.除了建立自己的repo之外,我们更多的 ...
- js简单数据类型和复杂数据类型
var timer = null; //简单数据类型null 返回的是一个空的对象 object console.log(typeof timer); 1.简单数据类型 在内存中存放在栈中,在里面开 ...
- 初识 Istio - 服务网格管理工具
What is a service mesh(服务网格)? 微服务在国内流行已经多年了,大多数公司选择了基于容器化技术( Docker )以及容器编排管理平台 ( Kubernetes )落地微服务 ...
- CUMTCTF'2020 未完成 wp
Web babysqli burp抓包,发现有 的过滤,用/**/过滤空格. 报错注入 payload username=admin&password='/**/or/**/extractva ...
- 070 01 Android 零基础入门 01 Java基础语法 09 综合案例-数组移位 02 综合案例-数组移位-从键盘接收数据
070 01 Android 零基础入门 01 Java基础语法 09 综合案例-数组移位 02 综合案例-数组移位-从键盘接收数据 本文知识点:综合案例-数组移位-从键盘接收数据 说明:因为时间紧张 ...
- Ubuntu18.04修改apt-get源
1)备份源文件: sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak 2)查看版本信息 如是Linux Mint等Ubuntu衍生版,执行: ...
- 阅读源码,从ArrayList开始
前言 为啥要阅读源码?一句话,为了写出更好的程序. 一方面,只有了解了代码的执行过程,我们才能更好的使用别人提供的工具和框架,写出高效的程序.另一方面,一些经典的代码背后蕴藏的思想和技巧很值得学习,通 ...
- Vue自定义Popup弹窗组件|vue仿ios、微信弹窗|vue右键弹层
基于vue.js构建的轻量级Vue移动端弹出框组件Vpopup vpopup 汇聚了有赞Vant.京东NutUI等Vue组件库的Msg消息框.Popup弹层.Dialog对话框.Toast弱提示.Ac ...