oracle
lllgooo
java爱好者
展开
-
springboot中JPA的相关操作
1、dataObject/** * 复合主键 */@Datapublic class ProjectCompanyKeys implements Serializable{ private String projectNo;//项目编号 private String companyNo;//实施单位编号}/** * * 实体类 */@Data@...原创 2019-12-02 11:40:12 · 390 阅读 · 0 评论 -
mybatis向oracle中添加list xml写法
<?xml version="1.0" encoding="UTF-8" ?><!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" ><mapper namespace="transD原创 2018-08-06 17:26:25 · 939 阅读 · 0 评论 -
oracle的insert操作,忽略主键冲突问题
merge into table_a a using table_b b on(a.id=b.id)when not matched then insert(a.id,a.col,a.col2.....) values(b.id,b.col,b.col2.......)列子:(mybatis中的xml)入参:对象表b根据入参创建,然后判断表b跟表a的主键是否冲...原创 2018-09-28 10:44:57 · 8790 阅读 · 0 评论 -
oracle的insert语句,主键冲突时进行覆盖
merge into test_id a using (select id , name from test_id ) b on (a.id = b.id) WHEN MATCHED THEN UPDATE SET a.name = b.name WHEN NOT MATCHED THEN INSERT (a.id, a.nam...原创 2018-09-28 13:41:13 · 6946 阅读 · 0 评论 -
oracle根据某个字段统计各个状态的比例
SELECT ( CASE WHEN SOFTGATEWAY_POSLIST.POSSTATUS = 0 THEN '离线' WHEN SOFTGATEWAY_POSLIST.POSSTATUS = 1 THEN '在线' END ) status, COUNT( * ) rs, 100 * round( COUNT( * ) / SUM( COUNT( * )) OVER (), 2 )...原创 2018-10-19 17:33:12 · 3855 阅读 · 0 评论 -
oracle中对时间的一些处理
1、将number类型的时间值转换为时间格式的字符串 a、SUBSTR( numtodsinterval ( 30600, 'second' ), 12, 8 ) // 30600是从当天零点开始的秒数,此结果为(08:30:00) b、REPLACE ( SUBSTR( numtodsinterval ( 30600, 'second' ), 12, 8 ), ':', ''...原创 2018-10-10 23:16:12 · 923 阅读 · 0 评论