Commit 65e6ebe2 authored by ZWT's avatar ZWT

得到的

parent 103fb192
...@@ -2,19 +2,19 @@ ...@@ -2,19 +2,19 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pps.core.system.mapper.SysAreaViewMapper"> <mapper namespace="pps.core.system.mapper.SysAreaViewMapper">
<resultMap id="BaseResultMap" type="pps.core.system.entity.SysAreaView"> <resultMap id="BaseResultMap" type="pps.core.system.entity.SysAreaView">
<result column="id" property="id" jdbcType="INTEGER"/> <result column="ID" property="id"/>
<result column="name" property="name" jdbcType="VARCHAR"/> <result column="NAME" property="name"/>
<result column="parent_id" property="parentId" jdbcType="INTEGER"/> <result column="PARENT_ID" property="parentId"/>
<result column="lev" property="lev" jdbcType="INTEGER"/> <result column="LEV" property="lev"/>
<result column="city_code" property="cityCode" jdbcType="VARCHAR"/> <result column="CITY_CODE" property="cityCode"/>
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id ID
, ,
name, NAME,
parent_id, PARENT_ID,
lev, LEV,
city_code CITY_CODE
</sql> </sql>
<select id="selectOne" parameterType="pps.core.system.entity.SysAreaView" resultMap="BaseResultMap"> <select id="selectOne" parameterType="pps.core.system.entity.SysAreaView" resultMap="BaseResultMap">
select select
...@@ -38,63 +38,63 @@ ...@@ -38,63 +38,63 @@
WHERE WHERE
id &lt;&gt; 120 id &lt;&gt; 120
ORDER BY ORDER BY
parent_id, PARENT_ID,
id id
</select> </select>
<select id="selectListAllNew" parameterType="pps.core.system.entity.SysAreaView" resultMap="BaseResultMap"> <select id="selectListAllNew" parameterType="pps.core.system.entity.SysAreaView" resultMap="BaseResultMap">
WITH RECURSIVE area_tree (n, id, parent_id) AS (SELECT 0 AS n, WITH RECURSIVE AREA_TREE (N, ID, PARENT_ID) AS (SELECT 0 AS N,
id, ID,
parent_id PARENT_ID
FROM SYS_AREA FROM SYS_AREA
WHERE parent_id = 20 WHERE PARENT_ID = 20
UNION ALL UNION ALL
SELECT n + 1, SELECT N + 1,
a.id, A.ID,
a.parent_id A.PARENT_ID
FROM area_tree AS t FROM AREA_TREE AS T
JOIN SYS_AREA AS a ON a.parent_id = t.id) JOIN SYS_AREA AS A ON A.PARENT_ID = T.ID)
SELECT t.id, SELECT T.ID,
t.parent_id, T.PARENT_ID,
t.n AS lev, T.N AS LEV,
a.NAME, A.NAME,
a.city_code, A.CITY_CODE,
a.province_code A.PROVINCE_CODE
FROM area_tree t, FROM AREA_TREE T,
SYS_AREA a SYS_AREA A
WHERE t.id = a.id WHERE T.ID = A.ID
ORDER BY t.parent_id, ORDER BY T.PARENT_ID,
t.id T.ID
</select> </select>
<select id="selectSysAreaPath" parameterType="pps.core.system.entity.SysAreaView" resultMap="BaseResultMap"> <select id="selectSysAreaPath" parameterType="pps.core.system.entity.SysAreaView" resultMap="BaseResultMap">
SELECT CONCAT(b.`name`, '/', c.`name`) AS `name` SELECT CONCAT(B.`NAME`, '/', C.`NAME`) AS `NAME`
FROM SYS_AREA b FROM SYS_AREA B
JOIN SYS_AREA c ON b.id = c.parent_id JOIN SYS_AREA C ON B.ID = C.PARENT_ID
WHERE b.lev = 1 WHERE B.LEV = 1
AND c.lev = 2 AND C.LEV = 2
AND (b.id = #{id} OR c.id = #{id}) LIMIT 1 AND (B.ID = #{id} OR C.ID = #{id}) LIMIT 1
</select> </select>
<resultMap id="ExtResultMap" type="pps.core.system.entity.SysAreaView" extends="BaseResultMap"> <resultMap id="ExtResultMap" type="pps.core.system.entity.SysAreaView" extends="BaseResultMap">
<result column="province" property="province" jdbcType="VARCHAR"/> <result column="PROVINCE" property="province" />
<result column="city" property="city" jdbcType="VARCHAR"/> <result column="CITY" property="city" />
</resultMap> </resultMap>
<select id="selectProvinceAndCity" parameterType="list" resultMap="ExtResultMap"> <select id="selectProvinceAndCity" parameterType="list" resultMap="ExtResultMap">
SELECT p.`name` AS province, SELECT P.`NAME` AS PROVINCE,
a.`name` AS city, A.`NAME` AS CITY,
a.city_code, A.CITY_CODE,
a.id A.ID
FROM SYS_AREA p FROM SYS_AREA P
LEFT JOIN SYS_AREA a ON p.id = a.parent_id LEFT JOIN SYS_AREA A ON P.ID = A.PARENT_ID
WHERE p.`name` IN WHERE P.`NAME` IN
<foreach collection="list" item="item" open="(" close=")" separator=","> <foreach collection="list" item="item" open="(" close=")" separator=",">
#{item} #{item}
</foreach> </foreach>
AND a.`name` != '无' AND A.`NAME` != '无'
ORDER BY ORDER BY
p.id, P.ID,
a.id A.ID
</select> </select>
</mapper> </mapper>
...@@ -2,131 +2,131 @@ ...@@ -2,131 +2,131 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pps.core.system.mapper.SysAuthOuScopeViewMapper"> <mapper namespace="pps.core.system.mapper.SysAuthOuScopeViewMapper">
<resultMap id="BaseResultMap" type="pps.core.system.entity.SysAuthOuScopeView"> <resultMap id="BaseResultMap" type="pps.core.system.entity.SysAuthOuScopeView">
<id column="id" property="id" jdbcType="VARCHAR"/> <id column="ID" property="id"/>
<result column="ou_id" property="ouId" jdbcType="VARCHAR"/> <result column="OU_ID" property="ouId"/>
<result column="ou_name" property="ouName" jdbcType="VARCHAR"/> <result column="OU_NAME" property="ouName"/>
<result column="user_id" property="userId" jdbcType="VARCHAR"/> <result column="USER_ID" property="userId"/>
<result column="user_group_id" property="userGroupId" jdbcType="VARCHAR"/> <result column="USER_GROUP_ID" property="userGroupId"/>
<result column="menu_id" property="menuId" jdbcType="VARCHAR"/> <result column="MENU_ID" property="menuId"/>
<result column="menu_name" property="menuName" jdbcType="VARCHAR"/> <result column="MENU_NAME" property="menuName"/>
<result column="create_by_id" property="createById" jdbcType="VARCHAR"/> <result column="CREATE_BY_ID" property="createById"/>
<result column="create_by_name" property="createByName" jdbcType="VARCHAR"/> <result column="CREATE_BY_NAME" property="createByName"/>
<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/> <result column="CREATE_TIME" property="createTime"/>
<result column="modify_by_id" property="modifyById" jdbcType="VARCHAR"/> <result column="MODIFY_BY_ID" property="modifyById"/>
<result column="modify_by_name" property="modifyByName" jdbcType="VARCHAR"/> <result column="MODIFY_BY_NAME" property="modifyByName"/>
<result column="modify_time" property="modifyTime" jdbcType="TIMESTAMP"/> <result column="MODIFY_TIME" property="modifyTime"/>
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id ID
, ,
ou_id, OU_ID,
user_id, USER_ID,
user_group_id, USER_GROUP_ID,
menu_id, MENU_ID,
create_by_id, CREATE_BY_ID,
create_by_name, CREATE_BY_NAME,
create_time, CREATE_TIME,
modify_by_id, MODIFY_BY_ID,
modify_by_name, MODIFY_BY_NAME,
modify_time MODIFY_TIME
</sql> </sql>
<select id="selectOne" parameterType="pps.core.system.entity.SysAuthOuScopeView" resultMap="BaseResultMap"> <select id="selectOne" parameterType="pps.core.system.entity.SysAuthOuScopeView" resultMap="BaseResultMap">
select SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from SYS_AUTH_OU_SCOPE FROM SYS_AUTH_OU_SCOPE
where WHERE
id=#{id} id=#{id}
</select> </select>
<select id="selectList" parameterType="pps.core.system.entity.SysAuthOuScopeView" resultMap="BaseResultMap"> <select id="selectList" parameterType="pps.core.system.entity.SysAuthOuScopeView" resultMap="BaseResultMap">
select c.id,c.ou_id,c.menu_id,a.ou_name,b.menu_name,c.create_by_name,c.create_time SELECT C.ID,C.OU_ID,C.MENU_ID,A.OU_NAME,B.MENU_NAME,C.CREATE_BY_NAME,C.CREATE_TIME
from SYS_ORGANIZATION a ,SYS_MENU b,SYS_AUTH_OU_SCOPE c FROM SYS_ORGANIZATION A ,SYS_MENU B,SYS_AUTH_OU_SCOPE C
where a.id =c.ou_id and b.id = c.menu_id WHERE A.ID =C.OU_ID AND B.ID = C.MENU_ID
and c.user_id = #{userId} AND C.USER_ID = #{userId}
<if test="menuName!=null and menuName!='' "> <if test="menuName!=null and menuName!='' ">
and b.menu_name like concat('%',#{menuName,jdbcType=VARCHAR},'%') AND B.MENU_NAME LIKE CONCAT('%',#{menuName,jdbcType=VARCHAR},'%')
</if> </if>
order by a.ou_name asc ,c.create_time desc ORDER BY A.OU_NAME ASC ,C.CREATE_TIME DESC
</select> </select>
<select id="selectListByUserGroupId" parameterType="pps.core.system.entity.SysAuthOuScopeView" <select id="selectListByUserGroupId" parameterType="pps.core.system.entity.SysAuthOuScopeView"
resultMap="BaseResultMap"> resultMap="BaseResultMap">
select SELECT
sau.id, SAU.ID,
sau.ou_id, SAU.OU_ID,
sau.user_id, SAU.USER_ID,
sau.user_group_id, SAU.USER_GROUP_ID,
sau.menu_id, SAU.MENU_ID,
sau.create_by_id, SAU.CREATE_BY_ID,
sau.create_by_name, SAU.CREATE_BY_NAME,
sau.create_time, SAU.CREATE_TIME,
sau.modify_by_id, SAU.MODIFY_BY_ID,
sau.modify_by_name, SAU.MODIFY_BY_NAME,
sau.modify_time,sm.menu_name SAU.MODIFY_TIME,SM.MENU_NAME
from SYS_AUTH_OU_SCOPE sau FROM SYS_AUTH_OU_SCOPE SAU
left join SYS_MENU sm on sm.id=sau.menu_id LEFT JOIN SYS_MENU SM ON SM.ID=SAU.MENU_ID
where WHERE
<if test="userGroupId!=null and userGroupId!='' "> <if test="userGroupId!=null and userGroupId!='' ">
and sau.user_group_id =#{userGroupId} AND SAU.USER_GROUP_ID =#{userGroupId}
</if> </if>
</select> </select>
<select id="selectOuIdsByUserId" parameterType="pps.core.system.entity.SysAuthOuScopeView" <select id="selectOuIdsByUserId" parameterType="pps.core.system.entity.SysAuthOuScopeView"
resultMap="BaseResultMap"> resultMap="BaseResultMap">
select ou_id, ou_name SELECT OU_ID, OU_NAME
from ( FROM (
(select distinct ou_id (SELECT DISTINCT OU_ID
from SYS_AUTH_OU_SCOPE FROM SYS_AUTH_OU_SCOPE
where user_id = #{userId}) saos WHERE USER_ID = #{userId}) SAOS
left join SYS_ORGANIZATION so on saos.ou_id = so.id and so.is_deleted = 1 LEFT JOIN SYS_ORGANIZATION SO ON SAOS.OU_ID = SO.ID AND SO.IS_DELETED = 1
) )
</select> </select>
<select id="selectOuInfoByCondition" parameterType="pps.core.system.entity.SysAuthOuScopeView" <select id="selectOuInfoByCondition" parameterType="pps.core.system.entity.SysAuthOuScopeView"
resultMap="BaseResultMap"> resultMap="BaseResultMap">
select SELECT
saos.ou_id,so.ou_name SAOS.OU_ID,SO.OU_NAME
from ( FROM (
( (
select distinct ou_id SELECT DISTINCT OU_ID
from SYS_AUTH_OU_SCOPE FROM SYS_AUTH_OU_SCOPE
<where> <where>
<if test="userId != null and userId != ''"> <if test="userId != null and userId != ''">
and user_id = #{userId} AND USER_ID = #{userId}
</if> </if>
<if test="menuId != null and menuId != ''"> <if test="menuId != null and menuId != ''">
and menu_id = #{menuId} AND MENU_ID = #{menuId}
</if> </if>
</where> </where>
) saos ) SAOS
left join SYS_ORGANIZATION so on saos.ou_id=so.id and so.is_deleted =1 LEFT JOIN SYS_ORGANIZATION SO ON SAOS.OU_ID=SO.ID AND SO.IS_DELETED =1
) )
</select> </select>
<select id="selectOuMediaTypeByUserId" parameterType="pps.core.system.entity.SysAuthOuScopeView" <select id="selectOuMediaTypeByUserId" parameterType="pps.core.system.entity.SysAuthOuScopeView"
resultType="pps.core.system.entity.SysAuthOuScopeView"> resultType="pps.core.system.entity.SysAuthOuScopeView">
select 'GAS' as media_type SELECT 'GAS' AS MEDIA_TYPE
</select> </select>
<select id="selectScopeUserInfo" resultType="pps.core.system.entity.SysAuthOuScopeUserInfo"> <select id="selectScopeUserInfo" resultType="pps.core.system.entity.SysAuthOuScopeUserInfo">
select distinct su.id, SELECT DISTINCT SU.ID,
su.user_name, SU.USER_NAME,
su.login_name, SU.LOGIN_NAME,
su.iam_login_name, SU.IAM_LOGIN_NAME,
so.id, SO.ID,
so.ou_name SO.OU_NAME
from SYS_AUTH_OU_SCOPE saos, FROM SYS_AUTH_OU_SCOPE SAOS,
SYS_USER su, SYS_USER SU,
SYS_ORGANIZATION so, SYS_ORGANIZATION SO,
SYS_MENU sm, SYS_MENU SM,
SYS_USER_ORGANIZATION_REL suor SYS_USER_ORGANIZATION_REL SUOR
where saos.user_id = su.id WHERE SAOS.USER_ID = SU.ID
and suor.ou_id = so.id AND SUOR.OU_ID = SO.ID
and saos.menu_id = sm.id AND SAOS.MENU_ID = SM.ID
and saos.user_id = suor.user_id AND SAOS.USER_ID = SUOR.USER_ID
and saos.menu_id = #{menuId} AND SAOS.MENU_ID = #{menuId}
and saos.ou_id = #{ouId} AND SAOS.OU_ID = #{ouId}
</select> </select>
<insert id="batchInsert" parameterType="java.util.List"> <insert id="batchInsert" parameterType="java.util.List">
INSERT INTO SYS_AUTH_OU_SCOPE INSERT INTO SYS_AUTH_OU_SCOPE
(id, ou_id, user_id, user_group_id, menu_id, create_by_id, create_by_name, create_time) (ID, OU_ID, USER_ID, USER_GROUP_ID, MENU_ID, CREATE_BY_ID, CREATE_BY_NAME, CREATE_TIME)
VALUES VALUES
<foreach collection="list" item="item" separator=","> <foreach collection="list" item="item" separator=",">
(#{item.id}, #{item.ouId}, #{item.userId}, #{item.userGroupId}, #{item.menuId}, #{item.createById}, (#{item.id}, #{item.ouId}, #{item.userId}, #{item.userGroupId}, #{item.menuId}, #{item.createById},
......
...@@ -2,305 +2,300 @@ ...@@ -2,305 +2,300 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pps.core.system.mapper.SysDictionaryViewMapper"> <mapper namespace="pps.core.system.mapper.SysDictionaryViewMapper">
<resultMap id="BaseResultMap" type="pps.core.system.entity.SysDictionaryView"> <resultMap id="BaseResultMap" type="pps.core.system.entity.SysDictionaryView">
<id column="id" property="id" jdbcType="VARCHAR"/> <id column="ID" property="id" />
<result column="pid" property="pid" jdbcType="VARCHAR"/> <result column="PID" property="pid" />
<result column="dic_name" property="dicName" jdbcType="VARCHAR"/> <result column="DIC_NAME" property="dicName" />
<result column="short_name" property="shortName" jdbcType="VARCHAR"/> <result column="SHORT_NAME" property="shortName" />
<result column="remark" property="remark" jdbcType="VARCHAR"/> <result column="REMARK" property="remark" />
<result column="sort" property="sort" jdbcType="INTEGER"/> <result column="SORT" property="sort" />
<result column="levels" property="levels" jdbcType="INTEGER"/> <result column="LEVELS" property="levels" />
<result column="be_default" property="beDefault" jdbcType="INTEGER"/> <result column="BE_DEFAULT" property="beDefault" />
<result column="be_has_children" property="beHasChildren" jdbcType="INTEGER"/> <result column="BE_HAS_CHILDREN" property="beHasChildren" />
<result column="dic_type" property="dicType" jdbcType="INTEGER"/> <result column="DIC_TYPE" property="dicType" />
<result column="effect_time" property="effectTime" jdbcType="TIMESTAMP"/> <result column="EFFECT_TIME" property="effectTime" />
<result column="end_time" property="endTime" jdbcType="TIMESTAMP"/> <result column="END_TIME" property="endTime" />
<result column="create_name" property="createName" jdbcType="VARCHAR"/> <result column="CREATE_NAME" property="createName" />
<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/> <result column="CREATE_TIME" property="createTime" />
<result column="modify_name" property="modifyName" jdbcType="VARCHAR"/> <result column="MODIFY_NAME" property="modifyName" />
<result column="modify_time" property="modifyTime" jdbcType="TIMESTAMP"/> <result column="MODIFY_TIME" property="modifyTime" />
<result column="alias" property="alias" jdbcType="VARCHAR"/> <result column="ALIAS" property="alias" />
<result column="dic_key" property="dicKey" jdbcType="VARCHAR"/> <result column="DIC_KEY" property="dicKey" />
<result column="dic_path" property="dicPath" jdbcType="VARCHAR"/> <result column="DIC_PATH" property="dicPath" />
<result column="use_lower_level" property="useLowerLevel" jdbcType="INTEGER"/> <result column="USE_LOWER_LEVEL" property="useLowerLevel" />
<result column="ou_name" property="ouName" jdbcType="VARCHAR"/> <result column="OU_NAME" property="ouName" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id ID
, ,
pid, PID,
dic_name, DIC_NAME,
short_name, SHORT_NAME,
remark, REMARK,
sort, SORT,
levels, LEVELS,
be_default, BE_DEFAULT,
be_has_children, BE_HAS_CHILDREN,
dic_type, DIC_TYPE,
effect_time, EFFECT_TIME,
end_time, END_TIME,
create_name, CREATE_NAME,
create_time, CREATE_TIME,
modify_name, MODIFY_NAME,
modify_time, MODIFY_TIME,
alias, ALIAS,
dic_path, DIC_PATH,
dic_key DIC_KEY
</sql> </sql>
<select id="selectOne" parameterType="pps.core.system.entity.SysDictionaryView" resultMap="BaseResultMap"> <select id="selectOne" parameterType="pps.core.system.entity.SysDictionaryView" resultMap="BaseResultMap">
select SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from SYS_DICTIONARY FROM SYS_DICTIONARY
where WHERE
id=#{id} ID=#{id}
</select> </select>
<select id="selectList" parameterType="pps.core.system.entity.SysDictionaryView" resultMap="BaseResultMap"> <select id="selectList" parameterType="pps.core.system.entity.SysDictionaryView" resultMap="BaseResultMap">
select SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from SYS_DICTIONARY FROM SYS_DICTIONARY
where WHERE
id=#{id} ID=#{id}
</select> </select>
<select id="selectListsByParentIds" parameterType="pps.core.system.entity.SysDictionaryView" <select id="selectListsByParentIds" parameterType="pps.core.system.entity.SysDictionaryView"
resultMap="BaseResultMap"> resultMap="BaseResultMap">
select SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from SYS_DICTIONARY FROM SYS_DICTIONARY
where end_time &gt; #{endTime} WHERE END_TIME &gt; #{endTime}
<if test="pid != null and pid !=''"> <if test="pid != null and pid !=''">
and pid in AND PID IN
<foreach item="item" index="index" collection="pid.split(',')" open="(" separator="," close=")"> <foreach item="item" index="index" collection="pid.split(',')" open="(" separator="," close=")">
#{item} #{item}
</foreach> </foreach>
</if> </if>
order by sort ORDER BY SORT
</select> </select>
<select id="selectListsByParentCodes" parameterType="pps.core.system.entity.SysDictionaryView" <select id="selectListsByParentCodes" parameterType="pps.core.system.entity.SysDictionaryView"
resultMap="BaseResultMap"> resultMap="BaseResultMap">
select SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from SYS_DICTIONARY FROM SYS_DICTIONARY
<where> <where>
<if test="alias != null and alias !=''"> <if test="alias != null and alias !=''">
and alias in AND ALIAS IN
<foreach item="item" index="index" collection="alias.split(',')" open="(" separator="," close=")"> <foreach item="item" index="index" collection="alias.split(',')" open="(" separator="," close=")">
#{item} #{item}
</foreach> </foreach>
</if> </if>
</where> </where>
order by create_time desc ORDER BY CREATE_TIME DESC
</select> </select>
<select id="selectListsByAlias" parameterType="pps.core.system.entity.SysDictionaryView" resultMap="BaseResultMap"> <select id="selectListsByAlias" parameterType="pps.core.system.entity.SysDictionaryView" resultMap="BaseResultMap">
select SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from SYS_DICTIONARY FROM SYS_DICTIONARY
where pid in WHERE PID IN
(select id from SYS_DICTIONARY (SELECT ID FROM SYS_DICTIONARY
<where> <where>
<if test="alias != null and alias !=''"> <if test="alias != null and alias !=''">
and alias = #{alias} AND ALIAS = #{alias}
</if> </if>
</where> </where>
) )
order by create_time desc ORDER BY CREATE_TIME DESC
</select> </select>
<select id="selectListsByByDicKeys" parameterType="pps.core.system.entity.SysDictionaryView" <select id="selectListsByByDicKeys" parameterType="pps.core.system.entity.SysDictionaryView"
resultMap="BaseResultMap"> resultMap="BaseResultMap">
select SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from SYS_DICTIONARY FROM SYS_DICTIONARY
<where> <where>
<if test="alias != null and alias !=''"> <if test="alias != null and alias !=''">
and (pid in AND (PID IN
<foreach item="item" index="index" collection="alias.split(',')" open="(" separator="," close=")"> <foreach item="item" index="index" collection="alias.split(',')" open="(" separator="," close=")">
#{item} #{item}
</foreach> </foreach>
or id in OR ID IN
<foreach item="item" index="index" collection="alias.split(',')" open="(" separator="," close=")"> <foreach item="item" index="index" collection="alias.split(',')" open="(" separator="," close=")">
#{item} #{item}
</foreach> </foreach>
) )
</if> </if>
<if test="dicName != null and dicName !=''"> <if test="dicName != null and dicName !=''">
and dic_name like concat('%',#{dicName},'%') AND DIC_NAME LIKE CONCAT('%',#{dicName},'%')
</if> </if>
</where> </where>
order by create_time desc ORDER BY CREATE_TIME DESC
</select> </select>
<select id="selectSysDictionaryTree" resultType="pps.core.system.entity.SysDictionaryView"> <select id="selectSysDictionaryTree" resultType="pps.core.system.entity.SysDictionaryView">
SELECT DISTINCT SD.ID, SD.PID, SD.DIC_NAME, SD.SORT
select distinct sd.id, sd.pid, sd.dic_name, sd.sort FROM SYS_DICTIONARY SD
from SYS_DICTIONARY sd LEFT JOIN SYS_DICTIONARY SD1 ON SD.ID = SD1.PID
left join SYS_DICTIONARY sd1 on sd.id = sd1.pid LEFT JOIN SYS_DICTIONARY SD2 ON SD1.ID = SD2.PID
left join SYS_DICTIONARY sd2 on sd1.id = sd2.pid WHERE SD.PID = '30'
where sd.pid = '30' AND SD.EFFECT_TIME &lt;= NOW()
and sd.effect_time &lt;= now() AND SD.END_TIME &gt;= NOW()
and sd.end_time &gt;= now() AND SD.DIC_NAME IS NOT NULL
and sd.dic_name is not null UNION ALL
SELECT DISTINCT SD1.ID,
union all SD1.PID,
SD1.DIC_NAME,
select distinct sd1.id, SD1.SORT
sd1.pid, FROM SYS_DICTIONARY SD
sd1.dic_name, LEFT JOIN SYS_DICTIONARY SD1 ON SD.ID = SD1.PID
sd1.sort LEFT JOIN SYS_DICTIONARY SD2 ON SD1.ID = SD2.PID
from SYS_DICTIONARY sd WHERE SD.PID = '30'
left join SYS_DICTIONARY sd1 on sd.id = sd1.pid AND SD1.EFFECT_TIME &lt;= NOW()
left join SYS_DICTIONARY sd2 on sd1.id = sd2.pid AND SD1.END_TIME &gt;= NOW()
where sd.pid = '30' AND SD1.DIC_NAME IS NOT NULL
and sd1.effect_time &lt;= now() UNION ALL
and sd1.end_time &gt;= now() SELECT DISTINCT SD2.ID,
and sd1.dic_name is not null SD2.PID,
SD2.DIC_NAME,
union all SD2.SORT
FROM SYS_DICTIONARY SD
select distinct sd2.id, LEFT JOIN SYS_DICTIONARY SD1 ON SD.ID = SD1.PID
sd2.pid, LEFT JOIN SYS_DICTIONARY SD2 ON SD1.ID = SD2.PID
sd2.dic_name, WHERE SD.PID = '30'
sd2.sort AND SD2.EFFECT_TIME &lt;= NOW()
from SYS_DICTIONARY sd AND SD2.END_TIME &gt;= NOW()
left join SYS_DICTIONARY sd1 on sd.id = sd1.pid AND SD2.DIC_NAME IS NOT NULL
left join SYS_DICTIONARY sd2 on sd1.id = sd2.pid
where sd.pid = '30'
and sd2.effect_time &lt;= now()
and sd2.end_time &gt;= now()
and sd2.dic_name is not null
</select> </select>
<select id="selectListsByDicPath" parameterType="pps.core.system.entity.SysDictionaryView" <select id="selectListsByDicPath" parameterType="pps.core.system.entity.SysDictionaryView"
resultMap="BaseResultMap"> resultMap="BaseResultMap">
select id, pid, dic_key, dic_name SELECT ID, PID, DIC_KEY, DIC_NAME
from SYS_DICTIONARY sd FROM SYS_DICTIONARY SD
where dic_path like concat('%/', #{dicPath}, '%') WHERE DIC_PATH LIKE CONCAT('%/', #{dicPath}, '%')
and sd.effect_time &lt;= now() AND SD.EFFECT_TIME &lt;= NOW()
and sd.end_time &gt;= now() AND SD.END_TIME &gt;= NOW()
order by levels, dic_name ORDER BY LEVELS, DIC_NAME
</select> </select>
<select id="selectListsByDicPathIncludeSelf" parameterType="pps.core.system.entity.SysDictionaryView" <select id="selectListsByDicPathIncludeSelf" parameterType="pps.core.system.entity.SysDictionaryView"
resultMap="BaseResultMap"> resultMap="BaseResultMap">
select id, pid, dic_key, dic_name SELECT ID, PID, DIC_KEY, DIC_NAME
from SYS_DICTIONARY sd FROM SYS_DICTIONARY SD
where id = #{dicPath} WHERE ID = #{dicPath}
or dic_path like concat('%', #{dicPath}, '%') OR DIC_PATH LIKE CONCAT('%', #{dicPath}, '%')
and sd.effect_time &lt;= now() and sd.end_time &gt;= now() AND SD.EFFECT_TIME &lt;= NOW() AND SD.END_TIME &gt;= NOW()
order by levels, dic_name ORDER BY LEVELS, DIC_NAME
</select> </select>
<select id="selectListByCondition" parameterType="pps.core.system.entity.SysDictionaryView" <select id="selectListByCondition" parameterType="pps.core.system.entity.SysDictionaryView"
resultMap="BaseResultMap"> resultMap="BaseResultMap">
select a.*,asd.dic_name,asd.effect_time,asd.end_time,asd.remark,asd.dic_key,a.ou_id,aasd.use_lower_level from ( SELECT A.*,ASD.DIC_NAME,ASD.EFFECT_TIME,ASD.END_TIME,ASD.REMARK,ASD.DIC_KEY,A.OU_ID,AASD.USE_LOWER_LEVEL FROM (
select distinct so.ou_name,so.id as ou_id, SELECT DISTINCT SO.OU_NAME,SO.ID AS OU_ID,
case when split_part(dic_path,'/',2) is null then sd.id else split_part(dic_path,'/',2) end as id CASE WHEN SPLIT_PART(DIC_PATH,'/',2) IS NULL THEN SD.ID ELSE SPLIT_PART(DIC_PATH,'/',2) END AS ID
from SYS_ORGANIZATION_DICTIONARY sod FROM SYS_ORGANIZATION_DICTIONARY SOD
left join SYS_DICTIONARY sd on sod.dic_code =sd.id LEFT JOIN SYS_DICTIONARY SD ON SOD.DIC_CODE =SD.ID
left join SYS_ORGANIZATION so on so.id =sod.ou_id LEFT JOIN SYS_ORGANIZATION SO ON SO.ID =SOD.OU_ID
where sod.end_time >now() and sod.dic_code is not null WHERE SOD.END_TIME >NOW() AND SOD.DIC_CODE IS NOT NULL
<if test="dicName != null and dicName != ''"> <if test="dicName != null and dicName != ''">
and sd.dic_name like concat('%',#{dicName},'%') AND SD.DIC_NAME LIKE CONCAT('%',#{dicName},'%')
</if> </if>
<if test="ouId != null and ouId != ''"> <if test="ouId != null and ouId != ''">
and sod.ou_id=#{ouId} AND SOD.OU_ID=#{ouId}
</if>)a </if>)A
left join SYS_DICTIONARY asd on asd.id = a.id LEFT JOIN SYS_DICTIONARY ASD ON ASD.ID = A.ID
left join SYS_ORGANIZATION_DICTIONARY aasd on a.ou_id = aasd.ou_id and a.id=aasd.dic_code LEFT JOIN SYS_ORGANIZATION_DICTIONARY AASD ON A.OU_ID = AASD.OU_ID AND A.ID=AASD.DIC_CODE
where aasd.end_time >now() WHERE AASD.END_TIME >NOW()
</select> </select>
<select id="selectListByConditionByPage" parameterType="pps.core.system.entity.SysDictionaryView" <select id="selectListByConditionByPage" parameterType="pps.core.system.entity.SysDictionaryView"
resultMap="BaseResultMap"> resultMap="BaseResultMap">
select a.ou_name,a.ou_id,a.id,a.id as dic_code,asd.pid as SELECT A.OU_NAME,A.OU_ID,A.ID,A.ID AS DIC_CODE,ASD.PID AS
parent_dic_code,asd.dic_name,asd.effect_time,asd.end_time,asd.remark,asd.dic_key from ( PARENT_DIC_CODE,ASD.DIC_NAME,ASD.EFFECT_TIME,ASD.END_TIME,ASD.REMARK,ASD.DIC_KEY FROM (
select distinct so.ou_name,so.id as ou_id, SELECT DISTINCT SO.OU_NAME,SO.ID AS OU_ID,
case when split_part(dic_path,'/',2) is null then sd.id else split_part(dic_path,'/',2) end as id CASE WHEN SPLIT_PART(DIC_PATH,'/',2) IS NULL THEN SD.ID ELSE SPLIT_PART(DIC_PATH,'/',2) END AS ID
from SYS_ORGANIZATION_DICTIONARY sod FROM SYS_ORGANIZATION_DICTIONARY SOD
left join SYS_DICTIONARY sd on sod.dic_code =sd.id LEFT JOIN SYS_DICTIONARY SD ON SOD.DIC_CODE =SD.ID
left join SYS_ORGANIZATION so on so.id =sod.ou_id LEFT JOIN SYS_ORGANIZATION SO ON SO.ID =SOD.OU_ID
where sod.end_time >#{endTime} and sod.dic_code is not null WHERE SOD.END_TIME >#{endTime} AND SOD.DIC_CODE IS NOT NULL
<if test="dicName != null and dicName != ''"> <if test="dicName != null and dicName != ''">
and sd.dic_name like concat('%',#{dicName},'%') AND SD.DIC_NAME LIKE CONCAT('%',#{dicName},'%')
</if> </if>
<if test="ouId != null and ouId != ''"> <if test="ouId != null and ouId != ''">
and sod.ou_id=#{ouId} AND SOD.OU_ID=#{ouId}
</if>)a </if>)A
left join SYS_DICTIONARY asd on asd.id = a.id LEFT JOIN SYS_DICTIONARY ASD ON ASD.ID = A.ID
order by asd.effect_time desc ORDER BY ASD.EFFECT_TIME DESC
limit #{startRow},#{endRow} LIMIT #{startRow},#{endRow}
</select> </select>
<select id="selectListByConditionByCount" parameterType="pps.core.system.entity.SysDictionaryView" <select id="selectListByConditionByCount" parameterType="pps.core.system.entity.SysDictionaryView"
resultType="java.lang.Integer"> resultType="java.lang.Integer">
select count(0) from ( SELECT COUNT(0) FROM (
select distinct so.ou_name,so.id as ou_id, SELECT DISTINCT SO.OU_NAME,SO.ID AS OU_ID,
case when split_part(dic_path,'/',2) is null then sd.id else split_part(dic_path,'/',2) end as id CASE WHEN SPLIT_PART(DIC_PATH,'/',2) IS NULL THEN SD.ID ELSE SPLIT_PART(DIC_PATH,'/',2) END AS ID
from SYS_ORGANIZATION_DICTIONARY sod FROM SYS_ORGANIZATION_DICTIONARY SOD
left join SYS_DICTIONARY sd on sod.dic_code =sd.id LEFT JOIN SYS_DICTIONARY SD ON SOD.DIC_CODE =SD.ID
left join SYS_ORGANIZATION so on so.id =sod.ou_id LEFT JOIN SYS_ORGANIZATION SO ON SO.ID =SOD.OU_ID
where sod.end_time >#{endTime} and sod.dic_code is not null WHERE SOD.END_TIME >#{endTime} AND SOD.DIC_CODE IS NOT NULL
<if test="dicName != null and dicName != ''"> <if test="dicName != null and dicName != ''">
and sd.dic_name like concat('%',#{dicName},'%') AND SD.DIC_NAME LIKE CONCAT('%',#{dicName},'%')
</if> </if>
<if test="ouId != null and ouId != ''"> <if test="ouId != null and ouId != ''">
and sod.ou_id=#{ouId} AND SOD.OU_ID=#{ouId}
</if>)a </if>)A
</select> </select>
<select id="selectChildListByCondition" parameterType="pps.core.system.entity.SysDictionaryView" <select id="selectChildListByCondition" parameterType="pps.core.system.entity.SysDictionaryView"
resultMap="BaseResultMap"> resultMap="BaseResultMap">
select a.ou_name, SELECT A.OU_NAME,
a.ou_id, A.OU_ID,
a.id, A.ID,
a.id as dic_code, A.ID AS DIC_CODE,
asd.pid as parent_dic_code, ASD.PID AS PARENT_DIC_CODE,
asd.dic_name, ASD.DIC_NAME,
asd.effect_time, ASD.EFFECT_TIME,
asd.end_time, ASD.END_TIME,
asd.remark, ASD.REMARK,
asd.dic_key ASD.DIC_KEY
from (select distinct so.ou_name, FROM (SELECT DISTINCT SO.OU_NAME,
so.id as ou_id, SO.ID AS OU_ID,
dic_code as id, DIC_CODE AS ID,
sod.use_lower_level SOD.USE_LOWER_LEVEL
from (select * FROM (SELECT *
from SYS_ORGANIZATION_DICTIONARY FROM SYS_ORGANIZATION_DICTIONARY
where parent_dic_code = #{pid} WHERE PARENT_DIC_CODE = #{pid}
and ou_id = #{ouId}) sod AND OU_ID = #{ouId}) SOD
left join SYS_DICTIONARY sd on sod.dic_code = sd.id LEFT JOIN SYS_DICTIONARY SD ON SOD.DIC_CODE = SD.ID
left join SYS_ORGANIZATION so on so.id = sod.ou_id LEFT JOIN SYS_ORGANIZATION SO ON SO.ID = SOD.OU_ID
where sod.end_time > #{endTimeStr} WHERE SOD.END_TIME > #{endTimeStr}
and sod.dic_code is not null) a AND SOD.DIC_CODE IS NOT NULL) A
left join SYS_DICTIONARY asd on asd.id = a.id LEFT JOIN SYS_DICTIONARY ASD ON ASD.ID = A.ID
</select> </select>
<select id="selectListByEquipmentType" parameterType="pps.core.system.entity.SysDictionaryView" <select id="selectListByEquipmentType" parameterType="pps.core.system.entity.SysDictionaryView"
resultMap="BaseResultMap"> resultMap="BaseResultMap">
with RECURSIVE temps as WITH RECURSIVE TEMPS AS
(select id, pid (SELECT ID, PID
from SYS_DICTIONARY sd FROM SYS_DICTIONARY SD
where (dic_path like concat('%', #{id}, '%') or id = #{id}) WHERE (DIC_PATH LIKE CONCAT('%', #{id}, '%') OR ID = #{id})
and dic_key = #{dicKey} AND DIC_KEY = #{dicKey}
union all UNION ALL
select a.id, a.pid SELECT A.ID, A.PID
from temps FROM TEMPS
inner join SYS_DICTIONARY a on temps.pid = a.id) INNER JOIN SYS_DICTIONARY A ON TEMPS.PID = A.ID)
select temps.* SELECT TEMPS.*
from temps FROM TEMPS
</select> </select>
<select id="selectTreeList" parameterType="pps.core.system.entity.SysDictionaryView" resultMap="BaseResultMap"> <select id="selectTreeList" parameterType="pps.core.system.entity.SysDictionaryView" resultMap="BaseResultMap">
with RECURSIVE temps as WITH RECURSIVE TEMPS AS
( (
select SELECT
sd.id,sd.pid,sd.dic_name,sd.short_name,sd.remark,sd.sort,sd.levels,sd.be_default,sd.be_has_children,sd.dic_type,sd.effect_time,sd.end_time,sd.create_name,sd.create_time,sd.modify_name,sd.modify_time,sd.alias,sd.dic_path,sd.dic_key SD.ID,SD.PID,SD.DIC_NAME,SD.SHORT_NAME,SD.REMARK,SD.SORT,SD.LEVELS,SD.BE_DEFAULT,SD.BE_HAS_CHILDREN,SD.DIC_TYPE,SD.EFFECT_TIME,SD.END_TIME,SD.CREATE_NAME,SD.CREATE_TIME,SD.MODIFY_NAME,SD.MODIFY_TIME,SD.ALIAS,SD.DIC_PATH,SD.DIC_KEY
from SYS_DICTIONARY sd FROM SYS_DICTIONARY SD
<where> <where>
<if test="dicKey != null and dicKey != ''"> <if test="dicKey != null and dicKey != ''">
and sd.dic_key like concat('%',#{dicKey},'%') AND SD.DIC_KEY LIKE CONCAT('%',#{dicKey},'%')
</if> </if>
<if test="dicName != null and dicName != ''"> <if test="dicName != null and dicName != ''">
and sd.dic_name like concat('%',#{dicName},'%') AND SD.DIC_NAME LIKE CONCAT('%',#{dicName},'%')
</if> </if>
</where> </where>
union UNION
select SELECT
sd.id,sd.pid,sd.dic_name,sd.short_name,sd.remark,sd.sort,sd.levels,sd.be_default,sd.be_has_children,sd.dic_type,sd.effect_time,sd.end_time,sd.create_name,sd.create_time,sd.modify_name,sd.modify_time,sd.alias,sd.dic_path,sd.dic_key SD.ID,SD.PID,SD.DIC_NAME,SD.SHORT_NAME,SD.REMARK,SD.SORT,SD.LEVELS,SD.BE_DEFAULT,SD.BE_HAS_CHILDREN,SD.DIC_TYPE,SD.EFFECT_TIME,SD.END_TIME,SD.CREATE_NAME,SD.CREATE_TIME,SD.MODIFY_NAME,SD.MODIFY_TIME,SD.ALIAS,SD.DIC_PATH,SD.DIC_KEY
from temps inner join SYS_DICTIONARY sd on temps.pid = sd.id FROM TEMPS INNER JOIN SYS_DICTIONARY SD ON TEMPS.PID = SD.ID
) )
select temps.* from temps SELECT TEMPS.* FROM TEMPS
</select> </select>
<select id="selectListByParam" resultMap="BaseResultMap" parameterType="pps.core.system.entity.SysDictionaryView"> <select id="selectListByParam" resultMap="BaseResultMap" parameterType="pps.core.system.entity.SysDictionaryView">
...@@ -310,18 +305,18 @@ ...@@ -310,18 +305,18 @@
SYS_DICTIONARY SYS_DICTIONARY
<where> <where>
<if test="pid != null and pid != ''"> <if test="pid != null and pid != ''">
and pid = #{pid} AND PID = #{pid}
</if> </if>
<if test="alias != null and alias != ''"> <if test="alias != null and alias != ''">
and pid = (SELECT AND PID = (SELECT
id ID
FROM FROM
SYS_DICTIONARY SYS_DICTIONARY
WHERE WHERE
alias = #{alias}) ALIAS = #{alias})
</if> </if>
</where> </where>
ORDER BY ORDER BY
sort SORT
</select> </select>
</mapper> </mapper>
...@@ -2,178 +2,176 @@ ...@@ -2,178 +2,176 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pps.core.system.mapper.SysMenuViewMapper"> <mapper namespace="pps.core.system.mapper.SysMenuViewMapper">
<resultMap id="BaseResultMap" type="pps.core.system.entity.SysMenuView"> <resultMap id="BaseResultMap" type="pps.core.system.entity.SysMenuView">
<id column="id" property="id" jdbcType="VARCHAR"/> <id column="ID" property="id" />
<result column="menu_name" property="menuName" jdbcType="VARCHAR"/> <result column="MENU_NAME" property="menuName" />
<result column="parent_menu_id" property="parentMenuId" jdbcType="VARCHAR"/> <result column="PARENT_MENU_ID" property="parentMenuId" />
<result column="is_visiable" property="isVisiable" jdbcType="INTEGER"/> <result column="IS_VISIABLE" property="isVisiable" />
<result column="is_has_scope" property="isHasScope" jdbcType="INTEGER"/> <result column="IS_HAS_SCOPE" property="isHasScope" />
<result column="sort" property="sort" jdbcType="INTEGER"/> <result column="SORT" property="sort" />
<result column="is_has_children" property="isHasChildren" jdbcType="INTEGER"/> <result column="IS_HAS_CHILDREN" property="isHasChildren" />
<result column="url" property="url" jdbcType="VARCHAR"/> <result column="URL" property="url" />
<result column="is_external" property="isExternal" jdbcType="INTEGER"/> <result column="IS_EXTERNAL" property="isExternal" />
<result column="create_by_id" property="createById" jdbcType="VARCHAR"/> <result column="CREATE_BY_ID" property="createById" />
<result column="create_by_name" property="createByName" jdbcType="VARCHAR"/> <result column="CREATE_BY_NAME" property="createByName" />
<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/> <result column="CREATE_TIME" property="createTime" />
<result column="modify_by_id" property="modifyById" jdbcType="VARCHAR"/> <result column="MODIFY_BY_ID" property="modifyById" />
<result column="modify_by_name" property="modifyByName" jdbcType="VARCHAR"/> <result column="MODIFY_BY_NAME" property="modifyByName" />
<result column="modify_time" property="modifyTime" jdbcType="TIMESTAMP"/> <result column="MODIFY_TIME" property="modifyTime" />
<result column="is_has_appear" property="isHasAppear" jdbcType="INTEGER"/> <result column="IS_HAS_APPEAR" property="isHasAppear" />
<result column="menu_type" property="menuType" jdbcType="VARCHAR"/> <result column="MENU_TYPE" property="menuType" />
<result column="media_type" property="mediaType" jdbcType="VARCHAR"/> <result column="MEDIA_TYPE" property="mediaType" />
<result column="level" property="level" jdbcType="VARCHAR"/> <result column="LEVEL" property="level" />
<result column="menu_describe" property="menuDescribe" jdbcType="VARCHAR"/> <result column="MENU_DESCRIBE" property="menuDescribe" />
<result column="show_children" property="showChildren" jdbcType="BOOLEAN"/> <result column="SHOW_CHILDREN" property="showChildren"/>
<result column="menu_pattern" property="menuPattern" jdbcType="VARCHAR"/> <result column="MENU_PATTERN" property="menuPattern" />
<result column="fill_conf_id" property="fillConfId" jdbcType="VARCHAR"/> <result column="FILL_CONF_ID" property="fillConfId" />
<result column="show_home" property="showHome" jdbcType="BOOLEAN"/> <result column="SHOW_HOME" property="showHome"/>
<result column="apply_scene" property="applyScene" jdbcType="INTEGER"/> <result column="APPLY_SCENE" property="applyScene" />
<result column="menu_icon" property="menuIcon" jdbcType="VARCHAR"/> <result column="MENU_ICON" property="menuIcon" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id ID
, ,
menu_name, MENU_NAME,
menu_pattern, MENU_PATTERN,
parent_menu_id, PARENT_MENU_ID,
is_visiable, IS_VISIABLE,
is_has_scope, IS_HAS_SCOPE,
sort, SORT,
is_has_children, IS_HAS_CHILDREN,
url, URL,
is_external, IS_EXTERNAL,
create_by_id, CREATE_BY_ID,
create_by_name, CREATE_BY_NAME,
create_time, CREATE_TIME,
modify_by_id, MODIFY_BY_ID,
modify_by_name, MODIFY_BY_NAME,
modify_time, MODIFY_TIME,
is_has_appear, IS_HAS_APPEAR,
menu_type, MENU_TYPE,
media_type, MEDIA_TYPE,
`level`, `LEVEL`,
menu_describe, MENU_DESCRIBE,
show_children, SHOW_CHILDREN,
apply_scene, APPLY_SCENE,
menu_icon MENU_ICON
</sql> </sql>
<update id="updateShowChildren" parameterType="pps.core.system.entity.SysMenuView"> <update id="updateShowChildren" parameterType="pps.core.system.entity.SysMenuView">
update SYS_MENU UPDATE SYS_MENU
set show_children=#{showChildren} SET SHOW_CHILDREN=#{showChildren}
</update> </update>
<select id="selectOne" parameterType="pps.core.system.entity.SysMenuView" resultMap="BaseResultMap"> <select id="selectOne" parameterType="pps.core.system.entity.SysMenuView" resultMap="BaseResultMap">
select SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from SYS_MENU FROM SYS_MENU
where WHERE
id=#{id} ID=#{id}
</select> </select>
<select id="selectList" parameterType="pps.core.system.entity.SysMenuView" resultMap="BaseResultMap"> <select id="selectList" parameterType="pps.core.system.entity.SysMenuView" resultMap="BaseResultMap">
select SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from SYS_MENU FROM SYS_MENU
where WHERE
id=#{id} ID=#{id}
</select> </select>
<select id="selectUserMenuList" parameterType="pps.core.system.entity.SysMenuView" <select id="selectUserMenuList" parameterType="pps.core.system.entity.SysMenuView"
resultType="pps.core.system.entity.SysMenuView"> resultType="pps.core.system.entity.SysMenuView">
select t3.id, SELECT T3.ID,
t3.menu_name, T3.MENU_NAME,
t3.menu_pattern, T3.MENU_PATTERN,
t3.parent_menu_id p_id, T3.PARENT_MENU_ID P_ID,
t3.is_visiable, T3.IS_VISIABLE,
t3.is_has_children, T3.IS_HAS_CHILDREN,
t3.url, T3.URL,
t3.sort, T3.SORT,
t3.menu_icon T3.MENU_ICON
from SYS_USER_ROLE_REL t1 FROM SYS_USER_ROLE_REL T1
left join SYS_ROLE_MENU_AUTH t2 on t1.role_id = t2.role_id LEFT JOIN SYS_ROLE_MENU_AUTH T2 ON T1.ROLE_ID = T2.ROLE_ID
left join SYS_MENU t3 on t2.menu_id = t3.id LEFT JOIN SYS_MENU T3 ON T2.MENU_ID = T3.ID
where t1.user_id = #{userId} WHERE T1.USER_ID = #{userId}
order by t3.sort asc ORDER BY T3.SORT ASC
</select> </select>
<select id="selectSysMenuList" parameterType="pps.core.system.entity.SysMenuView" resultMap="BaseResultMap"> <select id="selectSysMenuList" parameterType="pps.core.system.entity.SysMenuView" resultMap="BaseResultMap">
select SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from SYS_MENU FROM SYS_MENU
<where> <where>
<if test="menuName !=null and menuName!=''"> <if test="menuName !=null and menuName!=''">
AND menu_name like concat('%',#{menuName},'%') AND MENU_NAME like CONCAT('%',#{menuName},'%')
</if> </if>
<if test="applyScene !=null and applyScene!=''"> <if test="applyScene !=null and applyScene!=''">
AND apply_scene =#{applyScene} AND APPLY_SCENE =#{applyScene}
</if> </if>
</where> </where>
order by create_time desc ORDER BY CREATE_TIME DESC
</select> </select>
<select id="selectMaxSort" parameterType="String" resultType="pps.core.system.entity.SysMenuView"> <select id="selectMaxSort" parameterType="String" resultType="pps.core.system.entity.SysMenuView">
select max(sm.sort) as sort, SELECT MAX(SM.SORT) AS SORT,
sm.parent_menu_id SM.PARENT_MENU_ID
from SYS_MENU sm FROM SYS_MENU SM
where sm.parent_menu_id = #{parentMenuId} WHERE SM.PARENT_MENU_ID = #{parentMenuId}
group by sm.parent_menu_id limit 1 GROUP BY SM.PARENT_MENU_ID LIMIT 1
</select> </select>
<select id="selectSysMenuListByUserIdAndMediaType" parameterType="pps.core.system.entity.SysMenuView" <select id="selectSysMenuListByUserIdAndMediaType" parameterType="pps.core.system.entity.SysMenuView"
resultMap="BaseResultMap"> resultMap="BaseResultMap">
WITH RECURSIVE TEMPS AS
with RECURSIVE temps as (SELECT *
(select * FROM (SELECT ID,
from (select id, MENU_NAME,
menu_name, MENU_PATTERN,
menu_pattern, PARENT_MENU_ID,
parent_menu_id, MENU_TYPE,
menu_type, MEDIA_TYPE,
media_type, SORT,
sort, URL,
url, APPLY_SCENE,
apply_scene, MENU_DESCRIBE,
menu_describe, MENU_ICON
menu_icon FROM SYS_MENU SM
from SYS_MENU sm WHERE APPLY_SCENE = #{applyScene}
where apply_scene = #{applyScene} AND SM.ID IN (SELECT MENU_ID
and sm.id in (select menu_id FROM SYS_ROLE_MENU_AUTH SRMA
from SYS_ROLE_MENU_AUTH srma WHERE SRMA.ROLE_ID IN (SELECT ROLE_ID
where srma.role_id in (select role_id FROM SYS_USER_ROLE_REL SURR
from SYS_USER_ROLE_REL surr WHERE SURR.USER_ID = #{userId}))) A
where surr.user_id = #{userId}))) a WHERE MEDIA_TYPE LIKE CONCAT('%', #{mediaType}, '%')
where media_type like concat('%', #{mediaType}, '%') OR MEDIA_TYPE = 'ALL'
or media_type = 'ALL' UNION
union SELECT A.ID,
select a.id, A.MENU_NAME,
a.menu_name, A.MENU_PATTERN,
a.menu_pattern, A.PARENT_MENU_ID,
a.parent_menu_id, A.MENU_TYPE,
a.menu_type, A.MEDIA_TYPE,
a.media_type, A.SORT,
a.sort, A.URL,
a.url, A.APPLY_SCENE,
a.apply_scene, A.MENU_DESCRIBE,
a.menu_describe, A.MENU_ICON
a.menu_icon FROM TEMPS
from temps INNER JOIN SYS_MENU A ON TEMPS.PARENT_MENU_ID = A.ID)
inner join SYS_MENU a on temps.parent_menu_id = a.id) SELECT DISTINCT TEMPS.*
select distinct temps.* FROM TEMPS
from temps
</select> </select>
<select id="selectMediumTypeByUserId" parameterType="pps.core.system.entity.SysMenuView" resultMap="BaseResultMap"> <select id="selectMediumTypeByUserId" parameterType="pps.core.system.entity.SysMenuView" resultMap="BaseResultMap">
select 'GAS' as media_type SELECT 'GAS' AS MEDIA_TYPE
</select> </select>
<select id="selectParentMenus" parameterType="pps.core.system.entity.SysMenuView" resultMap="BaseResultMap"> <select id="selectParentMenus" parameterType="pps.core.system.entity.SysMenuView" resultMap="BaseResultMap">
select t.id, t.menu_name, t.parent_menu_id SELECT T.ID, T.MENU_NAME, T.PARENT_MENU_ID
from (with RECURSIVE temps as FROM (WITH RECURSIVE TEMPS AS
(select id, menu_name, parent_menu_id (SELECT ID, MENU_NAME, PARENT_MENU_ID
from SYS_MENU sm FROM SYS_MENU SM
where sm.id = #{id} WHERE SM.ID = #{id}
union UNION
select a.id, a.menu_name, a.parent_menu_id SELECT A.ID, A.MENU_NAME, A.PARENT_MENU_ID
from temps FROM TEMPS
inner join SYS_MENU a on temps.parent_menu_id = a.id) INNER JOIN SYS_MENU A ON TEMPS.PARENT_MENU_ID = A.ID)
select temps.* SELECT TEMPS.*
from temps) t FROM TEMPS) T
where t.id !=#{id} WHERE T.ID !=#{id}
</select> </select>
<select id="selectMenuForThreeLevelList" parameterType="pps.core.system.entity.SysMenuView" <select id="selectMenuForThreeLevelList" parameterType="pps.core.system.entity.SysMenuView"
......
...@@ -2,69 +2,69 @@ ...@@ -2,69 +2,69 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pps.core.system.mapper.SysOrganizationDictionaryViewMapper"> <mapper namespace="pps.core.system.mapper.SysOrganizationDictionaryViewMapper">
<resultMap id="BaseResultMap" type="pps.core.system.entity.SysOrganizationDictionaryView"> <resultMap id="BaseResultMap" type="pps.core.system.entity.SysOrganizationDictionaryView">
<id column="id" property="id" jdbcType="VARCHAR"/> <id column="ID" property="id" />
<result column="ou_id" property="ouId" jdbcType="VARCHAR"/> <result column="OU_ID" property="ouId" />
<result column="parent_dic_code" property="parentDicCode" jdbcType="VARCHAR"/> <result column="PARENT_DIC_CODE" property="parentDicCode" />
<result column="dic_code" property="dicCode" jdbcType="VARCHAR"/> <result column="DIC_CODE" property="dicCode" />
<result column="effect_time" property="effectTime" jdbcType="TIMESTAMP"/> <result column="EFFECT_TIME" property="effectTime" />
<result column="end_time" property="endTime" jdbcType="TIMESTAMP"/> <result column="END_TIME" property="endTime" />
<result column="create_by_id" property="createById" jdbcType="VARCHAR"/> <result column="CREATE_BY_ID" property="createById" />
<result column="create_by_name" property="createByName" jdbcType="VARCHAR"/> <result column="CREATE_BY_NAME" property="createByName" />
<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/> <result column="CREATE_TIME" property="createTime" />
<result column="modify_by_id" property="modifyById" jdbcType="VARCHAR"/> <result column="MODIFY_BY_ID" property="modifyById" />
<result column="modify_by_name" property="modifyByName" jdbcType="VARCHAR"/> <result column="MODIFY_BY_NAME" property="modifyByName" />
<result column="modify_time" property="modifyTime" jdbcType="TIMESTAMP"/> <result column="MODIFY_TIME" property="modifyTime" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id ID
, ,
ou_id, OU_ID,
parent_dic_code, PARENT_DIC_CODE,
dic_code, DIC_CODE,
effect_time, EFFECT_TIME,
end_time, END_TIME,
create_by_id, CREATE_BY_ID,
create_by_name, CREATE_BY_NAME,
create_time, CREATE_TIME,
modify_by_id, MODIFY_BY_ID,
modify_by_name, MODIFY_BY_NAME,
modify_time MODIFY_TIME
</sql> </sql>
<select id="selectOne" parameterType="pps.core.system.entity.SysOrganizationDictionaryView" <select id="selectOne" parameterType="pps.core.system.entity.SysOrganizationDictionaryView"
resultMap="BaseResultMap"> resultMap="BaseResultMap">
select SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from SYS_ORGANIZATION_DICTIONARY FROM SYS_ORGANIZATION_DICTIONARY
where WHERE
id=#{id} ID=#{id}
</select> </select>
<select id="selectList" parameterType="pps.core.system.entity.SysOrganizationDictionaryView" <select id="selectList" parameterType="pps.core.system.entity.SysOrganizationDictionaryView"
resultMap="BaseResultMap"> resultMap="BaseResultMap">
select SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from SYS_ORGANIZATION_DICTIONARY FROM SYS_ORGANIZATION_DICTIONARY
where WHERE
id=#{id} ID=#{id}
</select> </select>
<select id="selectListByOuId" parameterType="pps.core.system.entity.SysOrganizationDictionaryView" <select id="selectListByOuId" parameterType="pps.core.system.entity.SysOrganizationDictionaryView"
resultMap="BaseResultMap"> resultMap="BaseResultMap">
select SELECT
dic_code,parent_dic_code DIC_CODE,PARENT_DIC_CODE
from SYS_ORGANIZATION_DICTIONARY FROM SYS_ORGANIZATION_DICTIONARY
where end_time &gt; #{endTime} WHERE END_TIME &gt; #{endTime}
<if test="ouId != null and ouId !=''"> <if test="ouId != null and ouId !=''">
and ou_id=#{ouId} AND OU_ID=#{ouId}
</if> </if>
</select> </select>
<select id="selectListByDictionaryOuId" parameterType="pps.core.system.entity.SysOrganizationDictionaryView" <select id="selectListByDictionaryOuId" parameterType="pps.core.system.entity.SysOrganizationDictionaryView"
resultMap="BaseResultMap"> resultMap="BaseResultMap">
select a.dic_code, SELECT A.DIC_CODE,
a.parent_dic_code, A.PARENT_DIC_CODE,
b.dic_key, B.DIC_KEY,
b.dic_name B.DIC_NAME
from SYS_ORGANIZATION_DICTIONARY a FROM SYS_ORGANIZATION_DICTIONARY A
left join SYS_DICTIONARY b on b.id = a.dic_code LEFT JOIN SYS_DICTIONARY B ON B.ID = A.DIC_CODE
where a.end_time &gt; #{endTime} WHERE A.END_TIME &gt; #{endTime}
and a.ou_id = #{ouId} AND A.OU_ID = #{ouId}
</select> </select>
</mapper> </mapper>
...@@ -2,47 +2,47 @@ ...@@ -2,47 +2,47 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pps.core.system.mapper.SysOrganizationPropertyViewMapper"> <mapper namespace="pps.core.system.mapper.SysOrganizationPropertyViewMapper">
<resultMap id="BaseResultMap" type="pps.core.system.entity.SysOrganizationPropertyView"> <resultMap id="BaseResultMap" type="pps.core.system.entity.SysOrganizationPropertyView">
<id column="id" property="id" jdbcType="VARCHAR"/> <id column="ID" property="id" />
<result column="ou_id" property="ouId" jdbcType="VARCHAR"/> <result column="OU_ID" property="ouId" />
<result column="property_code" property="propertyCode" jdbcType="VARCHAR"/> <result column="PROPERTY_CODE" property="propertyCode" />
<result column="property_value" property="propertyValue" jdbcType="VARCHAR"/> <result column="PROPERTY_VALUE" property="propertyValue" />
<result column="effect_time" property="effectTime" jdbcType="TIMESTAMP"/> <result column="EFFECT_TIME" property="effectTime" />
<result column="end_time" property="endTime" jdbcType="TIMESTAMP"/> <result column="END_TIME" property="endTime" />
<result column="create_by_id" property="createById" jdbcType="VARCHAR"/> <result column="CREATE_BY_ID" property="createById" />
<result column="create_by_name" property="createByName" jdbcType="VARCHAR"/> <result column="CREATE_BY_NAME" property="createByName" />
<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/> <result column="CREATE_TIME" property="createTime" />
<result column="modify_by_id" property="modifyById" jdbcType="VARCHAR"/> <result column="MODIFY_BY_ID" property="modifyById" />
<result column="modify_by_name" property="modifyByName" jdbcType="VARCHAR"/> <result column="MODIFY_BY_NAME" property="modifyByName" />
<result column="modify_time" property="modifyTime" jdbcType="TIMESTAMP"/> <result column="MODIFY_TIME" property="modifyTime" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id ID
, ,
ou_id, OU_ID,
property_code, PROPERTY_CODE,
property_value, PROPERTY_VALUE,
effect_time, EFFECT_TIME,
end_time, END_TIME,
create_by_id, CREATE_BY_ID,
create_by_name, CREATE_BY_NAME,
create_time, CREATE_TIME,
modify_by_id, MODIFY_BY_ID,
modify_by_name, MODIFY_BY_NAME,
modify_time MODIFY_TIME
</sql> </sql>
<select id="selectOne" parameterType="pps.core.system.entity.SysOrganizationPropertyView" resultMap="BaseResultMap"> <select id="selectOne" parameterType="pps.core.system.entity.SysOrganizationPropertyView" resultMap="BaseResultMap">
select SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from SYS_ORGANIZATION_PROPERTY FROM SYS_ORGANIZATION_PROPERTY
where WHERE
id=#{id} ID=#{id}
</select> </select>
<select id="selectList" parameterType="pps.core.system.entity.SysOrganizationPropertyView" <select id="selectList" parameterType="pps.core.system.entity.SysOrganizationPropertyView"
resultMap="BaseResultMap"> resultMap="BaseResultMap">
select SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from SYS_ORGANIZATION_PROPERTY FROM SYS_ORGANIZATION_PROPERTY
where WHERE
ou_id=#{ouId} and end_time &gt;= #{endTime} OU_ID=#{ouId} AND END_TIME &gt;= #{endTime}
</select> </select>
</mapper> </mapper>
...@@ -2,75 +2,75 @@ ...@@ -2,75 +2,75 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pps.core.system.mapper.SysOrganizationRelViewMapper"> <mapper namespace="pps.core.system.mapper.SysOrganizationRelViewMapper">
<resultMap id="BaseResultMap" type="pps.core.system.entity.SysOrganizationRelView"> <resultMap id="BaseResultMap" type="pps.core.system.entity.SysOrganizationRelView">
<id column="id" property="id" jdbcType="VARCHAR"/> <id column="ID" property="id" />
<result column="ou_id" property="ouId" jdbcType="VARCHAR"/> <result column="OU_ID" property="ouId" />
<result column="parent_ou_id" property="parentOuId" jdbcType="VARCHAR"/> <result column="PARENT_OU_ID" property="parentOuId" />
<result column="levels" property="levels" jdbcType="INTEGER"/> <result column="LEVELS" property="levels" />
<result column="ou_id_path" property="ouIdPath" jdbcType="VARCHAR"/> <result column="OU_ID_PATH" property="ouIdPath" />
<result column="is_has_children" property="isHasChildren" jdbcType="INTEGER"/> <result column="IS_HAS_CHILDREN" property="isHasChildren" />
<result column="effect_time" property="effectTime" jdbcType="TIMESTAMP"/> <result column="EFFECT_TIME" property="effectTime" />
<result column="end_time" property="endTime" jdbcType="TIMESTAMP"/> <result column="END_TIME" property="endTime" />
<result column="sort" property="sort" jdbcType="INTEGER"/> <result column="SORT" property="sort" />
<result column="create_by_id" property="createById" jdbcType="VARCHAR"/> <result column="CREATE_BY_ID" property="createById" />
<result column="create_by_name" property="createByName" jdbcType="VARCHAR"/> <result column="CREATE_BY_NAME" property="createByName" />
<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/> <result column="CREATE_TIME" property="createTime" />
<result column="modify_by_id" property="modifyById" jdbcType="VARCHAR"/> <result column="MODIFY_BY_ID" property="modifyById" />
<result column="modify_by_name" property="modifyByName" jdbcType="VARCHAR"/> <result column="MODIFY_BY_NAME" property="modifyByName" />
<result column="modify_time" property="modifyTime" jdbcType="TIMESTAMP"/> <result column="MODIFY_TIME" property="modifyTime" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id ID
, ,
ou_id, OU_ID,
parent_ou_id, PARENT_OU_ID,
levels, LEVELS,
ou_id_path, OU_ID_PATH,
is_has_children, IS_HAS_CHILDREN,
effect_time, EFFECT_TIME,
end_time, END_TIME,
sort, SORT,
create_by_id, CREATE_BY_ID,
create_by_name, CREATE_BY_NAME,
create_time, CREATE_TIME,
modify_by_id, MODIFY_BY_ID,
modify_by_name, MODIFY_BY_NAME,
modify_time MODIFY_TIME
</sql> </sql>
<select id="selectOne" parameterType="pps.core.system.entity.SysOrganizationRelView" resultMap="BaseResultMap"> <select id="selectOne" parameterType="pps.core.system.entity.SysOrganizationRelView" resultMap="BaseResultMap">
select SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from SYS_ORGANIZATION_REL FROM SYS_ORGANIZATION_REL
where WHERE
id=#{id} ID=#{id}
</select> </select>
<select id="selectList" parameterType="pps.core.system.entity.SysOrganizationRelView" resultMap="BaseResultMap"> <select id="selectList" parameterType="pps.core.system.entity.SysOrganizationRelView" resultMap="BaseResultMap">
select SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from SYS_ORGANIZATION_REL FROM SYS_ORGANIZATION_REL
where WHERE
id=#{id} ID=#{id}
</select> </select>
<select id="selectEffective" resultMap="BaseResultMap"> <select id="selectEffective" resultMap="BaseResultMap">
select SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from SYS_ORGANIZATION_REL FROM SYS_ORGANIZATION_REL
where effect_time &lt;= now() and end_time &gt;= now() WHERE EFFECT_TIME &lt;= now() AND END_TIME &gt;= now()
</select> </select>
<select id="selectMaxSort" parameterType="String" resultType="pps.core.system.entity.SysOrganizationRelView"> <select id="selectMaxSort" parameterType="String" resultType="pps.core.system.entity.SysOrganizationRelView">
select max(sor.sort) as sort, SELECT MAX(SOR.SORT) AS SORT,
sor.parent_ou_id SOR.PARENT_OU_ID
from SYS_ORGANIZATION_REL sor FROM SYS_ORGANIZATION_REL SOR
where sor.parent_ou_id = #{parentOuId} WHERE SOR.PARENT_OU_ID = #{parentOuId}
and sor.effect_time &lt;= now() AND SOR.EFFECT_TIME &lt;= NOW()
and sor.end_time &gt;= now() AND SOR.END_TIME &gt;= NOW()
group by sor.parent_ou_id limit 1 GROUP BY SOR.PARENT_OU_ID LIMIT 1
</select> </select>
<select id="selectListByOuId" parameterType="String" resultMap="BaseResultMap"> <select id="selectListByOuId" parameterType="String" resultMap="BaseResultMap">
select sor.* SELECT SOR.*
from SYS_ORGANIZATION_REL sor FROM SYS_ORGANIZATION_REL SOR
left join SYS_ORGANIZATION_REL sor2 on sor.parent_ou_id = sor2.ou_id LEFT JOIN SYS_ORGANIZATION_REL SOR2 ON SOR.PARENT_OU_ID = SOR2.OU_ID
where sor2.parent_ou_id = #{ouId} WHERE SOR2.PARENT_OU_ID = #{ouId}
</select> </select>
</mapper> </mapper>
...@@ -2,723 +2,701 @@ ...@@ -2,723 +2,701 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pps.core.system.mapper.SysOrganizationViewMapper"> <mapper namespace="pps.core.system.mapper.SysOrganizationViewMapper">
<resultMap id="BaseResultMap" type="pps.core.system.entity.SysOrganizationView"> <resultMap id="BaseResultMap" type="pps.core.system.entity.SysOrganizationView">
<id column="id" property="id" jdbcType="VARCHAR"/> <id column="ID" property="id"/>
<result column="ou_code" property="ouCode" jdbcType="VARCHAR"/> <result column="OU_CODE" property="ouCode"/>
<result column="ou_name" property="ouName" jdbcType="VARCHAR"/> <result column="OU_NAME" property="ouName"/>
<result column="short_name" property="shortName" jdbcType="VARCHAR"/> <result column="SHORT_NAME" property="shortName"/>
<result column="ou_level" property="ouLevel" jdbcType="VARCHAR"/> <result column="OU_LEVEL" property="ouLevel"/>
<result column="description" property="description" jdbcType="VARCHAR"/> <result column="DESCRIPTION" property="description"/>
<result column="create_by_id" property="createById" jdbcType="VARCHAR"/> <result column="CREATE_BY_ID" property="createById"/>
<result column="create_by_name" property="createByName" jdbcType="VARCHAR"/> <result column="CREATE_BY_NAME" property="createByName"/>
<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/> <result column="CREATE_TIME" property="createTime"/>
<result column="modify_by_id" property="modifyById" jdbcType="VARCHAR"/> <result column="MODIFY_BY_ID" property="modifyById"/>
<result column="modify_by_name" property="modifyByName" jdbcType="VARCHAR"/> <result column="MODIFY_BY_NAME" property="modifyByName"/>
<result column="modify_time" property="modifyTime" jdbcType="TIMESTAMP"/> <result column="MODIFY_TIME" property="modifyTime"/>
<result column="end_time" property="endTime" jdbcType="TIMESTAMP"/> <result column="END_TIME" property="endTime"/>
<result column="post_code" property="postCode" jdbcType="VARCHAR"/> <result column="POST_CODE" property="postCode"/>
<result column="post_address" property="postAddress" jdbcType="VARCHAR"/> <result column="POST_ADDRESS" property="postAddress"/>
<result column="fax_no" property="faxNo" jdbcType="VARCHAR"/> <result column="FAX_NO" property="faxNo"/>
<result column="phone" property="phone" jdbcType="VARCHAR"/> <result column="PHONE" property="phone"/>
<result column="country" property="country" jdbcType="VARCHAR"/> <result column="COUNTRY" property="country"/>
<result column="province" property="province" jdbcType="INTEGER"/> <result column="PROVINCE" property="province"/>
<result column="partent_name" property="partentName" jdbcType="VARCHAR"/> <result column="PARTENT_NAME" property="partentName"/>
<result column="sor_id" property="sorId" jdbcType="VARCHAR"/> <result column="SOR_ID" property="sorId"/>
<result column="level_dic_name" property="levelDicName" jdbcType="VARCHAR"/> <result column="LEVEL_DIC_NAME" property="levelDicName"/>
<result column="country_name" property="countryName" jdbcType="VARCHAR"/> <result column="COUNTRY_NAME" property="countryName"/>
<result column="province_name" property="provinceName" jdbcType="VARCHAR"/> <result column="PROVINCE_NAME" property="provinceName"/>
<result column="property_name" property="propertyName" jdbcType="VARCHAR"/> <result column="PROPERTY_NAME" property="propertyName"/>
<result column="parent_ou_id" property="parentOuId" jdbcType="VARCHAR"/> <result column="PARENT_OU_ID" property="parentOuId"/>
<result column="media_type" property="mediaType" jdbcType="VARCHAR"/> <result column="MEDIA_TYPE" property="mediaType"/>
<result column="is_has_children" property="isHasChildren" jdbcType="INTEGER"/> <result column="IS_HAS_CHILDREN" property="isHasChildren"/>
<result column="is_deleted" property="isDeleted" jdbcType="INTEGER"/> <result column="IS_DELETED" property="isDeleted"/>
<result column="type" property="type" jdbcType="VARCHAR"/> <result column="TYPE" property="type"/>
<result column="longitude" property="longitude" jdbcType="DECIMAL"/> <result column="LONGITUDE" property="longitude" />
<result column="latitude" property="latitude" jdbcType="DECIMAL"/> <result column="LATITUDE" property="latitude" />
<result column="elevation" property="elevation" jdbcType="DECIMAL"/> <result column="ELEVATION" property="elevation" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id ID
, ,
ou_code, OU_CODE,
ou_name, OU_NAME,
short_name, SHORT_NAME,
ou_level, OU_LEVEL,
description, DESCRIPTION,
create_by_id, CREATE_BY_ID,
create_by_name, CREATE_BY_NAME,
create_time, CREATE_TIME,
modify_by_id, MODIFY_BY_ID,
modify_by_name, MODIFY_BY_NAME,
modify_time, MODIFY_TIME,
post_code, POST_CODE,
post_address, POST_ADDRESS,
fax_no, FAX_NO,
phone, PHONE,
country, COUNTRY,
province, PROVINCE,
is_deleted IS_DELETED
</sql> </sql>
<select id="selectOne" parameterType="pps.core.system.entity.SysOrganizationView" resultMap="BaseResultMap"> <select id="selectOne" parameterType="pps.core.system.entity.SysOrganizationView" resultMap="BaseResultMap">
select SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from SYS_ORGANIZATION FROM SYS_ORGANIZATION
where WHERE
id=#{id} ID=#{id}
</select> </select>
<select id="selectList" parameterType="pps.core.system.entity.SysOrganizationView" resultMap="BaseResultMap"> <select id="selectList" parameterType="pps.core.system.entity.SysOrganizationView" resultMap="BaseResultMap">
select SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from SYS_ORGANIZATION FROM SYS_ORGANIZATION
where WHERE
id=#{id} ID=#{id}
</select> </select>
<select id="selectEffective" resultMap="BaseResultMap"> <select id="selectEffective" resultMap="BaseResultMap">
select SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from SYS_ORGANIZATION FROM SYS_ORGANIZATION
where is_deleted =1 WHERE IS_DELETED =1
</select> </select>
<select id="selectSysOrganizationList" parameterType="pps.core.system.entity.SysOrganizationView" <select id="selectSysOrganizationList" parameterType="pps.core.system.entity.SysOrganizationView"
resultMap="BaseResultMap"> resultMap="BaseResultMap">
SELECT SELECT
ou.id, OU.ID,
ou.ou_code, OU.OU_CODE,
ou.ou_name, OU.OU_NAME,
ou.short_name, OU.SHORT_NAME,
ou.ou_level, OU.OU_LEVEL,
ou.description, OU.DESCRIPTION,
ou.post_code, OU.POST_CODE,
ou.post_address, OU.POST_ADDRESS,
ou.fax_no, OU.FAX_NO,
ou.phone, OU.PHONE,
ou.country, OU.COUNTRY,
ou.province, OU.PROVINCE,
sor.id AS sor_id, SOR.ID AS SOR_ID,
sor.sort, SOR.SORT,
sor.parent_ou_id, SOR.PARENT_OU_ID,
sor.is_has_children, SOR.IS_HAS_CHILDREN,
ou.longitude, OU.LONGITUDE,
ou.latitude, OU.LATITUDE,
ou.elevation, OU.ELEVATION,
( SELECT so.ou_name FROM SYS_ORGANIZATION so WHERE sor.parent_ou_id = so.id ) AS partent_name ( SELECT SO.OU_NAME FROM SYS_ORGANIZATION SO WHERE SOR.PARENT_OU_ID = SO.ID ) AS PARTENT_NAME
FROM FROM
SYS_ORGANIZATION_REL sor SYS_ORGANIZATION_REL SOR
LEFT JOIN SYS_ORGANIZATION ou ON ou.id = sor.ou_id LEFT JOIN SYS_ORGANIZATION OU ON OU.ID = SOR.OU_ID
<where> <where>
sor.end_time >= NOW() SOR.END_TIME >= NOW()
and ou.is_deleted = #{isDeleted} AND OU.IS_DELETED = #{isDeleted}
<if test="id != null and id != ''"> <if test="id != null and id != ''">
and sor.parent_ou_id = #{id} AND SOR.PARENT_OU_ID = #{id}
</if> </if>
<if test="ouCode != null and ouCode != ''"> <if test="ouCode != null and ouCode != ''">
AND ou.ou_code like concat('%',#{ouCode},'%') AND OU.OU_CODE LIKE CONCAT('%',#{ouCode},'%')
</if> </if>
<if test="ouName != null and ouName != ''"> <if test="ouName != null and ouName != ''">
AND ou.ou_name like concat('%',#{ouName},'%') AND OU.OU_NAME LIKE CONCAT('%',#{ouName},'%')
</if> </if>
<if test="shortName != null and shortName != ''"> <if test="shortName != null and shortName != ''">
AND ou.short_name like concat('%',#{shortName},'%') AND OU.SHORT_NAME LIKE CONCAT('%',#{shortName},'%')
</if> </if>
</where> </where>
order by sor.sort asc ORDER BY SOR.SORT ASC
</select> </select>
<select id="selectOrganizationEffective" parameterType="pps.core.system.entity.SysOrganizationView" <select id="selectOrganizationEffective" parameterType="pps.core.system.entity.SysOrganizationView"
resultMap="BaseResultMap"> resultMap="BaseResultMap">
select so.id, SELECT SO.ID,
ou_code, OU_CODE,
ou_name, OU_NAME,
short_name, SHORT_NAME,
sor.sort, SOR.SORT,
sor.parent_ou_id SOR.PARENT_OU_ID
from SYS_ORGANIZATION so FROM SYS_ORGANIZATION SO
left join SYS_ORGANIZATION_REL sor on sor.ou_id = so.id LEFT JOIN SYS_ORGANIZATION_REL SOR ON SOR.OU_ID = SO.ID
where so.is_deleted = #{isDeleted} WHERE SO.IS_DELETED = #{isDeleted}
and sor.effect_time &lt;= #{endTime} AND SOR.EFFECT_TIME &lt;= #{endTime}
and sor.end_time &gt;= #{endTime} AND SOR.END_TIME &gt;= #{endTime}
</select> </select>
<select id="selectOrganizationEffectiveByOuName" parameterType="pps.core.system.entity.SysOrganizationView" <select id="selectOrganizationEffectiveByOuName" parameterType="pps.core.system.entity.SysOrganizationView"
resultMap="BaseResultMap"> resultMap="BaseResultMap">
select so.id, SELECT SO.ID,
ou_code, OU_CODE,
ou_name, OU_NAME,
short_name, SHORT_NAME,
sor.sort, SOR.SORT,
sor.parent_ou_id SOR.PARENT_OU_ID
from SYS_ORGANIZATION so FROM SYS_ORGANIZATION SO
left join SYS_ORGANIZATION_REL sor on sor.ou_id = so.id LEFT JOIN SYS_ORGANIZATION_REL SOR ON SOR.OU_ID = SO.ID
where so.is_deleted = #{isDeleted} WHERE SO.IS_DELETED = #{isDeleted}
and so.ou_name = #{ouName} AND SO.OU_NAME = #{ouName}
and sor.effect_time &lt;= #{endTime} AND SOR.EFFECT_TIME &lt;= #{endTime}
and sor.end_time &gt;= #{endTime} AND SOR.END_TIME &gt;= #{endTime}
</select> </select>
<select id="selectOuSonByParentOuId" parameterType="pps.core.system.entity.SysOrganizationView" <select id="selectOuSonByParentOuId" parameterType="pps.core.system.entity.SysOrganizationView"
resultMap="BaseResultMap"> resultMap="BaseResultMap">
select SELECT
so.id, SO.ID,
ou_code, OU_CODE,
ou_name, OU_NAME,
short_name, SHORT_NAME,
sor.sort, SOR.SORT,
sor.parent_ou_id, SOR.PARENT_OU_ID,
so.ou_level, SO.OU_LEVEL,
'ou' as type 'ou' AS TYPE
from SYS_ORGANIZATION so FROM SYS_ORGANIZATION SO
left join SYS_ORGANIZATION_REL sor on sor.ou_id = so.id LEFT JOIN SYS_ORGANIZATION_REL SOR ON SOR.OU_ID = SO.ID
where so.is_deleted = #{isDeleted} and sor.end_time >= NOW() WHERE SO.IS_DELETED = #{isDeleted} AND SOR.END_TIME >= NOW()
<if test="parentOuId != null and parentOuId != ''"> <if test="parentOuId != null and parentOuId != ''">
and parent_ou_id =#{parentOuId} AND PARENT_OU_ID =#{parentOuId}
</if> </if>
order by sor.sort ORDER BY SOR.SORT
</select> </select>
<select id="selectOrganizationByParentOuIdOrOuId" parameterType="pps.core.system.entity.SysOrganizationView" <select id="selectOrganizationByParentOuIdOrOuId" parameterType="pps.core.system.entity.SysOrganizationView"
resultMap="BaseResultMap"> resultMap="BaseResultMap">
select SELECT
so.id, SO.ID,
ou_code, OU_CODE,
ou_name, OU_NAME,
short_name, SHORT_NAME,
sor.sort, SOR.SORT,
sor.parent_ou_id SOR.PARENT_OU_ID
from SYS_ORGANIZATION so FROM SYS_ORGANIZATION SO
left join SYS_ORGANIZATION_REL sor on sor.ou_id = so.id LEFT JOIN SYS_ORGANIZATION_REL SOR ON SOR.OU_ID = SO.ID
<where> <where>
so.is_deleted = #{isDeleted} SO.IS_DELETED = #{isDeleted}
and sor.effect_time &lt;= now() and sor.end_time &gt;= now() AND SOR.EFFECT_TIME &lt;= NOW() AND SOR.END_TIME &gt;= NOW()
and sor.parent_ou_id=#{id} AND SOR.PARENT_OU_ID=#{id}
or so.id=#{id} OR SO.ID=#{id}
</where> </where>
</select> </select>
<select id="selectOrganizationByParentOuId" parameterType="pps.core.system.entity.SysOrganizationView" <select id="selectOrganizationByParentOuId" parameterType="pps.core.system.entity.SysOrganizationView"
resultMap="BaseResultMap"> resultMap="BaseResultMap">
select SELECT
so.id, SO.ID,
ou_code, OU_CODE,
ou_name, OU_NAME,
short_name, SHORT_NAME,
sor.sort, SOR.SORT,
sor.parent_ou_id SOR.PARENT_OU_ID
from SYS_ORGANIZATION so FROM SYS_ORGANIZATION SO
left join SYS_ORGANIZATION_REL sor on sor.ou_id = so.id LEFT JOIN SYS_ORGANIZATION_REL SOR ON SOR.OU_ID = SO.ID
<where> <where>
so.is_deleted = #{isDeleted} SO.IS_DELETED = #{isDeleted}
and sor.effect_time &lt;= now() and sor.end_time &gt;= now() AND SOR.EFFECT_TIME &lt;= NOW() AND SOR.END_TIME &gt;= NOW()
and sor.parent_ou_id=#{id} AND SOR.PARENT_OU_ID=#{id}
</where> </where>
</select> </select>
<select id="selectAllListByOuId" parameterType="pps.core.system.entity.SysOrganizationView" <select id="selectAllListByOuId" parameterType="pps.core.system.entity.SysOrganizationView"
resultMap="BaseResultMap"> resultMap="BaseResultMap">
select s.id, SELECT S.ID,
r.parent_ou_id, R.PARENT_OU_ID,
s.ou_name, S.OU_NAME,
s.short_name, S.SHORT_NAME,
s.longitude, S.LONGITUDE,
s.latitude S.LATITUDE
from SYS_ORGANIZATION_REL r FROM SYS_ORGANIZATION_REL R
left join SYS_ORGANIZATION s on r.ou_id = s.id LEFT JOIN SYS_ORGANIZATION S ON R.OU_ID = S.ID
where s.is_deleted = #{isDeleted} WHERE S.IS_DELETED = #{isDeleted}
and (r.ou_id = #{id} or r.ou_id_path like concat('%',#{id},'%')) AND (R.OU_ID = #{id} OR R.OU_ID_PATH LIKE CONCAT('%',#{id},'%'))
<if test="ouLevel != null and ouLevel !=''"> <if test="ouLevel != null and ouLevel !=''">
and s.ou_level = #{ouLevel} AND S.OU_LEVEL = #{ouLevel}
</if> </if>
order by s.create_time ORDER BY S.CREATE_TIME
</select> </select>
<select id="selectListByOuIds" parameterType="java.util.List" resultMap="BaseResultMap"> <select id="selectListByOuIds" parameterType="java.util.List" resultMap="BaseResultMap">
select r.ou_id as id,r.parent_ou_id,s.ou_name,s.short_name from SYS_ORGANIZATION_REL r SELECT R.OU_ID AS ID,R.PARENT_OU_ID,S.OU_NAME,S.SHORT_NAME FROM SYS_ORGANIZATION_REL R
left join SYS_ORGANIZATION s on r.ou_id = s.id LEFT JOIN SYS_ORGANIZATION S ON R.OU_ID = S.ID
where s.is_deleted = 1 WHERE S.IS_DELETED = 1
AND r.effect_time &lt;= now() AND r.end_time &gt;= now() AND R.EFFECT_TIME &lt;= NOW() AND R.END_TIME &gt;= NOW()
and r.ou_id in AND R.OU_ID IN
<foreach collection="list" open="(" close=")" separator="," item="item"> <foreach collection="list" open="(" close=")" separator="," item="item">
#{item} #{item}
</foreach> </foreach>
order by s.create_time ORDER BY S.CREATE_TIME
</select> </select>
<select id="selectCountByParentOuIds" parameterType="pps.core.system.entity.SysOrganizationView" <select id="selectCountByParentOuIds" parameterType="pps.core.system.entity.SysOrganizationView"
resultMap="BaseResultMap"> resultMap="BaseResultMap">
select SELECT
count(so.id) as id, COUNT(SO.ID) AS ID,
sor.parent_ou_id SOR.PARENT_OU_ID
from SYS_ORGANIZATION so FROM SYS_ORGANIZATION SO
left join SYS_ORGANIZATION_REL sor on sor.ou_id = so.id LEFT JOIN SYS_ORGANIZATION_REL SOR ON SOR.OU_ID = SO.ID
where so.is_deleted = 1 WHERE SO.IS_DELETED = 1
and sor.parent_ou_id in AND SOR.PARENT_OU_ID IN
<foreach collection="list" open="(" close=")" separator="," item="item"> <foreach collection="list" open="(" close=")" separator="," item="item">
#{item} #{item}
</foreach> </foreach>
group by sor.parent_ou_id GROUP BY SOR.PARENT_OU_ID
</select> </select>
<select id="getSysOrganizationByOuLevelAndOuId" parameterType="pps.core.system.entity.SysOrganizationView" <select id="getSysOrganizationByOuLevelAndOuId" parameterType="pps.core.system.entity.SysOrganizationView"
resultType="pps.core.system.entity.SysOrganizationView"> resultType="pps.core.system.entity.SysOrganizationView">
WITH RECURSIVE TEMPS AS
with RECURSIVE temps as
( (
select so.ou_level ,so.id,so.ou_name ,sor.ou_id ,sor.parent_ou_id ,sor.ou_id_path ,sor.sort from SELECT SO.OU_LEVEL ,SO.ID,SO.OU_NAME ,SOR.OU_ID ,SOR.PARENT_OU_ID ,SOR.OU_ID_PATH ,SOR.SORT FROM
SYS_ORGANIZATION so SYS_ORGANIZATION SO
left join SYS_ORGANIZATION_REL sor on sor.ou_id=so.id and so.is_deleted =1 LEFT JOIN SYS_ORGANIZATION_REL SOR ON SOR.OU_ID=SO.ID AND SO.IS_DELETED =1
where so.id=#{id} and sor.effect_time &lt;= #{endTime} and sor.end_time &gt;= #{endTime} and so.is_deleted =1 WHERE SO.ID=#{id} AND SOR.EFFECT_TIME &lt;= #{endTime} AND SOR.END_TIME &gt;= #{endTime} AND SO.IS_DELETED =1
UNION
union SELECT A.OU_LEVEL,A.ID,A.OU_NAME ,A.OU_ID ,A.PARENT_OU_ID ,A.OU_ID_PATH ,A.SORT
FROM TEMPS INNER JOIN (
select a.ou_level,a.id,a.ou_name ,a.ou_id ,a.parent_ou_id ,a.ou_id_path ,a.sort SELECT SO.OU_LEVEL ,SO.ID,SO.OU_NAME ,TT.OU_ID ,TT.PARENT_OU_ID ,TT.OU_ID_PATH ,TT.SORT FROM(
from temps inner join ( SELECT SOR.OU_ID ,SOR.PARENT_OU_ID ,SOR.OU_ID_PATH ,SOR.SORT FROM SYS_ORGANIZATION_REL SOR
WHERE SOR.EFFECT_TIME &lt;= #{endTime} AND SOR.END_TIME &gt;= #{endTime}
select so.ou_level ,so.id,so.ou_name ,tt.ou_id ,tt.parent_ou_id ,tt.ou_id_path ,tt.sort from( )TT
select sor.ou_id ,sor.parent_ou_id ,sor.ou_id_path ,sor.sort from SYS_ORGANIZATION_REL sor LEFT JOIN SYS_ORGANIZATION SO ON TT.OU_ID=SO.ID AND SO.IS_DELETED =1
where sor.effect_time &lt;= #{endTime} and sor.end_time &gt;= #{endTime} ) A ON TEMPS.PARENT_OU_ID = A.ID
)tt
left join SYS_ORGANIZATION so on tt.ou_id=so.id and so.is_deleted =1
) a on temps.parent_ou_id = a.id
) )
select temps.* from temps SELECT TEMPS.* FROM TEMPS
<where> <where>
<if test="ouLevel != null and ouLevel !=''"> <if test="ouLevel != null and ouLevel !=''">
and ou_level=#{ouLevel} AND OU_LEVEL=#{ouLevel}
</if> </if>
</where> </where>
limit 1 LIMIT 1
</select> </select>
<select id="getSysOrganizationByOuLevelAndUserId" parameterType="pps.core.system.entity.SysOrganizationView" <select id="getSysOrganizationByOuLevelAndUserId" parameterType="pps.core.system.entity.SysOrganizationView"
resultType="pps.core.system.entity.SysOrganizationView"> resultType="pps.core.system.entity.SysOrganizationView">
WITH RECURSIVE TEMPS AS
with RECURSIVE temps as
( (
select so.ou_level ,so.id,so.ou_name ,tt.ou_id ,tt.parent_ou_id ,tt.ou_id_path ,tt.sort from( SELECT SO.OU_LEVEL ,SO.ID,SO.OU_NAME ,TT.OU_ID ,TT.PARENT_OU_ID ,TT.OU_ID_PATH ,TT.SORT FROM(
select sor.ou_id ,sor.parent_ou_id ,sor.ou_id_path ,sor.sort from SYS_ORGANIZATION_REL sor where sor.effect_time SELECT SOR.OU_ID ,SOR.PARENT_OU_ID ,SOR.OU_ID_PATH ,SOR.SORT FROM SYS_ORGANIZATION_REL SOR WHERE SOR.EFFECT_TIME
&lt;= #{endTime} and sor.end_time &gt;= #{endTime} and ou_id = &lt;= #{endTime} AND SOR.END_TIME &gt;= #{endTime} AND OU_ID =
(select ou_id from SYS_USER_ORGANIZATION_REL suor (SELECT OU_ID FROM SYS_USER_ORGANIZATION_REL SUOR
where suor.user_id = #{userId} WHERE SUOR.USER_ID = #{userId}
and suor.effect_time &lt;= #{endTime} and suor.end_time &gt;= #{endTime}) AND SUOR.EFFECT_TIME &lt;= #{endTime} AND SUOR.END_TIME &gt;= #{endTime})
)tt )TT
left join SYS_ORGANIZATION so on tt.ou_id=so.id and so.is_deleted =1 LEFT JOIN SYS_ORGANIZATION SO ON TT.OU_ID=SO.ID AND SO.IS_DELETED =1
UNION
union SELECT A.OU_LEVEL,A.ID,A.OU_NAME ,A.OU_ID ,A.PARENT_OU_ID ,A.OU_ID_PATH ,A.SORT
FROM TEMPS INNER JOIN (
select a.ou_level,a.id,a.ou_name ,a.ou_id ,a.parent_ou_id ,a.ou_id_path ,a.sort SELECT SO.OU_LEVEL ,SO.ID,SO.OU_NAME ,TT.OU_ID ,TT.PARENT_OU_ID ,TT.OU_ID_PATH ,TT.SORT FROM(
from temps inner join ( SELECT SOR.OU_ID ,SOR.PARENT_OU_ID ,SOR.OU_ID_PATH ,SOR.SORT FROM SYS_ORGANIZATION_REL SOR
WHERE SOR.EFFECT_TIME &lt;= #{endTime} AND SOR.END_TIME &gt;= #{endTime}
select so.ou_level ,so.id,so.ou_name ,tt.ou_id ,tt.parent_ou_id ,tt.ou_id_path ,tt.sort from( )TT
select sor.ou_id ,sor.parent_ou_id ,sor.ou_id_path ,sor.sort from SYS_ORGANIZATION_REL sor LEFT JOIN SYS_ORGANIZATION SO ON TT.OU_ID=SO.ID AND SO.IS_DELETED =1
where sor.effect_time &lt;= #{endTime} and sor.end_time &gt;= #{endTime} ) A ON TEMPS.PARENT_OU_ID = A.ID
)tt
left join SYS_ORGANIZATION so on tt.ou_id=so.id and so.is_deleted =1
) a on temps.parent_ou_id = a.id
) )
select temps.* from temps SELECT TEMPS.* FROM TEMPS
<where> <where>
<if test="ouLevel != null and ouLevel !=''"> <if test="ouLevel != null and ouLevel !=''">
and ou_level=#{ouLevel} AND OU_LEVEL=#{ouLevel}
</if> </if>
</where> </where>
limit 1 LIMIT 1
</select> </select>
<select id="getSysOrganizationListByOuLevelAndUserId" parameterType="pps.core.system.entity.SysOrganizationView" <select id="getSysOrganizationListByOuLevelAndUserId" parameterType="pps.core.system.entity.SysOrganizationView"
resultType="pps.core.system.entity.SysOrganizationView"> resultType="pps.core.system.entity.SysOrganizationView">
WITH RECURSIVE TEMPS AS
with RECURSIVE temps as
( (
select so.ou_level ,so.id,so.ou_name ,tt.ou_id ,tt.parent_ou_id ,tt.ou_id_path ,tt.sort from( SELECT SO.OU_LEVEL ,SO.ID,SO.OU_NAME ,TT.OU_ID ,TT.PARENT_OU_ID ,TT.OU_ID_PATH ,TT.SORT FROM(
select sor.ou_id ,sor.parent_ou_id ,sor.ou_id_path ,sor.sort from SYS_ORGANIZATION_REL sor SELECT SOR.OU_ID ,SOR.PARENT_OU_ID ,SOR.OU_ID_PATH ,SOR.SORT FROM SYS_ORGANIZATION_REL SOR
where WHERE
sor.effect_time &lt;= #{endTime} and sor.end_time >= #{endTime} and SOR.EFFECT_TIME &lt;= #{endTime} AND SOR.END_TIME >= #{endTime} AND
ou_id = OU_ID =
(select ou_id from SYS_USER_ORGANIZATION_REL suor (SELECT OU_ID FROM SYS_USER_ORGANIZATION_REL SUOR
where suor.user_id = #{userId} WHERE SUOR.USER_ID = #{userId}
and suor.effect_time &lt;= #{endTime} and suor.end_time >= #{endTime} AND SUOR.EFFECT_TIME &lt;= #{endTime} AND SUOR.END_TIME >= #{endTime}
) )
)tt )TT
left join SYS_ORGANIZATION so on tt.ou_id=so.id LEFT JOIN SYS_ORGANIZATION SO ON TT.OU_ID=SO.ID
and so.is_deleted =1 AND SO.IS_DELETED =1
UNION
union SELECT A.OU_LEVEL,A.ID,A.OU_NAME ,A.OU_ID ,A.PARENT_OU_ID ,A.OU_ID_PATH ,A.SORT
FROM (
select a.ou_level,a.id,a.ou_name ,a.ou_id ,a.parent_ou_id ,a.ou_id_path ,a.sort SELECT SO.OU_LEVEL ,SO.ID,SO.OU_NAME ,TT.OU_ID ,TT.PARENT_OU_ID ,TT.OU_ID_PATH ,TT.SORT FROM(
from ( SELECT SOR.OU_ID ,SOR.PARENT_OU_ID ,SOR.OU_ID_PATH ,SOR.SORT FROM SYS_ORGANIZATION_REL SOR
select so.ou_level ,so.id,so.ou_name ,tt.ou_id ,tt.parent_ou_id ,tt.ou_id_path ,tt.sort from( WHERE SOR.EFFECT_TIME &lt;= #{endTime} AND SOR.END_TIME >= #{endTime}
select sor.ou_id ,sor.parent_ou_id ,sor.ou_id_path ,sor.sort from SYS_ORGANIZATION_REL sor )TT
where sor.effect_time &lt;= #{endTime} and sor.end_time >= #{endTime} LEFT JOIN SYS_ORGANIZATION SO ON TT.OU_ID=SO.ID
)tt AND SO.IS_DELETED =1
left join SYS_ORGANIZATION so on tt.ou_id=so.id ) A WHERE A.PARENT_OU_ID=(SELECT OU_ID FROM SYS_USER_ORGANIZATION_REL SUOR
and so.is_deleted =1 WHERE SUOR.USER_ID = #{userId}
) a where a.parent_ou_id=(select ou_id from SYS_USER_ORGANIZATION_REL suor AND SUOR.EFFECT_TIME &lt;= #{endTime} AND SUOR.END_TIME >= #{endTime}
where suor.user_id = #{userId}
and suor.effect_time &lt;= #{endTime} and suor.end_time >= #{endTime}
) )
UNION
union SELECT A.OU_LEVEL,A.ID,A.OU_NAME ,A.OU_ID ,A.PARENT_OU_ID ,A.OU_ID_PATH ,A.SORT
FROM (
select a.ou_level,a.id,a.ou_name ,a.ou_id ,a.parent_ou_id ,a.ou_id_path ,a.sort SELECT SO.OU_LEVEL ,SO.ID,SO.OU_NAME ,TT.OU_ID ,TT.PARENT_OU_ID ,TT.OU_ID_PATH ,TT.SORT FROM(
from ( SELECT SOR.OU_ID ,SOR.PARENT_OU_ID ,SOR.OU_ID_PATH ,SOR.SORT FROM SYS_ORGANIZATION_REL SOR
select so.ou_level ,so.id,so.ou_name ,tt.ou_id ,tt.parent_ou_id ,tt.ou_id_path ,tt.sort from( WHERE SOR.EFFECT_TIME &lt;= #{endTime} AND SOR.END_TIME >= #{endTime}
select sor.ou_id ,sor.parent_ou_id ,sor.ou_id_path ,sor.sort from SYS_ORGANIZATION_REL sor )TT
where sor.effect_time &lt;= #{endTime} and sor.end_time >= #{endTime} LEFT JOIN SYS_ORGANIZATION SO ON TT.OU_ID=SO.ID
)tt AND SO.IS_DELETED =1
left join SYS_ORGANIZATION so on tt.ou_id=so.id ) A WHERE A.ID=(SELECT SOR.PARENT_OU_ID FROM SYS_ORGANIZATION_REL SOR
and so.is_deleted =1 WHERE
) a where a.id=(select sor.parent_ou_id from SYS_ORGANIZATION_REL sor SOR.EFFECT_TIME &lt;= #{endTime} AND SOR.END_TIME >= #{endTime} AND
where OU_ID =
sor.effect_time &lt;= #{endTime} and sor.end_time >= #{endTime} and (SELECT OU_ID FROM SYS_USER_ORGANIZATION_REL SUOR
ou_id = WHERE SUOR.USER_ID = #{userId}
(select ou_id from SYS_USER_ORGANIZATION_REL suor AND SUOR.EFFECT_TIME &lt;= #{endTime} AND SUOR.END_TIME >= #{endTime}
where suor.user_id = #{userId}
and suor.effect_time &lt;= #{endTime} and suor.end_time >= #{endTime}
) )
) )
) )
select temps.* from temps SELECT TEMPS.* FROM TEMPS
<where> <where>
<if test="ouLevel != null and ouLevel !=''"> <if test="ouLevel != null and ouLevel !=''">
and ou_level=#{ouLevel} AND OU_LEVEL=#{ouLevel}
</if> </if>
</where> </where>
</select> </select>
<select id="selectOuAllByUserId" parameterType="pps.core.system.entity.SysOrganizationView" <select id="selectOuAllByUserId" parameterType="pps.core.system.entity.SysOrganizationView"
resultMap="BaseResultMap"> resultMap="BaseResultMap">
with RECURSIVE temps as WITH RECURSIVE TEMPS AS
(select so.ou_level, so.id, so.ou_name, tt.ou_id, tt.parent_ou_id, tt.ou_id_path, tt.sort (SELECT SO.OU_LEVEL, SO.ID, SO.OU_NAME, TT.OU_ID, TT.PARENT_OU_ID, TT.OU_ID_PATH, TT.SORT
from (select sor.ou_id, sor.parent_ou_id, sor.ou_id_path, sor.sort FROM (SELECT SOR.OU_ID, SOR.PARENT_OU_ID, SOR.OU_ID_PATH, SOR.SORT
from SYS_ORGANIZATION_REL sor FROM SYS_ORGANIZATION_REL SOR
where sor.effect_time &lt;= #{endTime} WHERE SOR.EFFECT_TIME &lt;= #{endTime}
and sor.end_time &gt;= #{endTime} AND SOR.END_TIME &gt;= #{endTime}
and ou_id = AND OU_ID =
(select ou_id (SELECT OU_ID
from SYS_USER_ORGANIZATION_REL suor FROM SYS_USER_ORGANIZATION_REL SUOR
where suor.user_id = #{userId} WHERE SUOR.USER_ID = #{userId}
and suor.effect_time &lt;= #{endTime} AND SUOR.EFFECT_TIME &lt;= #{endTime}
and suor.end_time &gt;= #{endTime})) tt AND SUOR.END_TIME &gt;= #{endTime})) TT
left join SYS_ORGANIZATION so on tt.ou_id = so.id and so.is_deleted = 1 LEFT JOIN SYS_ORGANIZATION SO ON TT.OU_ID = SO.ID AND SO.IS_DELETED = 1
UNION
union SELECT A.OU_LEVEL, A.ID, A.OU_NAME, A.OU_ID, A.PARENT_OU_ID, A.OU_ID_PATH, A.SORT
FROM TEMPS
select a.ou_level, a.id, a.ou_name, a.ou_id, a.parent_ou_id, a.ou_id_path, a.sort INNER JOIN (SELECT SO.OU_LEVEL,
from temps SO.ID,
inner join (select so.ou_level, SO.OU_NAME,
so.id, TT.OU_ID,
so.ou_name, TT.PARENT_OU_ID,
tt.ou_id, TT.OU_ID_PATH,
tt.parent_ou_id, TT.SORT
tt.ou_id_path, FROM (SELECT SOR.OU_ID, SOR.PARENT_OU_ID, SOR.OU_ID_PATH, SOR.SORT
tt.sort FROM SYS_ORGANIZATION_REL SOR
from (select sor.ou_id, sor.parent_ou_id, sor.ou_id_path, sor.sort WHERE SOR.EFFECT_TIME &lt;= #{endTime}
from SYS_ORGANIZATION_REL sor AND SOR.END_TIME &gt;= #{endTime}) TT
where sor.effect_time &lt;= #{endTime} RIGHT JOIN SYS_ORGANIZATION SO ON TT.OU_ID = SO.ID AND SO.IS_DELETED = 1) A
and sor.end_time &gt;= #{endTime}) tt ON TEMPS.OU_ID = A.PARENT_OU_ID)
right join SYS_ORGANIZATION so on tt.ou_id = so.id and so.is_deleted = 1) a SELECT TEMPS.*
on temps.ou_id = a.parent_ou_id) FROM TEMPS
select temps.*
from temps
</select> </select>
<select id="selectOuSonByOuId" parameterType="pps.core.system.entity.SysOrganizationView" resultMap="BaseResultMap">
with RECURSIVE temps as <select id="selectOuSonByOuId" parameterType="pps.core.system.entity.SysOrganizationView" resultMap="BaseResultMap">
(select ou_id, parent_ou_id WITH RECURSIVE TEMPS AS
from SYS_ORGANIZATION_REL (SELECT OU_ID, PARENT_OU_ID
where ou_id = #{id} FROM SYS_ORGANIZATION_REL
union all WHERE OU_ID = #{id}
select a.ou_id, a.parent_ou_id UNION ALL
from temps SELECT A.OU_ID, A.PARENT_OU_ID
inner join SYS_ORGANIZATION_REL a on temps.ou_id = a.parent_ou_id) FROM TEMPS
select temps.* INNER JOIN SYS_ORGANIZATION_REL A ON TEMPS.OU_ID = A.PARENT_OU_ID)
from temps SELECT TEMPS.*
FROM TEMPS
</select> </select>
<select id="selectOuTreeByOuName" parameterType="pps.core.system.entity.SysOrganizationView" <select id="selectOuTreeByOuName" parameterType="pps.core.system.entity.SysOrganizationView"
resultMap="BaseResultMap"> resultMap="BaseResultMap">
with RECURSIVE temps as WITH RECURSIVE TEMPS AS
(select so.ou_level, so.id, so.ou_name, sor.ou_id, sor.parent_ou_id, sor.ou_id_path, sor.sort (SELECT SO.OU_LEVEL, SO.ID, SO.OU_NAME, SOR.OU_ID, SOR.PARENT_OU_ID, SOR.OU_ID_PATH, SOR.SORT
from SYS_ORGANIZATION so FROM SYS_ORGANIZATION SO
left join SYS_ORGANIZATION_REL sor on sor.ou_id = so.id and so.is_deleted = 1 LEFT JOIN SYS_ORGANIZATION_REL SOR ON SOR.OU_ID = SO.ID AND SO.IS_DELETED = 1
where so.ou_name like concat('%', #{ouName}, '%') WHERE SO.OU_NAME LIKE CONCAT('%', #{ouName}, '%')
and sor.effect_time &lt;= #{endTime} AND SOR.EFFECT_TIME &lt;= #{endTime}
and sor.end_time &gt;= #{endTime} AND SOR.END_TIME &gt;= #{endTime}
and so.is_deleted = 1 AND SO.IS_DELETED = 1
UNION
union SELECT A.OU_LEVEL, A.ID, A.OU_NAME, A.OU_ID, A.PARENT_OU_ID, A.OU_ID_PATH, A.SORT
FROM TEMPS
select a.ou_level, a.id, a.ou_name, a.ou_id, a.parent_ou_id, a.ou_id_path, a.sort INNER JOIN (SELECT SO.OU_LEVEL,
from temps SO.ID,
inner join (select so.ou_level, SO.OU_NAME,
so.id, TT.OU_ID,
so.ou_name, TT.PARENT_OU_ID,
tt.ou_id, TT.OU_ID_PATH,
tt.parent_ou_id, TT.SORT
tt.ou_id_path, FROM (SELECT SOR.OU_ID, SOR.PARENT_OU_ID, SOR.OU_ID_PATH, SOR.SORT
tt.sort FROM SYS_ORGANIZATION_REL SOR
from (select sor.ou_id, sor.parent_ou_id, sor.ou_id_path, sor.sort WHERE SOR.EFFECT_TIME &lt;= #{endTime}
from SYS_ORGANIZATION_REL sor AND SOR.END_TIME &gt;= #{endTime}) TT
where sor.effect_time &lt;= #{endTime} LEFT JOIN SYS_ORGANIZATION SO ON TT.OU_ID = SO.ID AND SO.IS_DELETED = 1) A
and sor.end_time &gt;= #{endTime}) tt ON TEMPS.PARENT_OU_ID = A.ID)
left join SYS_ORGANIZATION so on tt.ou_id = so.id and so.is_deleted = 1) a SELECT TEMPS.*
on temps.parent_ou_id = a.id) FROM TEMPS
select temps.*
from temps
</select> </select>
<select id="selectOrganizationBySubOuIds" parameterType="java.util.List" resultMap="BaseResultMap"> <select id="selectOrganizationBySubOuIds" parameterType="java.util.List" resultMap="BaseResultMap">
select SELECT
so.id as parent_ou_id, SO.ID AS PARENT_OU_ID,
ou_name as partent_name, OU_NAME AS PARTENT_NAME,
sor.ou_id as id, SOR.OU_ID AS ID,
sor.end_time SOR.END_TIME
from SYS_ORGANIZATION so FROM SYS_ORGANIZATION SO
left join SYS_ORGANIZATION_REL sor on sor.parent_ou_id = so.id LEFT JOIN SYS_ORGANIZATION_REL SOR ON SOR.PARENT_OU_ID = SO.ID
<where> <where>
sor.end_time >= NOW() SOR.END_TIME >= NOW()
AND sor.ou_id in AND SOR.OU_ID IN
<foreach collection="list" open="(" close=")" separator="," item="item"> <foreach collection="list" open="(" close=")" separator="," item="item">
#{item} #{item}
</foreach> </foreach>
</where> </where>
</select> </select>
<select id="selectOuByOuId" parameterType="pps.core.system.entity.SysOrganizationView" resultMap="BaseResultMap"> <select id="selectOuByOuId" parameterType="pps.core.system.entity.SysOrganizationView" resultMap="BaseResultMap">
select id, SELECT ID,
ou_code, OU_CODE,
ou_name, OU_NAME,
short_name, SHORT_NAME,
ou_level, OU_LEVEL,
description, DESCRIPTION,
post_code, POST_CODE,
post_address, POST_ADDRESS,
fax_no, FAX_NO,
phone, PHONE,
country, COUNTRY,
province, PROVINCE,
is_deleted, IS_DELETED,
ou_level, OU_LEVEL,
'ou' AS type 'ou' AS TYPE
from SYS_ORGANIZATION FROM SYS_ORGANIZATION
where id = #{id} WHERE ID = #{id}
and is_deleted = 1 AND IS_DELETED = 1
</select> </select>
<select id="selectOuByOuIdsAndOuName" parameterType="pps.core.system.entity.SysOrganizationView" <select id="selectOuByOuIdsAndOuName" parameterType="pps.core.system.entity.SysOrganizationView"
resultMap="BaseResultMap"> resultMap="BaseResultMap">
with RECURSIVE temps as WITH RECURSIVE TEMPS AS
( (
select so.ou_level ,so.id,so.ou_name ,sor.ou_id ,sor.parent_ou_id ,sor.ou_id_path ,sor.sort,'ou' as type from SELECT SO.OU_LEVEL ,SO.ID,SO.OU_NAME ,SOR.OU_ID ,SOR.PARENT_OU_ID ,SOR.OU_ID_PATH ,SOR.SORT,'OU' AS TYPE FROM
SYS_ORGANIZATION so SYS_ORGANIZATION SO
left join SYS_ORGANIZATION_REL sor on sor.ou_id=so.id and so.is_deleted =1 LEFT JOIN SYS_ORGANIZATION_REL SOR ON SOR.OU_ID=SO.ID AND SO.IS_DELETED =1
where so.ou_name like concat('%',#{ouName},'%') WHERE SO.OU_NAME LIKE CONCAT('%',#{ouName},'%')
and sor.effect_time &lt;= #{endTime} and sor.end_time &gt;= #{endTime} AND SOR.EFFECT_TIME &lt;= #{endTime} AND SOR.END_TIME &gt;= #{endTime}
and so.is_deleted =1 AND SO.IS_DELETED =1
<if test="ouIds != null and ouIds.size()>0"> <if test="ouIds != null and ouIds.size()>0">
or so.id in OR SO.ID IN
<foreach collection="ouIds" open="(" close=")" separator="," item="item"> <foreach collection="ouIds" open="(" close=")" separator="," item="item">
#{item} #{item}
</foreach> </foreach>
</if> </if>
UNION
union SELECT A.OU_LEVEL,A.ID,A.OU_NAME ,A.OU_ID ,A.PARENT_OU_ID ,A.OU_ID_PATH ,A.SORT,'OU' AS TYPE
FROM TEMPS INNER JOIN (
select a.ou_level,a.id,a.ou_name ,a.ou_id ,a.parent_ou_id ,a.ou_id_path ,a.sort,'ou' as type SELECT SO.OU_LEVEL ,SO.ID,SO.OU_NAME ,TT.OU_ID ,TT.PARENT_OU_ID ,TT.OU_ID_PATH ,TT.SORT FROM(
from temps inner join ( SELECT SOR.OU_ID ,SOR.PARENT_OU_ID ,SOR.OU_ID_PATH ,SOR.SORT FROM SYS_ORGANIZATION_REL SOR
WHERE SOR.EFFECT_TIME &lt;= #{endTime} AND SOR.END_TIME &gt;= #{endTime}
select so.ou_level ,so.id,so.ou_name ,tt.ou_id ,tt.parent_ou_id ,tt.ou_id_path ,tt.sort from( )TT
select sor.ou_id ,sor.parent_ou_id ,sor.ou_id_path ,sor.sort from SYS_ORGANIZATION_REL sor LEFT JOIN SYS_ORGANIZATION SO ON TT.OU_ID=SO.ID AND SO.IS_DELETED =1
where sor.effect_time &lt;= #{endTime} and sor.end_time &gt;= #{endTime} ) A ON TEMPS.PARENT_OU_ID = A.ID
)tt
left join SYS_ORGANIZATION so on tt.ou_id=so.id and so.is_deleted =1
) a on temps.parent_ou_id = a.id
) )
select temps.* from temps SELECT TEMPS.* FROM TEMPS
</select> </select>
<select id="selectOrgListDynamicQuery" parameterType="pps.core.system.entity.SysOrganizationView" <select id="selectOrgListDynamicQuery" parameterType="pps.core.system.entity.SysOrganizationView"
resultMap="BaseResultMap"> resultMap="BaseResultMap">
SELECT SELECT
o.id, O.ID,
o.ou_name O.OU_NAME
FROM FROM
SYS_ORGANIZATION_REL r, SYS_ORGANIZATION_REL R,
SYS_ORGANIZATION o SYS_ORGANIZATION O
WHERE WHERE
r.ou_id = o.id R.OU_ID = O.ID
AND r.end_time >= NOW() AND R.END_TIME >= NOW()
AND o.is_deleted = 1 AND O.IS_DELETED = 1
<if test="parentOuId != null and parentOuId != ''"> <if test="parentOuId != null and parentOuId != ''">
AND r.parent_ou_id = #{parentOuId} AND R.PARENT_OU_ID = #{parentOuId}
</if> </if>
<if test="id != null and id != ''"> <if test="id != null and id != ''">
AND o.id = #{id} AND O.ID = #{id}
</if> </if>
<if test="ouName != null and ouName != ''"> <if test="ouName != null and ouName != ''">
AND o.ou_name LIKE CONCAT( '%', #{ouName}, '%' ) AND O.OU_NAME LIKE CONCAT( '%', #{ouName}, '%' )
</if> </if>
ORDER BY ORDER BY
r.sort R.SORT
</select> </select>
<resultMap id="ExtendResultMap" type="pps.core.system.entity.SysOrganizationView" extends="BaseResultMap"> <resultMap id="ExtendResultMap" type="pps.core.system.entity.SysOrganizationView" extends="BaseResultMap">
<result column="line_id" property="lineId" jdbcType="VARCHAR"/> <result column="LINE_ID" property="lineId"/>
<result column="station_id" property="stationId" jdbcType="VARCHAR"/> <result column="STATION_ID" property="stationId"/>
<result column="grid_type_key" property="gridTypeKey" jdbcType="VARCHAR"/> <result column="GRID_TYPE_KEY" property="gridTypeKey"/>
</resultMap> </resultMap>
<select id="selectLineList" parameterType="pps.core.system.entity.SysOrganizationView" <select id="selectLineList" parameterType="pps.core.system.entity.SysOrganizationView"
resultMap="ExtendResultMap"> resultMap="ExtendResultMap">
SELECT ou_id AS id, SELECT OU_ID AS ID,
line_name AS ou_name, LINE_NAME AS OU_NAME,
id AS line_id, ID AS LINE_ID,
'LINE' AS ou_level 'LINE' AS OU_LEVEL
FROM BASE_POWER_LINE FROM BASE_POWER_LINE
<where> <where>
<if test="id != null and id != ''"> <if test="id != null and id != ''">
AND ou_id = #{id} AND OU_ID = #{id}
</if> </if>
<if test="ouName != null and ouName != ''"> <if test="ouName != null and ouName != ''">
AND line_name LIKE CONCAT('%', #{ouName}, '%') AND LINE_NAME LIKE CONCAT('%', #{ouName}, '%')
</if> </if>
</where> </where>
ORDER BY line_name DESC ORDER BY LINE_NAME DESC
</select> </select>
<select id="selectWindTurbineList" parameterType="pps.core.system.entity.SysOrganizationView" <select id="selectWindTurbineList" parameterType="pps.core.system.entity.SysOrganizationView"
resultMap="ExtendResultMap"> resultMap="ExtendResultMap">
SELECT ou_id AS id, SELECT OU_ID AS ID,
station_name AS ou_name, STATION_NAME AS OU_NAME,
id AS station_id, ID AS STATION_ID,
'STATION' AS ou_level 'STATION' AS OU_LEVEL
FROM BASE_WIND_TURBINE FROM BASE_WIND_TURBINE
<where> <where>
<if test="id != null and id != ''"> <if test="id != null and id != ''">
AND ou_id = #{id} AND OU_ID = #{id}
</if> </if>
<if test="ouName != null and ouName != ''"> <if test="ouName != null and ouName != ''">
AND station_name LIKE CONCAT('%', #{ouName}, '%') AND STATION_NAME LIKE CONCAT('%', #{ouName}, '%')
</if> </if>
</where> </where>
ORDER BY station_name DESC ORDER BY STATION_NAME DESC
</select> </select>
<select id="selectOrgAndLineList" parameterType="pps.core.system.entity.SysOrganizationView" <select id="selectOrgAndLineList" parameterType="pps.core.system.entity.SysOrganizationView"
resultMap="ExtendResultMap"> resultMap="ExtendResultMap">
(SELECT ROW_NUMBER() OVER ( ORDER BY r.sort ) AS rn, o.id, (SELECT ROW_NUMBER() OVER ( ORDER BY R.SORT ) AS RN, O.ID,
o.ou_name AS ou_name, O.OU_NAME AS OU_NAME,
'' AS line_id, '' AS LINE_ID,
'ORG' AS ou_level, 'ORG' AS OU_LEVEL,
'' AS grid_type_key '' AS GRID_TYPE_KEY
FROM SYS_ORGANIZATION o FROM SYS_ORGANIZATION O
LEFT JOIN SYS_ORGANIZATION_REL r ON o.id = r.ou_id LEFT JOIN SYS_ORGANIZATION_REL R ON O.ID = R.OU_ID
WHERE r.parent_ou_id = #{id} WHERE R.PARENT_OU_ID = #{id}
AND r.end_time >= NOW() AND R.END_TIME >= NOW()
AND o.is_deleted = 1 AND O.IS_DELETED = 1
ORDER BY r.sort) ORDER BY R.SORT)
UNION ALL UNION ALL
(SELECT ROW_NUMBER() OVER ( ORDER BY create_time ) AS rn, id AS id, (SELECT ROW_NUMBER() OVER ( ORDER BY CREATE_TIME ) AS RN, ID AS ID,
line_name AS ou_name, LINE_NAME AS OU_NAME,
id AS line_id, ID AS LINE_ID,
'LINE' AS ou_level, 'LINE' AS OU_LEVEL,
grid_type_key GRID_TYPE_KEY
FROM BASE_POWER_LINE FROM BASE_POWER_LINE
WHERE ou_id = #{id} WHERE OU_ID = #{id}
AND is_deleted = 1 AND IS_DELETED = 1
AND line_type_key = '10' AND LINE_TYPE_KEY = '10'
ORDER BY line_name) ORDER BY LINE_NAME)
UNION ALL UNION ALL
(SELECT ROW_NUMBER() OVER ( ORDER BY create_time ) AS rn, ou_id AS id, (SELECT ROW_NUMBER() OVER ( ORDER BY CREATE_TIME ) AS RN, OU_ID AS ID,
line_name AS ou_name, LINE_NAME AS OU_NAME,
id AS line_id, ID AS LINE_ID,
'LINE' AS ou_level, 'LINE' AS OU_LEVEL,
grid_type_key GRID_TYPE_KEY
FROM BASE_POWER_LINE FROM BASE_POWER_LINE
WHERE ou_id = #{id} WHERE OU_ID = #{id}
AND is_deleted = 1 AND IS_DELETED = 1
AND upper_line_id &lt;&gt; NULL AND UPPER_LINE_ID &lt;&gt; NULL
AND line_type_key = '380' AND LINE_TYPE_KEY = '380'
ORDER BY line_name) ORDER BY LINE_NAME)
</select> </select>
<select id="selectOrgAndWindStationList" parameterType="pps.core.system.entity.SysOrganizationView" <select id="selectOrgAndWindStationList" parameterType="pps.core.system.entity.SysOrganizationView"
resultMap="ExtendResultMap"> resultMap="ExtendResultMap">
(SELECT ROW_NUMBER() OVER ( ORDER BY r.sort ) AS rn, o.id, (SELECT ROW_NUMBER() OVER ( ORDER BY R.SORT ) AS RN, O.ID,
o.ou_name AS ou_name, O.OU_NAME AS OU_NAME,
'' AS station_id, '' AS STATION_ID,
'ORG' AS ou_level 'ORG' AS OU_LEVEL
FROM SYS_ORGANIZATION o FROM SYS_ORGANIZATION O
LEFT JOIN SYS_ORGANIZATION_REL r ON o.id = r.ou_id LEFT JOIN SYS_ORGANIZATION_REL R ON O.ID = R.OU_ID
WHERE r.parent_ou_id = #{id} WHERE R.PARENT_OU_ID = #{id}
AND r.end_time >= NOW() AND R.END_TIME >= NOW()
AND o.is_deleted = 1 AND O.IS_DELETED = 1
ORDER BY r.sort) ORDER BY R.SORT)
UNION ALL UNION ALL
(SELECT ROW_NUMBER() OVER ( ORDER BY create_time ) AS rn, id AS id, (SELECT ROW_NUMBER() OVER ( ORDER BY CREATE_TIME ) AS RN, ID AS ID,
station_name AS ou_name, STATION_NAME AS OU_NAME,
id AS station_id, ID AS STATION_ID,
'STATION' AS ou_level 'STATION' AS OU_LEVEL
FROM BASE_WIND_TURBINE FROM BASE_WIND_TURBINE
WHERE ou_id = #{id} WHERE OU_ID = #{id}
AND is_deleted = 1 AND IS_DELETED = 1
ORDER BY station_name) ORDER BY STATION_NAME)
</select> </select>
<select id="selectChildLineList" parameterType="pps.core.system.entity.SysOrganizationView" <select id="selectChildLineList" parameterType="pps.core.system.entity.SysOrganizationView"
resultMap="ExtendResultMap"> resultMap="ExtendResultMap">
SELECT id AS id, SELECT ID AS ID,
line_name AS ou_name, LINE_NAME AS OU_NAME,
id AS line_id, ID AS LINE_ID,
'LINE' AS ou_level, 'LINE' AS OU_LEVEL,
grid_type_key GRID_TYPE_KEY
FROM BASE_POWER_LINE FROM BASE_POWER_LINE
WHERE upper_line_id = #{id} WHERE UPPER_LINE_ID = #{id}
AND is_deleted = 1 AND IS_DELETED = 1
ORDER BY line_name ORDER BY LINE_NAME
</select> </select>
<select id="selectOrgProvince" parameterType="pps.core.system.entity.SysOrganizationView" resultMap="BaseResultMap"> <select id="selectOrgProvince" parameterType="pps.core.system.entity.SysOrganizationView" resultMap="BaseResultMap">
SELECT province, SELECT PROVINCE,
sa.name province_name SA.NAME PROVINCE_NAME
from SYS_ORGANIZATION so FROM SYS_ORGANIZATION SO
left join SYS_AREA sa on LEFT JOIN SYS_AREA SA ON
sa.id = so.province SA.ID = SO.PROVINCE
where so.id = #{id} WHERE SO.ID = #{id}
</select> </select>
<select id="selectOrgList" parameterType="pps.core.system.entity.SysOrganizationView" <select id="selectOrgList" parameterType="pps.core.system.entity.SysOrganizationView"
resultMap="ExtendResultMap"> resultMap="ExtendResultMap">
SELECT ROW_NUMBER() OVER ( ORDER BY r.sort ) AS rn, o.id, SELECT ROW_NUMBER() OVER ( ORDER BY R.SORT ) AS RN, O.ID,
o.ou_name AS ou_name, O.OU_NAME AS OU_NAME,
'' AS line_id, '' AS LINE_ID,
'ORG' AS ou_level, 'ORG' AS OU_LEVEL,
'' AS grid_type_key '' AS GRID_TYPE_KEY
FROM SYS_ORGANIZATION o FROM SYS_ORGANIZATION O
LEFT JOIN SYS_ORGANIZATION_REL r ON o.id = r.ou_id LEFT JOIN SYS_ORGANIZATION_REL R ON O.ID = R.OU_ID
WHERE o.id = #{id} WHERE O.ID = #{id}
AND r.end_time >= NOW() AND R.END_TIME >= NOW()
AND o.is_deleted = 1 AND O.IS_DELETED = 1
ORDER BY r.sort ORDER BY R.SORT
</select> </select>
<select id="selectOrgAndWindTurbineList" parameterType="pps.core.system.entity.SysOrganizationView" <select id="selectOrgAndWindTurbineList" parameterType="pps.core.system.entity.SysOrganizationView"
resultMap="ExtendResultMap"> resultMap="ExtendResultMap">
SELECT ROW_NUMBER() OVER ( ORDER BY r.sort ) AS rn, o.id, SELECT ROW_NUMBER() OVER ( ORDER BY R.SORT ) AS RN, O.ID,
o.ou_name AS ou_name, O.OU_NAME AS OU_NAME,
'' AS station_id, '' AS STATION_ID,
'STATION' AS ou_level, 'STATION' AS OU_LEVEL,
'' AS grid_type_key '' AS GRID_TYPE_KEY
FROM SYS_ORGANIZATION o FROM SYS_ORGANIZATION O
LEFT JOIN SYS_ORGANIZATION_REL r ON o.id = r.ou_id LEFT JOIN SYS_ORGANIZATION_REL R ON O.ID = R.OU_ID
WHERE o.id = #{id} WHERE O.ID = #{id}
AND r.end_time >= NOW() AND R.END_TIME >= NOW()
AND o.is_deleted = 1 AND O.IS_DELETED = 1
ORDER BY r.sort ORDER BY R.SORT
</select> </select>
</mapper> </mapper>
...@@ -2,32 +2,32 @@ ...@@ -2,32 +2,32 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pps.core.system.mapper.SysRoleMenuAuthViewMapper"> <mapper namespace="pps.core.system.mapper.SysRoleMenuAuthViewMapper">
<resultMap id="BaseResultMap" type="pps.core.system.entity.SysRoleMenuAuthView"> <resultMap id="BaseResultMap" type="pps.core.system.entity.SysRoleMenuAuthView">
<id column="id" property="id" jdbcType="VARCHAR"/> <id column="ID" property="id"/>
<result column="role_id" property="roleId" jdbcType="VARCHAR"/> <result column="ROLE_ID" property="roleId"/>
<result column="menu_id" property="menuId" jdbcType="VARCHAR"/> <result column="MENU_ID" property="menuId"/>
<result column="create_by_id" property="createById" jdbcType="VARCHAR"/> <result column="CREATE_BY_ID" property="createById"/>
<result column="create_by_name" property="createByName" jdbcType="VARCHAR"/> <result column="CREATE_BY_NAME" property="createByName"/>
<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/> <result column="CREATE_TIME" property="createTime"/>
<result column="modify_by_id" property="modifyById" jdbcType="VARCHAR"/> <result column="MODIFY_BY_ID" property="modifyById"/>
<result column="modify_by_name" property="modifyByName" jdbcType="VARCHAR"/> <result column="MODIFY_BY_NAME" property="modifyByName"/>
<result column="modify_time" property="modifyTime" jdbcType="TIMESTAMP"/> <result column="MODIFY_TIME" property="modifyTime"/>
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id ID
, ,
role_id, ROLE_ID,
menu_id, MENU_ID,
create_by_id, CREATE_BY_ID,
create_by_name, CREATE_BY_NAME,
create_time, CREATE_TIME,
modify_by_id, MODIFY_BY_ID,
modify_by_name, MODIFY_BY_NAME,
modify_time MODIFY_TIME
</sql> </sql>
<insert id="batchInsert" parameterType="java.util.List"> <insert id="batchInsert" parameterType="java.util.List">
insert into SYS_ROLE_MENU_AUTH (id,role_id,menu_id,create_by_id,create_by_name,create_time) INSERT INTO SYS_ROLE_MENU_AUTH (ID,ROLE_ID,MENU_ID,CREATE_BY_ID,CREATE_BY_NAME,CREATE_TIME)
values VALUES
<foreach collection="list" item="roleMenuAuth" separator=","> <foreach collection="list" item="roleMenuAuth" separator=",">
( (
#{roleMenuAuth.id}, #{roleMenuAuth.id},
...@@ -41,35 +41,35 @@ ...@@ -41,35 +41,35 @@
</insert> </insert>
<select id="selectOne" parameterType="pps.core.system.entity.SysRoleMenuAuthView" resultMap="BaseResultMap"> <select id="selectOne" parameterType="pps.core.system.entity.SysRoleMenuAuthView" resultMap="BaseResultMap">
select SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from SYS_ROLE_MENU_AUTH FROM SYS_ROLE_MENU_AUTH
where WHERE
id=#{id} ID=#{id}
</select> </select>
<select id="selectList" parameterType="pps.core.system.entity.SysRoleMenuAuthView" resultMap="BaseResultMap"> <select id="selectList" parameterType="pps.core.system.entity.SysRoleMenuAuthView" resultMap="BaseResultMap">
select SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from SYS_ROLE_MENU_AUTH FROM SYS_ROLE_MENU_AUTH
where WHERE
id=#{id} ID=#{id}
</select> </select>
<select id="selectListByRoleId" parameterType="pps.core.system.entity.SysRoleMenuAuthView" <select id="selectListByRoleId" parameterType="pps.core.system.entity.SysRoleMenuAuthView"
resultMap="BaseResultMap"> resultMap="BaseResultMap">
select srma.id, SELECT SRMA.ID,
srma.role_id, SRMA.ROLE_ID,
srma.menu_id, SRMA.MENU_ID,
srma.create_by_id, SRMA.CREATE_BY_ID,
srma.create_by_name, SRMA.CREATE_BY_NAME,
srma.create_time, SRMA.CREATE_TIME,
srma.modify_by_id, SRMA.MODIFY_BY_ID,
srma.modify_by_name, SRMA.MODIFY_BY_NAME,
srma.modify_time SRMA.MODIFY_TIME
from SYS_ROLE_MENU_AUTH srma FROM SYS_ROLE_MENU_AUTH SRMA
right join SYS_MENU sm on srma.menu_id = sm.id RIGHT JOIN SYS_MENU SM ON SRMA.MENU_ID = SM.ID
where sm.url !='#' and WHERE SM.URL !='#'
srma.role_id=#{roleId} AND SRMA.ROLE_ID=#{roleId}
</select> </select>
</mapper> </mapper>
...@@ -2,197 +2,197 @@ ...@@ -2,197 +2,197 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pps.core.system.mapper.SysRoleViewMapper"> <mapper namespace="pps.core.system.mapper.SysRoleViewMapper">
<resultMap id="BaseResultMap" type="pps.core.system.entity.SysRoleView"> <resultMap id="BaseResultMap" type="pps.core.system.entity.SysRoleView">
<id column="id" property="id" jdbcType="VARCHAR"/> <id column="ID" property="id"/>
<result column="role_name" property="roleName" jdbcType="VARCHAR"/> <result column="ROLE_NAME" property="roleName"/>
<result column="remark" property="remark" jdbcType="VARCHAR"/> <result column="REMARK" property="remark"/>
<result column="dic_name" property="dicName" jdbcType="VARCHAR"/> <result column="DIC_NAME" property="dicName"/>
<result column="ou_name" property="ouName" jdbcType="VARCHAR"/> <result column="OU_NAME" property="ouName"/>
<result column="media_type" property="mediaType" jdbcType="VARCHAR"/> <result column="MEDIA_TYPE" property="mediaType"/>
<result column="ou_id" property="ouId" jdbcType="VARCHAR"/> <result column="OU_ID" property="ouId"/>
<result column="sort" property="sort" jdbcType="INTEGER"/> <result column="SORT" property="sort"/>
<result column="is_inheritable" property="isInheritable" jdbcType="INTEGER"/> <result column="IS_INHERITABLE" property="isInheritable"/>
<result column="is_overall" property="isOverall" jdbcType="BOOLEAN"/> <result column="IS_OVERALL" property="isOverall"/>
<result column="sync_work_flow" property="syncWorkFlow" jdbcType="BOOLEAN"/> <result column="SYNC_WORK_FLOW" property="syncWorkFlow"/>
<result column="role_type" property="roleType" jdbcType="VARCHAR"/> <result column="ROLE_TYPE" property="roleType"/>
<result column="create_by_id" property="createById" jdbcType="VARCHAR"/> <result column="CREATE_BY_ID" property="createById"/>
<result column="create_by_name" property="createByName" jdbcType="VARCHAR"/> <result column="CREATE_BY_NAME" property="createByName"/>
<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/> <result column="CREATE_TIME" property="createTime"/>
<result column="modify_by_id" property="modifyById" jdbcType="VARCHAR"/> <result column="MODIFY_BY_ID" property="modifyById"/>
<result column="modify_by_name" property="modifyByName" jdbcType="VARCHAR"/> <result column="MODIFY_BY_NAME" property="modifyByName"/>
<result column="modify_time" property="modifyTime" jdbcType="TIMESTAMP"/> <result column="MODIFY_TIME" property="modifyTime"/>
<result column="bps_role_id" property="bpsRoleId" jdbcType="VARCHAR"/> <result column="BPS_ROLE_ID" property="bpsRoleId"/>
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id ID
, ,
role_name, ROLE_NAME,
remark, REMARK,
media_type, MEDIA_TYPE,
ou_id, OU_ID,
sort, SORT,
is_inheritable, IS_INHERITABLE,
is_overall, IS_OVERALL,
sync_work_flow, SYNC_WORK_FLOW,
role_type, ROLE_TYPE,
create_by_id, CREATE_BY_ID,
create_by_name, CREATE_BY_NAME,
create_time, CREATE_TIME,
modify_by_id, MODIFY_BY_ID,
modify_by_name, MODIFY_BY_NAME,
modify_time, MODIFY_TIME,
bps_role_id BPS_ROLE_ID
</sql> </sql>
<update id="batchUpdateSysRoleSetBpsRoleId" parameterType="java.util.List"> <update id="batchUpdateSysRoleSetBpsRoleId" parameterType="java.util.List">
<foreach collection="list" item="item" index="index" open="" close="" separator=";"> <foreach collection="list" item="item" index="index" open="" close="" separator=";">
update SYS_ROLE UPDATE SYS_ROLE
<set> <set>
bps_role_id=#{item.bpsRoleId} BPS_ROLE_ID=#{item.bpsRoleId}
</set> </set>
where id = #{item.id} WHERE ID = #{item.id}
</foreach> </foreach>
</update> </update>
<select id="selectOne" parameterType="pps.core.system.entity.SysRoleView" resultMap="BaseResultMap"> <select id="selectOne" parameterType="pps.core.system.entity.SysRoleView" resultMap="BaseResultMap">
select SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from SYS_ROLE FROM SYS_ROLE
where WHERE
id=#{id} ID=#{id}
</select> </select>
<select id="selectList" parameterType="pps.core.system.entity.SysRoleView" resultMap="BaseResultMap"> <select id="selectList" parameterType="pps.core.system.entity.SysRoleView" resultMap="BaseResultMap">
select SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from SYS_ROLE FROM SYS_ROLE
where WHERE
id=#{id} ID=#{id}
</select> </select>
<select id="selectSysRoleList" parameterType="pps.core.system.entity.SysRoleView" resultMap="BaseResultMap"> <select id="selectSysRoleList" parameterType="pps.core.system.entity.SysRoleView" resultMap="BaseResultMap">
select SELECT
id, ID,
role_name, ROLE_NAME,
sync_work_flow, SYNC_WORK_FLOW,
remark, REMARK,
media_type, MEDIA_TYPE,
sd.dic_name, SD.DIC_NAME,
ou_id, OU_ID,
so.ou_name, SO.OU_NAME,
sort, SORT,
is_inheritable, IS_INHERITABLE,
role_type, ROLE_TYPE,
is_overall IS_OVERALL
from SYS_ROLE sr FROM SYS_ROLE SR
left join SYS_ORGANIZATION so on sr.ou_id = so.id LEFT JOIN SYS_ORGANIZATION SO ON SR.OU_ID = SO.ID
left join SYS_DICTIONARY sd sr.media_type = sd.id LEFT JOIN SYS_DICTIONARY SD SR.MEDIA_TYPE = SD.ID
<where> <where>
ou_id = #{ouId} OU_ID = #{ouId}
<if test="mediaType != null and mediaType != ''"> <if test="mediaType != null and mediaType != ''">
AND sr.media_type = #{mediaType} AND SR.MEDIA_TYPE = #{mediaType}
</if> </if>
<if test="roleName != null and roleName != ''"> <if test="roleName != null and roleName != ''">
AND role_name like concat('%',#{roleName},'%') AND ROLE_NAME LIKE CONCAT('%',#{roleName},'%')
</if> </if>
</where> </where>
</select> </select>
<select id="selectSysRoleListByOuId" parameterType="pps.core.system.entity.SysRoleView" resultMap="BaseResultMap"> <select id="selectSysRoleListByOuId" parameterType="pps.core.system.entity.SysRoleView" resultMap="BaseResultMap">
select SELECT
sr.create_time, SR.CREATE_TIME,
sr.id, SR.ID,
sr.role_name, SR.ROLE_NAME,
sr.sync_work_flow, SR.SYNC_WORK_FLOW,
sr.remark, SR.REMARK,
sr.media_type, SR.MEDIA_TYPE,
(case when sr.media_type ='ALL' then 5 when sr.media_type ='LNG' then 4 when sr.media_type ='GAS' then 1 when (CASE WHEN SR.MEDIA_TYPE ='ALL' THEN 5 WHEN SR.MEDIA_TYPE ='LNG' THEN 4 WHEN SR.MEDIA_TYPE ='GAS' THEN 1 WHEN
sr.media_type ='OIL' then 2 when sr.media_type ='CPY' then 3 end) as media_type_sort, SR.MEDIA_TYPE ='OIL' THEN 2 WHEN SR.MEDIA_TYPE ='CPY' THEN 3 END) AS MEDIA_TYPE_SORT,
SR.OU_ID,
sr.ou_id, SO.OU_NAME,
so.ou_name, SR.SORT,
sr.sort, SR.IS_INHERITABLE,
sr.is_inheritable, SR.ROLE_TYPE,
sr.role_type, SR.IS_OVERALL
sr.is_overall FROM SYS_ROLE SR
from SYS_ROLE sr LEFT JOIN SYS_ORGANIZATION SO ON SR.OU_ID = SO.ID
left join SYS_ORGANIZATION so on sr.ou_id = so.id
<where> <where>
<if test="ouId != null and ouId != ''"> <if test="ouId != null and ouId != ''">
AND sr.ou_id = #{ouId} AND SR.OU_ID = #{ouId}
</if> </if>
<if test="mediaType != null and mediaType != ''"> <if test="mediaType != null and mediaType != ''">
AND sr.media_type like concat('%',#{mediaType},'%') AND SR.MEDIA_TYPE LIKE CONCAT('%',#{mediaType},'%')
</if> </if>
<if test="roleName != null and roleName != ''"> <if test="roleName != null and roleName != ''">
AND sr.role_name like concat('%',#{roleName},'%') AND SR.ROLE_NAME LIKE CONCAT('%',#{roleName},'%')
</if> </if>
<if test="mediaTypes != null and mediaTypes.size()>0"> <if test="mediaTypes != null and mediaTypes.size()>0">
AND sr.media_type in AND SR.MEDIA_TYPE IN
<foreach collection="mediaTypes" item="mediaType" open="(" separator="," close=")"> <foreach collection="mediaTypes" item="mediaType" open="(" separator="," close=")">
#{mediaType} #{mediaType}
</foreach> </foreach>
</if> </if>
</where> </where>
order by media_type_sort asc ,create_time desc ORDER BY MEDIA_TYPE_SORT ASC ,CREATE_TIME DESC
</select> </select>
<select id="selectExtendsSysRoleListByOuIds" resultType="pps.core.system.entity.SysRoleView"> <select id="selectExtendsSysRoleListByOuIds" resultType="pps.core.system.entity.SysRoleView">
select SELECT
sr.create_time, SR.CREATE_TIME,
sr.id, SR.ID,
sr.role_name, SR.ROLE_NAME,
sr.sync_work_flow, SR.SYNC_WORK_FLOW,
sr.remark, SR.REMARK,
sr.media_type, SR.MEDIA_TYPE,
sr.ou_id, SR.OU_ID,
so.ou_name, SO.OU_NAME,
sr.sort, SR.SORT,
sr.is_inheritable, SR.IS_INHERITABLE,
sr.role_type, SR.ROLE_TYPE,
sr.is_overall SR.IS_OVERALL
from SYS_ROLE sr FROM SYS_ROLE SR
left join SYS_ORGANIZATION so on sr.ou_id = so.id LEFT JOIN SYS_ORGANIZATION SO ON SR.OU_ID = SO.ID
<where> <where>
<if test="roleName != null and roleName != ''"> <if test="roleName != null and roleName != ''">
AND sr.role_name like concat('%',#{roleName},'%') AND SR.ROLE_NAME LIKE CONCAT('%',#{roleName},'%')
</if> </if>
<if test="isInheritable != null and isInheritable != ''"> <if test="isInheritable != null and isInheritable != ''">
AND sr.is_inheritable = #{isInheritable} AND SR.IS_INHERITABLE = #{isInheritable}
</if> </if>
<if test="mediaType != null and mediaType != ''"> <if test="mediaType != null and mediaType != ''">
AND sr.media_type = #{mediaType} AND SR.MEDIA_TYPE = #{mediaType}
</if> </if>
<if test="ouIds != null and ouIds.size()>0"> <if test="ouIds != null and ouIds.size()>0">
AND sr.ou_id in AND SR.OU_ID IN
<foreach collection="ouIds" item="ouId" open="(" separator="," close=")"> <foreach collection="ouIds" item="ouId" open="(" separator="," close=")">
#{ouId} #{ouId}
</foreach> </foreach>
</if> </if>
<if test="mediaTypes != null and mediaTypes.size()>0"> <if test="mediaTypes != null and mediaTypes.size()>0">
AND sr.media_type in AND SR.MEDIA_TYPE IN
<foreach collection="mediaTypes" item="mediaType" open="(" separator="," close=")"> <foreach collection="mediaTypes" item="mediaType" open="(" separator="," close=")">
#{mediaType} #{mediaType}
</foreach> </foreach>
</if> </if>
</where> </where>
order by sr.create_time desc ORDER BY SR.CREATE_TIME DESC
</select> </select>
<select id="selectUserWithRoleIds" resultType="pps.core.system.entity.SysRoleExtendView" <select id="selectUserWithRoleIds" resultType="pps.core.system.entity.SysRoleExtendView"
parameterType="pps.core.system.entity.SysRoleExtendView"> parameterType="pps.core.system.entity.SysRoleExtendView">
select SELECT
sr.ou_id as ouId, SR.OU_ID AS OUID,
so.ou_name as ouName, SO.OU_NAME AS OUNAME,
sr.id as roleId, SR.ID AS ROLEID,
sr.role_name as roleName, SR.ROLE_NAME AS ROLENAME,
surr.user_id as userId, SURR.USER_ID AS USERID,
su.user_name as userName SU.USER_NAME AS USERNAME
from SYS_USER_ROLE_REL surr FROM SYS_USER_ROLE_REL SURR
left join SYS_ROLE sr on sr.id = surr.role_id LEFT JOIN SYS_ROLE SR ON SR.ID = SURR.ROLE_ID
left join SYS_USER su on su.id = surr.user_id LEFT JOIN SYS_USER SU ON SU.ID = SURR.USER_ID
left join SYS_ORGANIZATION so on so.id = sr.ou_id LEFT JOIN SYS_ORGANIZATION SO ON SO.ID = SR.OU_ID
where sr.ou_id = #{ouId} WHERE SR.OU_ID = #{ouId}
<if test="roleIdList !=null and roleIdList.size()>0"> <if test="roleIdList !=null and roleIdList.size()>0">
and surr.role_id in AND SURR.ROLE_ID IN
<foreach collection="roleIdList" separator="," open="(" close=")" item="item"> <foreach collection="roleIdList" separator="," open="(" close=")" item="item">
#{item} #{item}
</foreach> </foreach>
...@@ -201,13 +201,13 @@ ...@@ -201,13 +201,13 @@
<select id="getRoleListNotInRoleIds" resultType="pps.core.system.entity.SysRoleExtendView" <select id="getRoleListNotInRoleIds" resultType="pps.core.system.entity.SysRoleExtendView"
parameterType="pps.core.system.entity.SysRoleExtendView"> parameterType="pps.core.system.entity.SysRoleExtendView">
select SELECT
sr.id as roleId, SR.ID AS ROLEID,
sr.role_name as roleName SR.ROLE_NAME AS ROLENAME
from SYS_ROLE sr FROM SYS_ROLE SR
<where> <where>
<if test="roleIdList !=null and roleIdList.size()>0"> <if test="roleIdList !=null and roleIdList.size()>0">
and sr.id not in AND SR.ID NOT IN
<foreach collection="roleIdList" separator="," open="(" close=")" item="item"> <foreach collection="roleIdList" separator="," open="(" close=")" item="item">
#{item} #{item}
</foreach> </foreach>
...@@ -217,13 +217,13 @@ ...@@ -217,13 +217,13 @@
<select id="getRoleListInRoleIds" resultType="pps.core.system.entity.SysRoleExtendView" <select id="getRoleListInRoleIds" resultType="pps.core.system.entity.SysRoleExtendView"
parameterType="pps.core.system.entity.SysRoleExtendView"> parameterType="pps.core.system.entity.SysRoleExtendView">
select SELECT
sr.id as roleId, SR.ID AS ROLEID,
sr.role_name as roleName SR.ROLE_NAME AS ROLENAME
from SYS_ROLE sr FROM SYS_ROLE SR
<where> <where>
<if test="roleIdList !=null and roleIdList.size()>0"> <if test="roleIdList !=null and roleIdList.size()>0">
and sr.id in AND SR.ID IN
<foreach collection="roleIdList" separator="," open="(" close=")" item="item"> <foreach collection="roleIdList" separator="," open="(" close=")" item="item">
#{item} #{item}
</foreach> </foreach>
...@@ -232,13 +232,13 @@ ...@@ -232,13 +232,13 @@
</select> </select>
<!-- 根据用户id查询该用户的所有角色id和名称--> <!-- 根据用户id查询该用户的所有角色id和名称-->
<select id="getRoleListUserId" parameterType="String" resultType="pps.core.system.entity.SysRoleExtendView"> <select id="getRoleListUserId" parameterType="String" resultType="pps.core.system.entity.SysRoleExtendView">
select sr.id as roleId, SELECT SR.ID AS ROLEID,
sr.role_name as roleName SR.ROLE_NAME AS ROLENAME
from SYS_ROLE sr, FROM SYS_ROLE SR,
SYS_USER_ROLE_REL sur, SYS_USER_ROLE_REL SUR,
SYS_USER su SYS_USER SU
where sr.id = sur.role_id WHERE SR.ID = SUR.ROLE_ID
and sur.user_id = su.id AND SUR.USER_ID = SU.ID
and su.id = #{userId} AND SU.ID = #{userId}
</select> </select>
</mapper> </mapper>
...@@ -2,89 +2,89 @@ ...@@ -2,89 +2,89 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pps.core.system.mapper.SysUserOrganizationRelViewMapper"> <mapper namespace="pps.core.system.mapper.SysUserOrganizationRelViewMapper">
<resultMap id="BaseResultMap" type="pps.core.system.entity.SysUserOrganizationRelView"> <resultMap id="BaseResultMap" type="pps.core.system.entity.SysUserOrganizationRelView">
<id column="id" property="id" jdbcType="VARCHAR"/> <id column="ID" property="id" />
<result column="ou_id" property="ouId" jdbcType="VARCHAR"/> <result column="OU_ID" property="ouId" />
<result column="user_id" property="userId" jdbcType="VARCHAR"/> <result column="USER_ID" property="userId" />
<result column="create_by_id" property="createById" jdbcType="VARCHAR"/> <result column="CREATE_BY_ID" property="createById" />
<result column="create_by_name" property="createByName" jdbcType="VARCHAR"/> <result column="CREATE_BY_NAME" property="createByName" />
<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/> <result column="CREATE_TIME" property="createTime" />
<result column="modify_by_id" property="modifyById" jdbcType="VARCHAR"/> <result column="MODIFY_BY_ID" property="modifyById" />
<result column="modify_by_name" property="modifyByName" jdbcType="VARCHAR"/> <result column="MODIFY_BY_NAME" property="modifyByName" />
<result column="modify_time" property="modifyTime" jdbcType="TIMESTAMP"/> <result column="MODIFY_TIME" property="modifyTime" />
<result column="effect_time" property="effectTime" jdbcType="TIMESTAMP"/> <result column="EFFECT_TIME" property="effectTime" />
<result column="end_time" property="endTime" jdbcType="TIMESTAMP"/> <result column="END_TIME" property="endTime" />
<result column="ou_name" property="ouName" jdbcType="VARCHAR"/> <result column="OU_NAME" property="ouName" />
<result column="station_id" property="stationId" jdbcType="VARCHAR"/> <result column="STATION_ID" property="stationId" />
<result column="station_name" property="stationName" jdbcType="VARCHAR"/> <result column="STATION_NAME" property="stationName" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id ID
, ,
ou_id, OU_ID,
user_id, USER_ID,
create_by_id, CREATE_BY_ID,
create_by_name, CREATE_BY_NAME,
create_time, CREATE_TIME,
modify_by_id, MODIFY_BY_ID,
modify_by_name, MODIFY_BY_NAME,
modify_time, MODIFY_TIME,
effect_time, EFFECT_TIME,
end_time END_TIME
</sql> </sql>
<select id="selectOne" parameterType="pps.core.system.entity.SysUserOrganizationRelView" resultMap="BaseResultMap"> <select id="selectOne" parameterType="pps.core.system.entity.SysUserOrganizationRelView" resultMap="BaseResultMap">
select SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from SYS_USER_ORGANIZATION_REL FROM SYS_USER_ORGANIZATION_REL
where WHERE
id=#{id} ID=#{id}
</select> </select>
<select id="selectList" parameterType="pps.core.system.entity.SysUserOrganizationRelView" resultMap="BaseResultMap"> <select id="selectList" parameterType="pps.core.system.entity.SysUserOrganizationRelView" resultMap="BaseResultMap">
select SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from SYS_USER_ORGANIZATION_REL FROM SYS_USER_ORGANIZATION_REL
where WHERE
id=#{id} ID=#{id}
</select> </select>
<select id="selectOrgList" parameterType="pps.core.system.entity.SysUserOrganizationRelView" <select id="selectOrgList" parameterType="pps.core.system.entity.SysUserOrganizationRelView"
resultType="pps.core.system.entity.SysOrganizationView"> resultType="pps.core.system.entity.SysOrganizationView">
select * SELECT *
from SYS_ORGANIZATION FROM SYS_ORGANIZATION
where is_deleted = 1 WHERE IS_DELETED = 1
</select> </select>
<select id="getSysOrganizationByUserId" parameterType="pps.core.system.entity.SysUserOrganizationRelView" <select id="getSysOrganizationByUserId" parameterType="pps.core.system.entity.SysUserOrganizationRelView"
resultMap="BaseResultMap"> resultMap="BaseResultMap">
select distinct suor.id, SELECT DISTINCT SUOR.ID,
suor.ou_id, SUOR.OU_ID,
so.ou_name, SO.OU_NAME,
suor.user_id, SUOR.USER_ID,
os.id as station_id, OS.ID AS STATION_ID,
os.station_name, OS.STATION_NAME,
os.station_code, OS.STATION_CODE,
os.medium_type OS.MEDIUM_TYPE
from SYS_USER_ORGANIZATION_REL suor FROM SYS_USER_ORGANIZATION_REL SUOR
left join SYS_ORGANIZATION so on suor.ou_id = so.id LEFT JOIN SYS_ORGANIZATION SO ON SUOR.OU_ID = SO.ID
left join base_station_ou_rel osor on suor.ou_id = osor.ou_id and osor.effect_time &lt;= #{endTime} and LEFT JOIN BASE_STATION_OU_REL OSOR ON SUOR.OU_ID = OSOR.OU_ID AND OSOR.EFFECT_TIME &lt;= #{endTime} AND
osor.end_time &gt;= #{endTime} OSOR.END_TIME &gt;= #{endTime}
left join base_station os on osor.station_id = os.id LEFT JOIN BASE_STATION OS ON OSOR.STATION_ID = OS.ID
where so.is_deleted = 1 WHERE SO.IS_DELETED = 1
and suor.user_id = #{userId} AND SUOR.USER_ID = #{userId}
and suor.effect_time &lt;= #{endTime} AND SUOR.EFFECT_TIME &lt;= #{endTime}
and suor.end_time &gt;= #{endTime} AND SUOR.END_TIME &gt;= #{endTime}
order by station_id desc ORDER BY STATION_ID DESC
</select> </select>
<!--获取用户组织--> <!--获取用户组织-->
<select id="getOrgListByUserId" parameterType="pps.core.system.entity.SysUserOrganizationRelView" <select id="getOrgListByUserId" parameterType="pps.core.system.entity.SysUserOrganizationRelView"
resultMap="BaseResultMap"> resultMap="BaseResultMap">
select suor.ou_id, SELECT SUOR.OU_ID,
so.ou_name SO.OU_NAME
from SYS_USER_ORGANIZATION_REL suor FROM SYS_USER_ORGANIZATION_REL SUOR
left join SYS_ORGANIZATION so on suor.ou_id = so.id LEFT JOIN SYS_ORGANIZATION SO ON SUOR.OU_ID = SO.ID
where so.is_deleted = 1 WHERE SO.IS_DELETED = 1
and suor.user_id = #{userId} AND SUOR.USER_ID = #{userId}
and suor.effect_time &lt;= now() AND SUOR.EFFECT_TIME &lt;= NOW()
and suor.end_time &gt;= now() AND SUOR.END_TIME &gt;= NOW()
order by so.create_time desc ORDER BY SO.CREATE_TIME DESC
</select> </select>
</mapper> </mapper>
...@@ -2,102 +2,107 @@ ...@@ -2,102 +2,107 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pps.core.system.mapper.SysUserRoleRelViewMapper"> <mapper namespace="pps.core.system.mapper.SysUserRoleRelViewMapper">
<resultMap id="BaseResultMap" type="pps.core.system.entity.SysUserRoleRelView"> <resultMap id="BaseResultMap" type="pps.core.system.entity.SysUserRoleRelView">
<id column="id" property="id" jdbcType="VARCHAR"/> <id column="ID" property="id" />
<result column="role_id" property="roleId" jdbcType="VARCHAR"/> <result column="ROLE_ID" property="roleId" />
<result column="role_name" property="roleName" jdbcType="VARCHAR"/> <result column="ROLE_NAME" property="roleName" />
<result column="user_id" property="userId" jdbcType="VARCHAR"/> <result column="USER_ID" property="userId" />
<result column="login_name" property="loginName" jdbcType="VARCHAR"/> <result column="LOGIN_NAME" property="loginName" />
<result column="user_name" property="userName" jdbcType="VARCHAR"/> <result column="USER_NAME" property="userName" />
<result column="ou_id" property="ouId" jdbcType="VARCHAR"/> <result column="OU_ID" property="ouId" />
<result column="ou_name" property="ouName" jdbcType="VARCHAR"/> <result column="OU_NAME" property="ouName" />
<result column="concat_ou_name" property="concatOuName" jdbcType="VARCHAR"/> <result column="CONCAT_OU_NAME" property="concatOuName" />
<result column="create_by_id" property="createById" jdbcType="VARCHAR"/> <result column="CREATE_BY_ID" property="createById" />
<result column="create_by_name" property="createByName" jdbcType="VARCHAR"/> <result column="CREATE_BY_NAME" property="createByName" />
<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/> <result column="CREATE_TIME" property="createTime" />
<result column="modify_by_id" property="modifyById" jdbcType="VARCHAR"/> <result column="MODIFY_BY_ID" property="modifyById" />
<result column="modify_by_name" property="modifyByName" jdbcType="VARCHAR"/> <result column="MODIFY_BY_NAME" property="modifyByName" />
<result column="modify_time" property="modifyTime" jdbcType="TIMESTAMP"/> <result column="MODIFY_TIME" property="modifyTime" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id ID
, ,
role_id, ROLE_ID,
user_id, USER_ID,
ou_id OU_ID
</sql> </sql>
<select id="selectOne" parameterType="pps.core.system.entity.SysUserRoleRelView" resultMap="BaseResultMap"> <select id="selectOne" parameterType="pps.core.system.entity.SysUserRoleRelView" resultMap="BaseResultMap">
select SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from SYS_USER_ROLE_REL FROM SYS_USER_ROLE_REL
where WHERE
id=#{id} ID=#{id}
</select> </select>
<select id="selectList" parameterType="pps.core.system.entity.SysUserRoleRelView" resultMap="BaseResultMap"> <select id="selectList" parameterType="pps.core.system.entity.SysUserRoleRelView" resultMap="BaseResultMap">
select b.id,b.role_id ,a.role_name SELECT B.ID,B.ROLE_ID ,A.ROLE_NAME
from SYS_ROLE a ,SYS_USER_ROLE_REL b FROM SYS_ROLE A ,SYS_USER_ROLE_REL B
where a.id =b.role_id and b.user_id =#{userId} WHERE A.ID =B.ROLE_ID AND B.USER_ID =#{userId}
<if test="roleName!=null and roleName!='' "> <if test="roleName!=null and roleName!='' ">
and a.role_name like concat('%',#{roleName,jdbcType=VARCHAR},'%') AND A.ROLE_NAME LIKE CONCAT('%',#{roleName,jdbcType=VARCHAR},'%')
</if> </if>
</select> </select>
<select id="selectUserList" parameterType="pps.core.system.entity.SysUserRoleRelView" resultMap="BaseResultMap"> <select id="selectUserList" parameterType="pps.core.system.entity.SysUserRoleRelView" resultMap="BaseResultMap">
select a.login_name, a.user_name, a.iam_login_name SELECT A.LOGIN_NAME, A.USER_NAME, A.IAM_LOGIN_NAME
from SYS_USER a, FROM SYS_USER A,
SYS_USER_ROLE_REL b, SYS_USER_ROLE_REL B,
SYS_USER_ORGANIZATION_REL c SYS_USER_ORGANIZATION_REL C
where a.id = b.user_id WHERE A.ID = B.USER_ID
and a.id = c.user_id AND A.ID = C.USER_ID
and b.role_id = #{roleId} AND B.ROLE_ID = #{roleId}
and c.end_time > now() AND C.END_TIME > NOW()
and c.ou_id in (select ou_id AND C.OU_ID IN (SELECT OU_ID
from SYS_ORGANIZATION_REL sor, FROM SYS_ORGANIZATION_REL SOR,
SYS_ORGANIZATION so SYS_ORGANIZATION SO
where sor.ou_id = so.id WHERE SOR.OU_ID = SO.ID
and so.ou_level in ('OFFICE_KS', 'OFFICE_CS', #{ouLevel,jdbcType=VARCHAR}) AND SO.OU_LEVEL IN ('OFFICE_KS', 'OFFICE_CS', #{ouLevel,jdbcType=VARCHAR})
and ou_id_path like concat('%', #{ouId,jdbcType=VARCHAR}, '%') AND OU_ID_PATH LIKE CONCAT('%', #{ouId,jdbcType=VARCHAR}, '%')
and sor.effect_time &lt;= now() AND SOR.EFFECT_TIME &lt;= NOW()
and sor.end_time &gt;= now()) AND SOR.END_TIME &gt;= NOW())
</select> </select>
<select id="selectListByRoleId" parameterType="pps.core.system.entity.SysUserRoleRelView" resultMap="BaseResultMap"> <select id="selectListByRoleId" parameterType="pps.core.system.entity.SysUserRoleRelView" resultMap="BaseResultMap">
select SELECT
surr.id, SURR.ID,
sr.id as role_id, SR.ID AS ROLE_ID,
sr.role_name, SR.ROLE_NAME,
su.id as user_id, SU.ID AS USER_ID,
su.user_name, SU.USER_NAME,
so.id as ou_id, SO.ID AS OU_ID,
so.ou_name, SO.OU_NAME,
su.login_name, SU.LOGIN_NAME,
concat_ws('->', so2.ou_name, so.ou_name) as concat_ou_name CONCAT_WS('->', SO2.OU_NAME, SO.OU_NAME) AS CONCAT_OU_NAME
from SYS_ROLE sr FROM SYS_ROLE SR
left join SYS_USER_ROLE_REL surr on sr.id =surr.role_id LEFT JOIN SYS_USER_ROLE_REL SURR ON SR.ID =SURR.ROLE_ID
left join SYS_USER su on surr.user_id =su.id LEFT JOIN SYS_USER SU ON SURR.USER_ID =SU.ID
left join SYS_USER_ORGANIZATION_REL suor on su.id = suor.user_id LEFT JOIN SYS_USER_ORGANIZATION_REL SUOR ON SU.ID = SUOR.USER_ID
left join SYS_ORGANIZATION so on suor.ou_id = so.id LEFT JOIN SYS_ORGANIZATION SO ON SUOR.OU_ID = SO.ID
left join SYS_ORGANIZATION_REL sor on so.id = sor.ou_id LEFT JOIN SYS_ORGANIZATION_REL SOR ON SO.ID = SOR.OU_ID
left join SYS_ORGANIZATION so2 on sor.parent_ou_id = so2.id LEFT JOIN SYS_ORGANIZATION SO2 ON SOR.PARENT_OU_ID = SO2.ID
where sr.id =#{roleId} and sor.effect_time &lt;= #{endTime} and sor.end_time &gt;= #{endTime} and WHERE SR.ID =#{roleId} AND SOR.EFFECT_TIME &lt;= #{endTime} AND SOR.END_TIME &gt;= #{endTime} AND
suor.effect_time &lt;= #{endTime} and suor.end_time &gt;= #{endTime} SUOR.EFFECT_TIME &lt;= #{endTime} AND SUOR.END_TIME &gt;= #{endTime}
<if test="userName != null and userName != ''"> <if test="userName != null and userName != ''">
AND su.user_name like concat('%',#{userName},'%') AND SU.USER_NAME LIKE CONCAT('%',#{userName},'%')
</if> </if>
<if test="loginName != null and loginName != ''"> <if test="loginName != null and loginName != ''">
AND su.login_name like concat('%',#{loginName},'%') AND SU.LOGIN_NAME LIKE CONCAT('%',#{loginName},'%')
</if> </if>
order by so2.ou_name asc ORDER BY SO2.OU_NAME ASC
</select> </select>
<select id="selectListByUserId" parameterType="pps.core.system.entity.SysUserRoleRelView" resultMap="BaseResultMap"> <select id="selectListByUserId" parameterType="pps.core.system.entity.SysUserRoleRelView" resultMap="BaseResultMap">
select SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from SYS_USER_ROLE_REL FROM SYS_USER_ROLE_REL
where WHERE
user_id=#{userId} USER_ID=#{userId}
</select> </select>
<insert id="batchInsert" parameterType="java.util.List"> <insert id="batchInsert" parameterType="java.util.List">
insert into SYS_USER_ROLE_REL (id,role_id,user_id,ou_id,create_by_id,create_by_name,create_time) INSERT INTO SYS_USER_ROLE_REL (ID,ROLE_ID,USER_ID,OU_ID,CREATE_BY_ID,CREATE_BY_NAME,CREATE_TIME)
values VALUES
<foreach collection="list" item="userRole" separator=","> <foreach collection="list" item="userRole" separator=",">
(#{userRole.id}, #{userRole.roleId}, #{userRole.userId}, #{userRole.ouId}, #{userRole.createById}, (#{userRole.id}, #{userRole.roleId}, #{userRole.userId}, #{userRole.ouId}, #{userRole.createById},
#{userRole.createByName}, #{userRole.createTime}) #{userRole.createByName}, #{userRole.createTime})
...@@ -106,17 +111,17 @@ ...@@ -106,17 +111,17 @@
<select id="selectListByRoleIds" parameterType="pps.core.system.entity.SysUserRoleRelView" <select id="selectListByRoleIds" parameterType="pps.core.system.entity.SysUserRoleRelView"
resultMap="BaseResultMap"> resultMap="BaseResultMap">
select distinct SELECT DISTINCT
su.id , SU.ID ,
su.user_name, SU.USER_NAME,
su.login_name, SU.LOGIN_NAME,
su.phone SU.PHONE
from SYS_ROLE sr FROM SYS_ROLE SR
left join SYS_USER_ROLE_REL surr on sr.id =surr.role_id LEFT JOIN SYS_USER_ROLE_REL SURR ON SR.ID =SURR.ROLE_ID
left join SYS_USER su on surr.user_id =su.id LEFT JOIN SYS_USER SU ON SURR.USER_ID =SU.ID
<where> <where>
<if test="roleIds != null and roleIds.size()>0"> <if test="roleIds != null and roleIds.size()>0">
and sr.id in AND SR.ID IN
<foreach collection="roleIds" open="(" close=")" item="item" separator=","> <foreach collection="roleIds" open="(" close=")" item="item" separator=",">
#{item} #{item}
</foreach> </foreach>
...@@ -126,51 +131,51 @@ ...@@ -126,51 +131,51 @@
<select id="selectListByRoleIdAndOuId" parameterType="pps.core.system.entity.SysUserRoleRelView" <select id="selectListByRoleIdAndOuId" parameterType="pps.core.system.entity.SysUserRoleRelView"
resultMap="BaseResultMap"> resultMap="BaseResultMap">
select distinct su.id, SELECT DISTINCT SU.ID,
su.user_name, SU.USER_NAME,
su.login_name, SU.LOGIN_NAME,
su.phone SU.PHONE
from SYS_ROLE sr FROM SYS_ROLE SR
left join SYS_USER_ROLE_REL surr on sr.id = surr.role_id LEFT JOIN SYS_USER_ROLE_REL SURR ON SR.ID = SURR.ROLE_ID
left join SYS_USER su on surr.user_id = su.id LEFT JOIN SYS_USER SU ON SURR.USER_ID = SU.ID
left join SYS_USER_ORGANIZATION_REL suor on su.id = suor.user_id LEFT JOIN SYS_USER_ORGANIZATION_REL SUOR ON SU.ID = SUOR.USER_ID
where sr.id = #{roleId} WHERE SR.ID = #{roleId}
and suor.ou_id = #{ouId} AND SUOR.OU_ID = #{ouId}
</select> </select>
<select id="selectListByRoleIdAndOuIds" parameterType="pps.core.system.entity.SysUserRoleRelView" <select id="selectListByRoleIdAndOuIds" parameterType="pps.core.system.entity.SysUserRoleRelView"
resultMap="BaseResultMap"> resultMap="BaseResultMap">
select SELECT
surr.id, SURR.ID,
sr.id as role_id, SR.ID AS ROLE_ID,
sr.role_name, SR.ROLE_NAME,
su.id as user_id, SU.ID AS USER_ID,
su.user_name, SU.USER_NAME,
so.id as ou_id, SO.ID AS OU_ID,
so.ou_name, SO.OU_NAME,
su.login_name, SU.LOGIN_NAME,
concat_ws('->', so2.ou_name, so.ou_name) as concat_ou_name CONCAT_WS('->', SO2.OU_NAME, SO.OU_NAME) AS CONCAT_OU_NAME
from SYS_ROLE sr FROM SYS_ROLE SR
left join SYS_USER_ROLE_REL surr on sr.id =surr.role_id LEFT JOIN SYS_USER_ROLE_REL SURR ON SR.ID =SURR.ROLE_ID
left join SYS_USER su on surr.user_id =su.id LEFT JOIN SYS_USER SU ON SURR.USER_ID =SU.ID
left join SYS_USER_ORGANIZATION_REL suor on su.id = suor.user_id LEFT JOIN SYS_USER_ORGANIZATION_REL SUOR ON SU.ID = SUOR.USER_ID
left join SYS_ORGANIZATION so on suor.ou_id = so.id LEFT JOIN SYS_ORGANIZATION SO ON SUOR.OU_ID = SO.ID
left join SYS_ORGANIZATION_REL sor on so.id = sor.ou_id LEFT JOIN SYS_ORGANIZATION_REL SOR ON SO.ID = SOR.OU_ID
left join SYS_ORGANIZATION so2 on sor.parent_ou_id = so2.id LEFT JOIN SYS_ORGANIZATION SO2 ON SOR.PARENT_OU_ID = SO2.ID
<where> <where>
sor.effect_time &lt;= #{endTime} and sor.end_time &gt;= #{endTime} and suor.effect_time &lt;= #{endTime} and SOR.EFFECT_TIME &lt;= #{endTime} AND SOR.END_TIME &gt;= #{endTime} AND SUOR.EFFECT_TIME &lt;= #{endTime} AND
suor.end_time &gt;= #{endTime} SUOR.END_TIME &gt;= #{endTime}
<if test="roleId != null and roleId !=''"> <if test="roleId != null and roleId !=''">
and sr.id =#{roleId} AND SR.ID =#{roleId}
</if> </if>
<if test="ouIds != null and ouIds.size()>0"> <if test="ouIds != null and ouIds.size()>0">
and suor.ou_id in AND SUOR.OU_ID IN
<foreach collection="ouIds" open="(" close=")" item="ouId" separator=","> <foreach collection="ouIds" open="(" close=")" item="ouId" separator=",">
#{ouId} #{ouId}
</foreach> </foreach>
</if> </if>
</where> </where>
order by so2.ou_name asc ORDER BY SO2.OU_NAME ASC
</select> </select>
</mapper> </mapper>
...@@ -2,258 +2,258 @@ ...@@ -2,258 +2,258 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pps.core.system.mapper.SysUserViewMapper"> <mapper namespace="pps.core.system.mapper.SysUserViewMapper">
<resultMap id="BaseResultMap" type="pps.core.system.entity.SysUserView"> <resultMap id="BaseResultMap" type="pps.core.system.entity.SysUserView">
<id column="id" property="id" jdbcType="VARCHAR"/> <id column="ID" property="id"/>
<result column="user_name" property="userName" jdbcType="VARCHAR"/> <result column="USER_NAME" property="userName"/>
<result column="user_domain" property="userDomain" jdbcType="VARCHAR"/> <result column="USER_DOMAIN" property="userDomain"/>
<result column="user_code" property="userCode" jdbcType="VARCHAR"/> <result column="USER_CODE" property="userCode"/>
<result column="user_type" property="userType" jdbcType="INTEGER"/> <result column="USER_TYPE" property="userType"/>
<result column="phone" property="phone" jdbcType="VARCHAR"/> <result column="PHONE" property="phone"/>
<result column="email" property="email" jdbcType="VARCHAR"/> <result column="EMAIL" property="email"/>
<result column="login_name" property="loginName" jdbcType="VARCHAR"/> <result column="LOGIN_NAME" property="loginName"/>
<result column="is_super_admin" property="isSuperAdmin" jdbcType="INTEGER"/> <result column="IS_SUPER_ADMIN" property="isSuperAdmin"/>
<result column="identify_no" property="identifyNo" jdbcType="VARCHAR"/> <result column="IDENTIFY_NO" property="identifyNo"/>
<result column="remark" property="remark" jdbcType="VARCHAR"/> <result column="REMARK" property="remark"/>
<result column="end_date" property="endDate" jdbcType="TIMESTAMP"/> <result column="END_DATE" property="endDate"/>
<result column="password" property="password" jdbcType="VARCHAR"/> <result column="PASSWORD" property="password"/>
<result column="duty" property="duty" jdbcType="VARCHAR"/> <result column="DUTY" property="duty"/>
<result column="sign_image" property="signImage" jdbcType="LONGVARCHAR"/> <result column="SIGN_IMAGE" property="signImage"/>
<result column="prompt_mode" property="promptMode" jdbcType="VARCHAR"/> <result column="PROMPT_MODE" property="promptMode"/>
<result column="cert" property="cert" jdbcType="LONGVARCHAR"/> <result column="CERT" property="cert"/>
<result column="sort" property="sort" jdbcType="INTEGER"/> <result column="SORT" property="sort"/>
<result column="ca_begin_date" property="caBeginDate" jdbcType="TIMESTAMP"/> <result column="CA_BEGIN_DATE" property="caBeginDate"/>
<result column="ca_end_date" property="caEndDate" jdbcType="TIMESTAMP"/> <result column="CA_END_DATE" property="caEndDate"/>
<result column="iam_login_name" property="iamLoginName" jdbcType="VARCHAR"/> <result column="IAM_LOGIN_NAME" property="iamLoginName"/>
<result column="last_login_time" property="lastLoginTime" jdbcType="TIMESTAMP"/> <result column="LAST_LOGIN_TIME" property="lastLoginTime"/>
<result column="job_desc" property="jobDesc" jdbcType="VARCHAR"/> <result column="JOB_DESC" property="jobDesc"/>
<result column="fax_no" property="faxNo" jdbcType="VARCHAR"/> <result column="FAX_NO" property="faxNo"/>
<result column="postal_code" property="postalCode" jdbcType="VARCHAR"/> <result column="POSTAL_CODE" property="postalCode"/>
<result column="address" property="address" jdbcType="VARCHAR"/> <result column="ADDRESS" property="address"/>
<result column="create_by_id" property="createById" jdbcType="VARCHAR"/> <result column="CREATE_BY_ID" property="createById"/>
<result column="create_by_name" property="createByName" jdbcType="VARCHAR"/> <result column="CREATE_BY_NAME" property="createByName"/>
<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/> <result column="CREATE_TIME" property="createTime"/>
<result column="modify_by_id" property="modifyById" jdbcType="VARCHAR"/> <result column="MODIFY_BY_ID" property="modifyById"/>
<result column="modify_by_name" property="modifyByName" jdbcType="VARCHAR"/> <result column="MODIFY_BY_NAME" property="modifyByName"/>
<result column="modify_time" property="modifyTime" jdbcType="TIMESTAMP"/> <result column="MODIFY_TIME" property="modifyTime"/>
<result column="ou_id" property="ouId" jdbcType="VARCHAR"/> <result column="OU_ID" property="ouId"/>
<result column="ou_name" property="ouName" jdbcType="VARCHAR"/> <result column="OU_NAME" property="ouName"/>
<result column="concat_ou_name" property="concatOuName" jdbcType="VARCHAR"/> <result column="CONCAT_OU_NAME" property="concatOuName"/>
<result column="is_outer" property="isOuter" jdbcType="INTEGER"/> <result column="IS_OUTER" property="isOuter"/>
<result column="is_inner" property="isInner" jdbcType="INTEGER"/> <result column="IS_INNER" property="isInner"/>
</resultMap> </resultMap>
<resultMap id="TradeResultMap" type="pps.core.system.entity.SysUserTradeView"> <resultMap id="TradeResultMap" type="pps.core.system.entity.SysUserTradeView">
<result column="user_name" property="userName" jdbcType="VARCHAR"/> <result column="USER_NAME" property="userName"/>
<result column="login_name" property="loginName" jdbcType="VARCHAR"/> <result column="LOGIN_NAME" property="loginName"/>
<result column="ou_name" property="ouName" jdbcType="VARCHAR"/> <result column="OU_NAME" property="ouName"/>
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id ID
, ,
user_name, USER_NAME,
user_domain, USER_DOMAIN,
user_code, USER_CODE,
user_type, USER_TYPE,
phone, PHONE,
email, EMAIL,
login_name, LOGIN_NAME,
is_super_admin, IS_SUPER_ADMIN,
identify_no, IDENTIFY_NO,
remark, REMARK,
end_date, END_DATE,
password, PASSWORD,
duty, DUTY,
sign_image, SIGN_IMAGE,
prompt_mode, PROMPT_MODE,
cert, CERT,
sort, SORT,
ca_begin_date, CA_BEGIN_DATE,
ca_end_date, CA_END_DATE,
iam_login_name, IAM_LOGIN_NAME,
last_login_time, LAST_LOGIN_TIME,
job_desc, JOB_DESC,
fax_no, FAX_NO,
postal_code, POSTAL_CODE,
address, ADDRESS,
create_by_id, CREATE_BY_ID,
create_by_name, CREATE_BY_NAME,
create_time, CREATE_TIME,
modify_by_id, MODIFY_BY_ID,
modify_by_name, MODIFY_BY_NAME,
modify_time MODIFY_TIME
</sql> </sql>
<select id="selectOne" parameterType="pps.core.system.entity.SysUserView" resultMap="BaseResultMap"> <select id="selectOne" parameterType="pps.core.system.entity.SysUserView" resultMap="BaseResultMap">
select SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from SYS_USER FROM SYS_USER
where WHERE
id=#{id} ID=#{id}
</select> </select>
<select id="selectList" parameterType="pps.core.system.entity.SysUserView" resultMap="BaseResultMap"> <select id="selectList" parameterType="pps.core.system.entity.SysUserView" resultMap="BaseResultMap">
select SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from SYS_USER FROM SYS_USER
where WHERE
id=#{id} ID=#{id}
</select> </select>
<select id="selectSysUserListByOuId" parameterType="pps.core.system.entity.SysUserView" resultMap="BaseResultMap"> <select id="selectSysUserListByOuId" parameterType="pps.core.system.entity.SysUserView" resultMap="BaseResultMap">
SELECT
select SU.ID,
su.id, SU.USER_NAME,
su.user_name, SU.IAM_LOGIN_NAME,
su.iam_login_name, SU.USER_CODE,
su.user_code, SU.USER_TYPE,
su.user_type, SU.PHONE,
su.phone, SU.EMAIL,
su.email, SU.LOGIN_NAME,
su.login_name, SU.IS_SUPER_ADMIN,
su.is_super_admin, SU.IDENTIFY_NO,
su.identify_no, SU.REMARK,
su.remark, SU.DUTY,
su.duty, SU.SORT,
su.sort, SU.JOB_DESC,
su.job_desc, SU.FAX_NO,
su.fax_no, SU.POSTAL_CODE,
su.postal_code, SU.ADDRESS,
su.address, SU.IS_INNER,
su.is_inner, SU.IS_OUTER,
su.is_outer, SU.IS_TRADE,
su.is_trade, SUOR.OU_ID,
suor.ou_id, SO.OU_NAME,
so.ou_name, SU.STATUS,
su.status, CONCAT_WS('->',SO2.OU_NAME,SO.OU_NAME) AS CONCAT_OU_NAME
concat_ws('->',so2.ou_name,so.ou_name) as concat_ou_name FROM SYS_USER SU
from SYS_USER su LEFT JOIN SYS_USER_ORGANIZATION_REL SUOR ON SUOR.USER_ID=SU.ID
left join SYS_USER_ORGANIZATION_REL suor on suor.user_id=su.id LEFT JOIN SYS_ORGANIZATION SO ON SUOR.OU_ID=SO.ID
left join SYS_ORGANIZATION so on suor.ou_id=so.id LEFT JOIN SYS_ORGANIZATION_REL SOR ON SO.ID=SOR.OU_ID
left join SYS_ORGANIZATION_REL sor on so.id=sor.ou_id LEFT JOIN SYS_ORGANIZATION SO2 ON SOR.PARENT_OU_ID=SO2.ID
left join SYS_ORGANIZATION so2 on sor.parent_ou_id=so2.id
<where> <where>
suor.end_time &gt;= #{endTime} SUOR.END_TIME &gt;= #{endTime}
and sor.end_time &gt;= #{endTime} AND SOR.END_TIME &gt;= #{endTime}
and so.is_deleted=1 AND SO.IS_DELETED=1
<if test="isInner != null and isInner != ''"> <if test="isInner != null and isInner != ''">
AND su.is_inner =#{isInner} AND SU.IS_INNER =#{isInner}
</if> </if>
<if test="isOuter != null and isOuter != ''"> <if test="isOuter != null and isOuter != ''">
AND su.is_outer =#{isOuter} AND SU.IS_OUTER =#{isOuter}
</if> </if>
<if test="ouId != null and ouId != ''"> <if test="ouId != null and ouId != ''">
AND suor.ou_id =#{ouId} AND SUOR.OU_ID =#{ouId}
</if> </if>
<if test="userType != null and userType != ''"> <if test="userType != null and userType != ''">
AND su.user_type =#{userType} AND SU.USER_TYPE =#{userType}
</if> </if>
<if test="userName != null and userName != ''"> <if test="userName != null and userName != ''">
AND su.user_name like concat('%',#{userName},'%') AND SU.USER_NAME LIKE CONCAT('%',#{userName},'%')
</if> </if>
<if test="loginName != null and loginName != ''"> <if test="loginName != null and loginName != ''">
AND su.login_name like concat('%',#{loginName},'%') AND SU.LOGIN_NAME LIKE CONCAT('%',#{loginName},'%')
</if> </if>
<if test="ouIds != null and ouIds.size()>0"> <if test="ouIds != null and ouIds.size()>0">
AND suor.ou_id in AND SUOR.OU_ID IN
<foreach collection="ouIds" separator="," item="item" close=")" open="("> <foreach collection="ouIds" separator="," item="item" close=")" open="(">
#{item} #{item}
</foreach> </foreach>
</if> </if>
<if test="status != null and status != ''"> <if test="status != null and status != ''">
AND su.status =#{status} AND SU.STATUS =#{status}
</if> </if>
</where> </where>
order by su.create_time desc,su.id desc ORDER BY SU.CREATE_TIME DESC,SU.ID DESC
</select> </select>
<select id="selectSysUserListByNoOuId" parameterType="pps.core.system.entity.SysUserView" resultMap="BaseResultMap"> <select id="selectSysUserListByNoOuId" parameterType="pps.core.system.entity.SysUserView" resultMap="BaseResultMap">
SELECT
select SU.ID,
su.id, SU.USER_NAME,
su.user_name, SU.IAM_LOGIN_NAME,
su.iam_login_name, SU.USER_CODE,
su.user_code, SU.USER_TYPE,
su.user_type, SU.PHONE,
su.phone, SU.EMAIL,
su.email, SU.LOGIN_NAME,
su.login_name, SU.IS_SUPER_ADMIN,
su.is_super_admin, SU.IDENTIFY_NO,
su.identify_no, SU.REMARK,
su.remark, SU.DUTY,
su.duty, SU.SORT,
su.sort, SU.JOB_DESC,
su.job_desc, SU.FAX_NO,
su.fax_no, SU.POSTAL_CODE,
su.postal_code, SU.ADDRESS,
su.address, SU.IS_INNER,
su.is_inner, SU.IS_OUTER,
su.is_outer, SU.IS_TRADE,
su.is_trade, SUOR.OU_ID,
suor.ou_id, SO.OU_NAME,
so.ou_name, SU.STATUS,
su.status, CONCAT_WS('->',SO2.OU_NAME,SO.OU_NAME) AS CONCAT_OU_NAME
concat_ws('->',so2.ou_name,so.ou_name) as concat_ou_name FROM SYS_USER SU
from SYS_USER su LEFT JOIN SYS_USER_ORGANIZATION_REL SUOR ON SUOR.USER_ID=SU.ID
left join SYS_USER_ORGANIZATION_REL suor on suor.user_id=su.id LEFT JOIN SYS_ORGANIZATION SO ON SUOR.OU_ID=SO.ID
left join SYS_ORGANIZATION so on suor.ou_id=so.id LEFT JOIN SYS_ORGANIZATION_REL SOR ON SO.ID=SOR.OU_ID
left join SYS_ORGANIZATION_REL sor on so.id=sor.ou_id LEFT JOIN SYS_ORGANIZATION SO2 ON SOR.PARENT_OU_ID=SO2.ID
left join SYS_ORGANIZATION so2 on sor.parent_ou_id=so2.id
<where> <where>
<if test="hasOuId != null and hasOuId != '' and hasOuId == '1'.toString()"> <if test="hasOuId != null and hasOuId != '' and hasOuId == '1'.toString()">
and suor.end_time &gt;= #{endTime} AND SUOR.END_TIME &gt;= #{endTime}
and sor.end_time &gt;= #{endTime} AND SOR.END_TIME &gt;= #{endTime}
and so.is_deleted=1 AND SO.IS_DELETED=1
and suor.user_id is not null AND SUOR.USER_ID IS NOT NULL
</if> </if>
<if test="hasOuId != null and hasOuId != '' and hasOuId == '0'.toString()"> <if test="hasOuId != null and hasOuId != '' and hasOuId == '0'.toString()">
and suor.user_id is null AND SUOR.USER_ID IS NULL
</if> </if>
<if test="isInner != null and isInner != ''"> <if test="isInner != null and isInner != ''">
AND su.is_inner =#{isInner} AND SU.IS_INNER =#{isInner}
</if> </if>
<if test="isOuter != null and isOuter != ''"> <if test="isOuter != null and isOuter != ''">
AND su.is_outer =#{isOuter} AND SU.IS_OUTER =#{isOuter}
</if> </if>
<if test="userType != null and userType != ''"> <if test="userType != null and userType != ''">
AND su.user_type =#{userType} AND SU.USER_TYPE =#{userType}
</if> </if>
<if test="userName != null and userName != ''"> <if test="userName != null and userName != ''">
AND su.user_name like concat('%',#{userName},'%') AND SU.USER_NAME LIKE CONCAT('%',#{userName},'%')
</if> </if>
<if test="loginName != null and loginName != ''"> <if test="loginName != null and loginName != ''">
AND su.login_name like concat('%',#{loginName},'%') AND SU.LOGIN_NAME LIKE CONCAT('%',#{loginName},'%')
</if> </if>
<if test="status != null and status != ''"> <if test="status != null and status != ''">
AND su.status =#{status} AND SU.STATUS =#{status}
</if> </if>
</where> </where>
order by su.create_time desc,su.id desc ORDER BY SU.CREATE_TIME DESC,SU.ID DESC
</select> </select>
<select id="getSysUserListByOuId" parameterType="pps.core.system.entity.SysUserView" resultMap="BaseResultMap"> <select id="getSysUserListByOuId" parameterType="pps.core.system.entity.SysUserView" resultMap="BaseResultMap">
select distinct SELECT DISTINCT
su.id, SU.ID,
su.user_name, SU.USER_NAME,
su.duty, SU.DUTY,
su.phone SU.PHONE
from SYS_USER su FROM SYS_USER SU
left join SYS_USER_ORGANIZATION_REL suor on suor.user_id=su.id LEFT JOIN SYS_USER_ORGANIZATION_REL SUOR ON SUOR.USER_ID=SU.ID
<where> <where>
<if test="ouId != null and ouId != ''"> <if test="ouId != null and ouId != ''">
AND suor.ou_id = #{ouId} AND SUOR.OU_ID = #{ouId}
</if> </if>
</where> </where>
</select> </select>
<select id="getSysUserListByOuIds" parameterType="pps.core.system.entity.SysUserView" resultMap="BaseResultMap"> <select id="getSysUserListByOuIds" parameterType="pps.core.system.entity.SysUserView" resultMap="BaseResultMap">
select distinct SELECT DISTINCT
su.id, SU.ID,
su.user_name, SU.USER_NAME,
su.duty, SU.DUTY,
su.phone SU.PHONE
from SYS_USER su FROM SYS_USER SU
left join SYS_USER_ORGANIZATION_REL suor on suor.user_id=su.id LEFT JOIN SYS_USER_ORGANIZATION_REL SUOR ON SUOR.USER_ID=SU.ID
<where> <where>
<if test="ouIds != null and ouIds.size()>0"> <if test="ouIds != null and ouIds.size()>0">
and su.phone is not null and suor.ou_id in AND SU.PHONE IS NOT NULL AND SUOR.OU_ID IN
<foreach collection="ouIds" open="(" close=")" item="item" separator=","> <foreach collection="ouIds" open="(" close=")" item="item" separator=",">
#{item} #{item}
</foreach> </foreach>
...@@ -264,77 +264,78 @@ ...@@ -264,77 +264,78 @@
<select id="getSysUserListByOuIdOrUserName" parameterType="pps.core.system.entity.SysUserView" <select id="getSysUserListByOuIdOrUserName" parameterType="pps.core.system.entity.SysUserView"
resultMap="BaseResultMap"> resultMap="BaseResultMap">
select distinct SELECT DISTINCT
su.id, SU.ID,
su.user_name, SU.USER_NAME,
su.duty, SU.DUTY,
su.phone SU.PHONE
from SYS_USER su FROM SYS_USER SU
left join SYS_USER_ORGANIZATION_REL suor on suor.user_id=su.id LEFT JOIN SYS_USER_ORGANIZATION_REL SUOR ON SUOR.USER_ID=SU.ID
<where> <where>
<if test="ouId != null and ouId !=''"> <if test="ouId != null and ouId !=''">
and su.phone is not null and suor.ou_id =#{ouId} AND SU.PHONE IS NOT NULL AND SUOR.OU_ID =#{ouId}
</if> </if>
<if test="userName != null and userName!= ''"> <if test="userName != null and userName!= ''">
and su.user_name like concat('%',#{userName},'%') AND SU.USER_NAME LIKE CONCAT('%',#{userName},'%')
</if> </if>
</where> </where>
</select> </select>
<select id="selectUserByTrade" parameterType="pps.core.system.entity.SysUserView" resultMap="TradeResultMap"> <select id="selectUserByTrade" parameterType="pps.core.system.entity.SysUserView" resultMap="TradeResultMap">
select a.user_name, a.login_name, c.ou_name SELECT A.USER_NAME, A.LOGIN_NAME, C.OU_NAME
from SYS_USER a, FROM SYS_USER A,
SYS_USER_ORGANIZATION_REL b, SYS_USER_ORGANIZATION_REL B,
SYS_ORGANIZATION c SYS_ORGANIZATION C
where a.id = b.user_id WHERE A.ID = B.USER_ID
and b.ou_id = c.id AND B.OU_ID = C.ID
and a.is_trade = 1 AND A.IS_TRADE = 1
and a.user_name like concat('%', #{userName}, '%') limit 5 AND A.USER_NAME LIKE CONCAT('%', #{userName}, '%') LIMIT 5
</select> </select>
<select id="getSysUserAndOuByUserId" resultType="pps.core.system.entity.CurrentSysUserView"> <select id="getSysUserAndOuByUserId" resultType="pps.core.system.entity.CurrentSysUserView">
select su.id, SELECT SU.ID,
su.user_name, SU.USER_NAME,
su.user_domain, SU.USER_DOMAIN,
su.user_code, SU.USER_CODE,
su.user_type, SU.USER_TYPE,
su.phone, SU.PHONE,
su.email, SU.EMAIL,
su.login_name, SU.LOGIN_NAME,
su.is_super_admin, SU.IS_SUPER_ADMIN,
su.identify_no, SU.IDENTIFY_NO,
su.remark, SU.REMARK,
su.end_date, SU.END_DATE,
su.password, SU.PASSWORD,
su.duty, SU.DUTY,
su.sign_image, SU.SIGN_IMAGE,
su.prompt_mode, SU.PROMPT_MODE,
su.cert, SU.CERT,
su.sort, SU.SORT,
su.ca_begin_date, SU.CA_BEGIN_DATE,
su.ca_end_date, SU.CA_END_DATE,
su.iam_login_name, SU.IAM_LOGIN_NAME,
su.last_login_time, SU.LAST_LOGIN_TIME,
su.job_desc, SU.JOB_DESC,
su.fax_no, SU.FAX_NO,
su.postal_code, SU.POSTAL_CODE,
su.address, SU.ADDRESS,
su.create_by_id, SU.CREATE_BY_ID,
su.create_by_name, SU.CREATE_BY_NAME,
su.create_time, SU.CREATE_TIME,
su.modify_by_id, SU.MODIFY_BY_ID,
su.modify_by_name, SU.MODIFY_BY_NAME,
su.modify_time, SU.MODIFY_TIME,
so.id as ou_id, SO.ID AS OU_ID,
so.ou_code, SO.OU_CODE,
so.ou_name SO.OU_NAME
from SYS_USER su FROM SYS_USER SU
left join SYS_USER_ORGANIZATION_REL suor LEFT JOIN SYS_USER_ORGANIZATION_REL SUOR
on su.id = suor.user_id ON SU.ID = SUOR.USER_ID
left join SYS_ORGANIZATION so LEFT JOIN SYS_ORGANIZATION SO
on suor.ou_id = so.id ON SUOR.OU_ID = SO.ID
where su.id = #{userId} WHERE SU.ID = #{userId}
and suor.end_time > now() AND SUOR.END_TIME > NOW()
and so.is_deleted = 1 AND SO.IS_DELETED = 1
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -167,8 +167,8 @@ public class BaseDieselGeneratorService { ...@@ -167,8 +167,8 @@ public class BaseDieselGeneratorService {
boolean equals = CharSequenceUtil.equals(BusinessConstant.LINE_FLAG_ID, input.getLineId()); boolean equals = CharSequenceUtil.equals(BusinessConstant.LINE_FLAG_ID, input.getLineId());
if (CharSequenceUtil.isNotEmpty(input.getLineId())) { if (CharSequenceUtil.isNotEmpty(input.getLineId())) {
queryWrapper.lambda() queryWrapper.lambda()
.notExists(!equals, "SELECT 1 FROM base_power_line_diesel w WHERE base_diesel_generator.id = w.diesel_id AND w.is_deleted = 1 AND w.line_id <> {0}", input.getLineId()) .notExists(!equals, "SELECT 1 FROM BASE_POWER_LINE_DIESEL W WHERE BASE_DIESEL_GENERATOR.ID = W.DIESEL_ID AND W.IS_DELETED = 1 AND W.LINE_ID <> {0}", input.getLineId())
.notExists(equals, "SELECT 1 FROM base_power_line_diesel w WHERE base_diesel_generator.id = w.diesel_id AND w.is_deleted = 1") .notExists(equals, "SELECT 1 FROM BASE_POWER_LINE_DIESEL W WHERE BASE_DIESEL_GENERATOR.ID = W.DIESEL_ID AND W.IS_DELETED = 1")
.eq(BaseDieselGeneratorEnt::getOuId, input.getOuId()); .eq(BaseDieselGeneratorEnt::getOuId, input.getOuId());
} else { } else {
List<String> allListByOuId = ServiceUtil.getOrgIdsByPath(context, input.getOuId()); List<String> allListByOuId = ServiceUtil.getOrgIdsByPath(context, input.getOuId());
......
...@@ -167,8 +167,8 @@ public class BaseEnergyStorageDeviceService { ...@@ -167,8 +167,8 @@ public class BaseEnergyStorageDeviceService {
boolean equals = CharSequenceUtil.equals(BusinessConstant.LINE_FLAG_ID, input.getLineId()); boolean equals = CharSequenceUtil.equals(BusinessConstant.LINE_FLAG_ID, input.getLineId());
if (CharSequenceUtil.isNotEmpty(input.getLineId())) { if (CharSequenceUtil.isNotEmpty(input.getLineId())) {
queryWrapper.lambda() queryWrapper.lambda()
.notExists(!equals, "SELECT 1 FROM base_power_line_storage w WHERE base_energy_storage_device.id = w.storage_id AND w.is_deleted = 1 AND w.line_id <> {0}", input.getLineId()) .notExists(!equals, "SELECT 1 FROM BASE_POWER_LINE_STORAGE W WHERE BASE_ENERGY_STORAGE_DEVICE.ID = W.STORAGE_ID AND W.IS_DELETED = 1 AND W.LINE_ID <> {0}", input.getLineId())
.notExists(equals, "SELECT 1 FROM base_power_line_storage w WHERE base_energy_storage_device.id = w.storage_id AND w.is_deleted = 1") .notExists(equals, "SELECT 1 FROM BASE_POWER_LINE_STORAGE W WHERE BASE_ENERGY_STORAGE_DEVICE.ID = W.STORAGE_ID AND W.IS_DELETED = 1")
.eq(BaseEnergyStorageDeviceEnt::getOuId, input.getOuId()); .eq(BaseEnergyStorageDeviceEnt::getOuId, input.getOuId());
} else { } else {
List<String> allListByOuId = ServiceUtil.getOrgIdsByPath(context, input.getOuId()); List<String> allListByOuId = ServiceUtil.getOrgIdsByPath(context, input.getOuId());
......
...@@ -237,8 +237,8 @@ public class BasePhotovoltaicPlantService { ...@@ -237,8 +237,8 @@ public class BasePhotovoltaicPlantService {
boolean equals = CharSequenceUtil.equals(BusinessConstant.LINE_FLAG_ID, input.getLineId()); boolean equals = CharSequenceUtil.equals(BusinessConstant.LINE_FLAG_ID, input.getLineId());
if (CharSequenceUtil.isNotEmpty(input.getLineId())) { if (CharSequenceUtil.isNotEmpty(input.getLineId())) {
queryWrapper.lambda() queryWrapper.lambda()
.notExists(!equals, "SELECT 1 FROM base_power_line_plant w WHERE base_photovoltaic_plant.id = w.plant_id AND w.is_deleted = 1 AND w.line_id <> {0}", input.getLineId()) .notExists(!equals, "SELECT 1 FROM BASE_POWER_LINE_PLANT W WHERE BASE_PHOTOVOLTAIC_PLANT.ID = W.PLANT_ID AND W.IS_DELETED = 1 AND W.LINE_ID <> {0}", input.getLineId())
.notExists(equals, "SELECT 1 FROM base_power_line_plant w WHERE base_photovoltaic_plant.id = w.plant_id AND w.is_deleted = 1") .notExists(equals, "SELECT 1 FROM BASE_POWER_LINE_PLANT W WHERE BASE_PHOTOVOLTAIC_PLANT.ID = W.PLANT_ID AND W.IS_DELETED = 1")
.eq(BasePhotovoltaicPlantEnt::getOuId, input.getOuId()); .eq(BasePhotovoltaicPlantEnt::getOuId, input.getOuId());
} else { } else {
List<String> allListByOuId = ServiceUtil.getOrgIdsByPath(context, input.getOuId()); List<String> allListByOuId = ServiceUtil.getOrgIdsByPath(context, input.getOuId());
......
...@@ -171,8 +171,8 @@ public class BaseWellheadService { ...@@ -171,8 +171,8 @@ public class BaseWellheadService {
boolean equals = CharSequenceUtil.equals(BusinessConstant.LINE_FLAG_ID, input.getLineId()); boolean equals = CharSequenceUtil.equals(BusinessConstant.LINE_FLAG_ID, input.getLineId());
if (CharSequenceUtil.isNotEmpty(input.getLineId())) { if (CharSequenceUtil.isNotEmpty(input.getLineId())) {
queryWrapper.lambda() queryWrapper.lambda()
.notExists(!equals, "SELECT 1 FROM base_power_line_wellhead w WHERE base_wellhead.id = w.wellhead_id AND w.is_deleted = 1 AND w.line_id <> {0}", input.getLineId()) .notExists(!equals, "SELECT 1 FROM BASE_POWER_LINE_WELLHEAD W WHERE BASE_WELLHEAD.ID = W.WELLHEAD_ID AND W.IS_DELETED = 1 AND W.LINE_ID <> {0}", input.getLineId())
.notExists(equals, "SELECT 1 FROM base_power_line_wellhead w WHERE base_wellhead.id = w.wellhead_id AND w.is_deleted = 1") .notExists(equals, "SELECT 1 FROM BASE_POWER_LINE_WELLHEAD W WHERE BASE_WELLHEAD.ID = W.WELLHEAD_ID AND W.IS_DELETED = 1")
.eq(BaseWellheadEnt::getOuId, input.getOuId()); .eq(BaseWellheadEnt::getOuId, input.getOuId());
} else { } else {
List<String> allListByOuId = ServiceUtil.getOrgIdsByPath(context, input.getOuId()); List<String> allListByOuId = ServiceUtil.getOrgIdsByPath(context, input.getOuId());
......
...@@ -2,67 +2,69 @@ ...@@ -2,67 +2,69 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pps.core.base.mapper.BaseDataViewMapper"> <mapper namespace="pps.core.base.mapper.BaseDataViewMapper">
<resultMap id="BaseResultMap" type="pps.core.base.entity.BaseDataView"> <resultMap id="BaseResultMap" type="pps.core.base.entity.BaseDataView">
<id column="id" property="id" jdbcType="INTEGER"/> <id column="ID" property="id"/>
<result column="ou_id" property="ouId" jdbcType="VARCHAR"/> <result column="OU_ID" property="ouId"/>
<result column="line_id" property="lineId" jdbcType="INTEGER"/> <result column="LINE_ID" property="lineId"/>
<result column="data_date" property="dataDate" jdbcType="DATE"/> <result column="DATA_DATE" property="dataDate"/>
<result column="wind_speed" property="windSpeed" jdbcType="DECIMAL"/> <result column="WIND_SPEED" property="windSpeed"/>
<result column="wind_direction" property="windDirection" jdbcType="DECIMAL"/> <result column="WIND_DIRECTION" property="windDirection"/>
<result column="temperature" property="temperature" jdbcType="DECIMAL"/> <result column="TEMPERATURE" property="temperature"/>
<result column="pressure" property="pressure" jdbcType="DECIMAL"/> <result column="PRESSURE" property="pressure"/>
<result column="humidity" property="humidity" jdbcType="DECIMAL"/> <result column="HUMIDITY" property="humidity"/>
<result column="plane_Irradiance" property="planeIrradiance" jdbcType="DECIMAL"/> <result column="PLANE_IRRADIANCE" property="planeIrradiance"/>
<result column="horizontal_Irradiance" property="horizontalIrradiance" jdbcType="DECIMAL"/> <result column="HORIZONTAL_IRRADIANCE" property="horizontalIrradiance"/>
<result column="power" property="power" jdbcType="DECIMAL"/> <result column="POWER" property="power"/>
<result column="predicted_power" property="predictedPower" jdbcType="DECIMAL"/> <result column="PREDICTED_POWER" property="predictedPower"/>
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id ID
, ,
ou_id, OU_ID,
line_id, LINE_ID,
data_date, DATA_DATE,
wind_speed, WIND_SPEED,
wind_direction, WIND_DIRECTION,
temperature, TEMPERATURE,
pressure, PRESSURE,
humidity, HUMIDITY,
plane_Irradiance, PLANE_IRRADIANCE,
horizontal_Irradiance, HORIZONTAL_IRRADIANCE,
power, POWER,
predicted_power PREDICTED_POWER
</sql> </sql>
<select id="selectOne" parameterType="pps.core.base.entity.BaseDataView" resultMap="BaseResultMap"> <select id="selectOne" parameterType="pps.core.base.entity.BaseDataView" resultMap="BaseResultMap">
select SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from BASE_DATA FROM BASE_DATA
where WHERE
id=#{id} ID=#{id}
</select> </select>
<select id="selectList" parameterType="pps.core.base.entity.BaseDataView" resultMap="BaseResultMap"> <select id="selectList" parameterType="pps.core.base.entity.BaseDataView" resultMap="BaseResultMap">
select SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from BASE_DATA FROM BASE_DATA
where WHERE
id=#{id} ID=#{id}
</select> </select>
<insert id="batchInsert"> <insert id="batchInsert">
insert into BASE_DATA( INSERT INTO BASE_DATA(
ou_id, OU_ID,
line_id, LINE_ID,
data_date, DATA_DATE,
wind_speed, WIND_SPEED,
wind_direction, WIND_DIRECTION,
temperature, TEMPERATURE,
pressure, PRESSURE,
humidity, HUMIDITY,
plane_Irradiance, PLANE_IRRADIANCE,
horizontal_Irradiance, HORIZONTAL_IRRADIANCE,
power, POWER,
predicted_power, PREDICTED_POWER,
weather WEATHER
) VALUES ) VALUES
<foreach collection="list" item="item" separator=","> <foreach collection="list" item="item" separator=",">
( (
...@@ -82,4 +84,4 @@ ...@@ -82,4 +84,4 @@
) )
</foreach> </foreach>
</insert> </insert>
</mapper> </mapper>
\ No newline at end of file
...@@ -2,61 +2,64 @@ ...@@ -2,61 +2,64 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pps.core.base.mapper.BaseDieselGeneratorViewMapper"> <mapper namespace="pps.core.base.mapper.BaseDieselGeneratorViewMapper">
<resultMap id="BaseResultMap" type="pps.core.base.entity.BaseDieselGeneratorView"> <resultMap id="BaseResultMap" type="pps.core.base.entity.BaseDieselGeneratorView">
<id column="id" property="id" jdbcType="VARCHAR"/> <id column="ID" property="id"/>
<result column="is_deleted" property="isDeleted" jdbcType="INTEGER"/> <result column="IS_DELETED" property="isDeleted"/>
<result column="create_by_id" property="createById" jdbcType="VARCHAR"/> <result column="CREATE_BY_ID" property="createById"/>
<result column="create_by_name" property="createByName" jdbcType="VARCHAR"/> <result column="CREATE_BY_NAME" property="createByName"/>
<result column="create_time" property="createTime" jdbcType="DATE"/> <result column="CREATE_TIME" property="createTime"/>
<result column="modify_by_id" property="modifyById" jdbcType="VARCHAR"/> <result column="MODIFY_BY_ID" property="modifyById"/>
<result column="modify_by_name" property="modifyByName" jdbcType="VARCHAR"/> <result column="MODIFY_BY_NAME" property="modifyByName"/>
<result column="modify_time" property="modifyTime" jdbcType="DATE"/> <result column="MODIFY_TIME" property="modifyTime"/>
<result column="ou_id" property="ouId" jdbcType="VARCHAR"/> <result column="OU_ID" property="ouId"/>
<result column="ou_name" property="ouName" jdbcType="VARCHAR"/> <result column="OU_NAME" property="ouName"/>
<result column="device_name" property="deviceName" jdbcType="VARCHAR"/> <result column="DEVICE_NAME" property="deviceName"/>
<result column="maker_number" property="makerNumber" jdbcType="VARCHAR"/> <result column="MAKER_NUMBER" property="makerNumber"/>
<result column="unit_type_key" property="unitTypeKey" jdbcType="VARCHAR"/> <result column="UNIT_TYPE_KEY" property="unitTypeKey"/>
<result column="unit_type_name" property="unitTypeName" jdbcType="VARCHAR"/> <result column="UNIT_TYPE_NAME" property="unitTypeName"/>
<result column="normal_power" property="normalPower" jdbcType="DECIMAL"/> <result column="NORMAL_POWER" property="normalPower"/>
<result column="standby_power" property="standbyPower" jdbcType="DECIMAL"/> <result column="STANDBY_POWER" property="standbyPower"/>
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id ID
, ,
is_deleted, IS_DELETED,
create_by_id, CREATE_BY_ID,
create_by_name, CREATE_BY_NAME,
create_time, CREATE_TIME,
modify_by_id, MODIFY_BY_ID,
modify_by_name, MODIFY_BY_NAME,
modify_time, MODIFY_TIME,
ou_id, OU_ID,
ou_name, OU_NAME,
device_name, DEVICE_NAME,
maker_number, MAKER_NUMBER,
unit_type_key, UNIT_TYPE_KEY,
unit_type_name, UNIT_TYPE_NAME,
normal_power, NORMAL_POWER,
standby_power STANDBY_POWER
</sql> </sql>
<select id="selectOne" parameterType="pps.core.base.entity.BaseDieselGeneratorView" resultMap="BaseResultMap"> <select id="selectOne" parameterType="pps.core.base.entity.BaseDieselGeneratorView" resultMap="BaseResultMap">
select SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from BASE_DIESEL_GENERATOR FROM BASE_DIESEL_GENERATOR
where WHERE
id=#{id} ID=#{id}
</select> </select>
<select id="selectList" parameterType="pps.core.base.entity.BaseDieselGeneratorView" resultMap="BaseResultMap"> <select id="selectList" parameterType="pps.core.base.entity.BaseDieselGeneratorView" resultMap="BaseResultMap">
select SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from BASE_DIESEL_GENERATOR FROM BASE_DIESEL_GENERATOR
where WHERE
id=#{id} ID=#{id}
</select> </select>
<insert id="batchInsertList" parameterType="list"> <insert id="batchInsertList" parameterType="list">
INSERT INTO BASE_DIESEL_GENERATOR (id, is_deleted, create_by_id, create_by_name, create_time, modify_by_id, INSERT INTO BASE_DIESEL_GENERATOR (ID, IS_DELETED, CREATE_BY_ID, CREATE_BY_NAME, CREATE_TIME, MODIFY_BY_ID,
modify_by_name, modify_time, ou_id, ou_name, device_name, maker_number, unit_type_name, MODIFY_BY_NAME, MODIFY_TIME, OU_ID, OU_NAME, DEVICE_NAME, MAKER_NUMBER, UNIT_TYPE_NAME,
normal_power, standby_power) VALUES NORMAL_POWER, STANDBY_POWER) VALUES
<foreach collection="list" item="item" separator=","> <foreach collection="list" item="item" separator=",">
( (
#{item.id}, #{item.id},
......
...@@ -2,68 +2,70 @@ ...@@ -2,68 +2,70 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pps.core.base.mapper.BaseEnergyStorageDeviceViewMapper"> <mapper namespace="pps.core.base.mapper.BaseEnergyStorageDeviceViewMapper">
<resultMap id="BaseResultMap" type="pps.core.base.entity.BaseEnergyStorageDeviceView"> <resultMap id="BaseResultMap" type="pps.core.base.entity.BaseEnergyStorageDeviceView">
<id column="id" property="id" jdbcType="VARCHAR"/> <id column="ID" property="id" />
<result column="is_deleted" property="isDeleted" jdbcType="INTEGER"/> <result column="IS_DELETED" property="isDeleted" />
<result column="create_by_id" property="createById" jdbcType="VARCHAR"/> <result column="CREATE_BY_ID" property="createById" />
<result column="create_by_name" property="createByName" jdbcType="VARCHAR"/> <result column="CREATE_BY_NAME" property="createByName" />
<result column="create_time" property="createTime" jdbcType="DATE"/> <result column="CREATE_TIME" property="createTime" />
<result column="modify_by_id" property="modifyById" jdbcType="VARCHAR"/> <result column="MODIFY_BY_ID" property="modifyById" />
<result column="modify_by_name" property="modifyByName" jdbcType="VARCHAR"/> <result column="MODIFY_BY_NAME" property="modifyByName" />
<result column="modify_time" property="modifyTime" jdbcType="DATE"/> <result column="MODIFY_TIME" property="modifyTime" />
<result column="ou_id" property="ouId" jdbcType="VARCHAR"/> <result column="OU_ID" property="ouId" />
<result column="ou_name" property="ouName" jdbcType="VARCHAR"/> <result column="OU_NAME" property="ouName" />
<result column="device_name" property="deviceName" jdbcType="VARCHAR"/> <result column="DEVICE_NAME" property="deviceName" />
<result column="maker_number" property="makerNumber" jdbcType="VARCHAR"/> <result column="MAKER_NUMBER" property="makerNumber" />
<result column="storage_model_key" property="storageModelKey" jdbcType="VARCHAR"/> <result column="STORAGE_MODEL_KEY" property="storageModelKey" />
<result column="storage_model_name" property="storageModelName" jdbcType="VARCHAR"/> <result column="STORAGE_MODEL_NAME" property="storageModelName" />
<result column="apparatus_capacity" property="apparatusCapacity" jdbcType="DECIMAL"/> <result column="APPARATUS_CAPACITY" property="apparatusCapacity" />
<result column="rated_discharge_power" property="ratedDischargePower" jdbcType="DECIMAL"/> <result column="RATED_DISCHARGE_POWER" property="ratedDischargePower" />
<result column="rated_charging_power" property="ratedChargingPower" jdbcType="DECIMAL"/> <result column="RATED_CHARGING_POWER" property="ratedChargingPower" />
<result column="rated_discharge_depth" property="ratedDischargeDepth" jdbcType="DECIMAL"/> <result column="RATED_DISCHARGE_DEPTH" property="ratedDischargeDepth" />
<result column="rated_discharge_efficiency" property="ratedDischargeEfficiency" jdbcType="DECIMAL"/> <result column="RATED_DISCHARGE_EFFICIENCY" property="ratedDischargeEfficiency" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id ID
, ,
is_deleted, IS_DELETED,
create_by_id, CREATE_BY_ID,
create_by_name, CREATE_BY_NAME,
create_time, CREATE_TIME,
modify_by_id, MODIFY_BY_ID,
modify_by_name, MODIFY_BY_NAME,
modify_time, MODIFY_TIME,
ou_id, OU_ID,
ou_name, OU_NAME,
device_name, DEVICE_NAME,
maker_number, MAKER_NUMBER,
storage_model_key, STORAGE_MODEL_KEY,
storage_model_name, STORAGE_MODEL_NAME,
apparatus_capacity, APPARATUS_CAPACITY,
rated_discharge_power, RATED_DISCHARGE_POWER,
rated_charging_power, RATED_CHARGING_POWER,
rated_discharge_depth, RATED_DISCHARGE_DEPTH,
rated_discharge_efficiency RATED_DISCHARGE_EFFICIENCY
</sql> </sql>
<select id="selectOne" parameterType="pps.core.base.entity.BaseEnergyStorageDeviceView" resultMap="BaseResultMap"> <select id="selectOne" parameterType="pps.core.base.entity.BaseEnergyStorageDeviceView" resultMap="BaseResultMap">
select SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from BASE_ENERGY_STORAGE_DEVICE FROM BASE_ENERGY_STORAGE_DEVICE
where WHERE
id=#{id} ID=#{id}
</select> </select>
<select id="selectList" parameterType="pps.core.base.entity.BaseEnergyStorageDeviceView" resultMap="BaseResultMap"> <select id="selectList" parameterType="pps.core.base.entity.BaseEnergyStorageDeviceView" resultMap="BaseResultMap">
select SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from BASE_ENERGY_STORAGE_DEVICE FROM BASE_ENERGY_STORAGE_DEVICE
where WHERE
id=#{id} ID=#{id}
</select> </select>
<insert id="batchInsertList" parameterType="list"> <insert id="batchInsertList" parameterType="list">
INSERT INTO BASE_ENERGY_STORAGE_DEVICE (id, is_deleted, create_by_id, create_by_name, create_time, modify_by_id, INSERT INTO BASE_ENERGY_STORAGE_DEVICE (ID, IS_DELETED, CREATE_BY_ID, CREATE_BY_NAME, CREATE_TIME, MODIFY_BY_ID,
modify_by_name, modify_time, ou_id, ou_name, device_name, maker_number, storage_model_name, MODIFY_BY_NAME, MODIFY_TIME, OU_ID, OU_NAME, DEVICE_NAME, MAKER_NUMBER, STORAGE_MODEL_NAME,
apparatus_capacity, rated_discharge_power, rated_charging_power, rated_discharge_depth, APPARATUS_CAPACITY, RATED_DISCHARGE_POWER, RATED_CHARGING_POWER, RATED_DISCHARGE_DEPTH,
rated_discharge_efficiency) VALUES RATED_DISCHARGE_EFFICIENCY) VALUES
<foreach collection="list" item="item" separator=","> <foreach collection="list" item="item" separator=",">
( (
#{item.id}, #{item.id},
......
...@@ -2,51 +2,44 @@ ...@@ -2,51 +2,44 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pps.core.base.mapper.BaseLineAttenuationRateViewMapper"> <mapper namespace="pps.core.base.mapper.BaseLineAttenuationRateViewMapper">
<resultMap id="BaseResultMap" type="pps.core.base.entity.BaseLineAttenuationRateView"> <resultMap id="BaseResultMap" type="pps.core.base.entity.BaseLineAttenuationRateView">
<id column="id" property="id" jdbcType="INTEGER"/> <id column="ID" property="id"/>
<result column="line_id" property="lineId" jdbcType="INTEGER"/> <result column="LINE_ID" property="lineId"/>
<result column="particular_year" property="particularYear" jdbcType="VARCHAR"/> <result column="PARTICULAR_YEAR" property="particularYear"/>
<result column="attenuation_rate" property="attenuationRate" jdbcType="DECIMAL"/> <result column="ATTENUATION_RATE" property="attenuationRate"/>
<result column="sort" property="sort" jdbcType="INTEGER"/> <result column="SORT" property="sort"/>
<result column="create_by_id" property="createById" jdbcType="VARCHAR"/> <result column="CREATE_BY_ID" property="createById"/>
<result column="create_by_name" property="createByName" jdbcType="VARCHAR"/> <result column="CREATE_BY_NAME" property="createByName"/>
<result column="create_time" property="createTime" jdbcType="DATE"/> <result column="CREATE_TIME" property="createTime"/>
<result column="modify_by_id" property="modifyById" jdbcType="VARCHAR"/> <result column="MODIFY_BY_ID" property="modifyById"/>
<result column="modify_by_name" property="modifyByName" jdbcType="VARCHAR"/> <result column="MODIFY_BY_NAME" property="modifyByName"/>
<result column="modify_time" property="modifyTime" jdbcType="DATE"/> <result column="MODIFY_TIME" property="modifyTime"/>
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id ID
, ,
line_id, LINE_ID,
particular_year, PARTICULAR_YEAR,
attenuation_rate, ATTENUATION_RATE,
sort, SORT,
create_by_id, CREATE_BY_ID,
create_by_name, CREATE_BY_NAME,
create_time, CREATE_TIME,
modify_by_id, MODIFY_BY_ID,
modify_by_name, MODIFY_BY_NAME,
modify_time MODIFY_TIME
</sql> </sql>
<select id="selectOne" parameterType="pps.core.base.entity.BaseLineAttenuationRateView" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from BASE_LINE_ATTENUATION_RATE
where
id=#{id}
</select>
<insert id="batchInsert"> <insert id="batchInsert">
insert into BASE_LINE_ATTENUATION_RATE( INSERT INTO BASE_LINE_ATTENUATION_RATE(
line_id, LINE_ID,
particular_year, PARTICULAR_YEAR,
attenuation_rate, ATTENUATION_RATE,
sort, SORT,
type, TYPE,
create_by_id, CREATE_BY_ID,
create_by_name, CREATE_BY_NAME,
create_time CREATE_TIME
) VALUES ) VALUES
<foreach collection="list" item="item" separator=","> <foreach collection="list" item="item" separator=",">
( (
...@@ -61,4 +54,4 @@ ...@@ -61,4 +54,4 @@
) )
</foreach> </foreach>
</insert> </insert>
</mapper> </mapper>
\ No newline at end of file
...@@ -2,139 +2,139 @@ ...@@ -2,139 +2,139 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pps.core.base.mapper.BaseLineViewMapper"> <mapper namespace="pps.core.base.mapper.BaseLineViewMapper">
<resultMap id="BaseResultMap" type="pps.core.base.entity.BaseLineView"> <resultMap id="BaseResultMap" type="pps.core.base.entity.BaseLineView">
<id column="id" property="id" jdbcType="INTEGER"/> <id column="ID" property="id" />
<result column="parent_id" property="parentId" jdbcType="INTEGER"/> <result column="PARENT_ID" property="parentId" />
<result column="line_name" property="lineName" jdbcType="VARCHAR"/> <result column="LINE_NAME" property="lineName" />
<result column="line_type" property="lineType" jdbcType="INTEGER"/> <result column="LINE_TYPE" property="lineType" />
<result column="grid_type" property="gridType" jdbcType="INTEGER"/> <result column="GRID_TYPE" property="gridType" />
<result column="install_capacity" property="installCapacity" jdbcType="DECIMAL"/> <result column="INSTALL_CAPACITY" property="installCapacity" />
<result column="array_incidence" property="arrayIncidence" jdbcType="DECIMAL"/> <result column="ARRAY_INCIDENCE" property="arrayIncidence" />
<result column="array_toward" property="arrayToward" jdbcType="DECIMAL"/> <result column="ARRAY_TOWARD" property="arrayToward" />
<result column="well_ou_id" property="wellOuId" jdbcType="VARCHAR"/> <result column="WELL_OU_ID" property="wellOuId" />
<result column="production_year" property="productionYear" jdbcType="VARCHAR"/> <result column="PRODUCTION_YEAR" property="productionYear" />
<result column="service_length" property="serviceLength" jdbcType="VARCHAR"/> <result column="SERVICE_LENGTH" property="serviceLength" />
<result column="create_by_id" property="createById" jdbcType="VARCHAR"/> <result column="CREATE_BY_ID" property="createById" />
<result column="create_by_name" property="createByName" jdbcType="VARCHAR"/> <result column="CREATE_BY_NAME" property="createByName" />
<result column="create_time" property="createTime" jdbcType="DATE"/> <result column="CREATE_TIME" property="createTime" />
<result column="modify_by_id" property="modifyById" jdbcType="VARCHAR"/> <result column="MODIFY_BY_ID" property="modifyById" />
<result column="modify_by_name" property="modifyByName" jdbcType="VARCHAR"/> <result column="MODIFY_BY_NAME" property="modifyByName" />
<result column="modify_time" property="modifyTime" jdbcType="DATE"/> <result column="MODIFY_TIME" property="modifyTime" />
</resultMap> </resultMap>
<resultMap id="AllResultMap" type="pps.core.base.entity.BaseLineView"> <resultMap id="AllResultMap" type="pps.core.base.entity.BaseLineView">
<id column="id" property="id" jdbcType="VARCHAR"/> <id column="ID" property="id" />
<result column="parent_id" property="parentId" jdbcType="VARCHAR"/> <result column="PARENT_ID" property="parentId" />
<result column="line_name" property="lineName" jdbcType="VARCHAR"/> <result column="LINE_NAME" property="lineName" />
<result column="oil_ou_id" property="oilOuId" jdbcType="VARCHAR"/> <result column="OIL_OU_ID" property="oilOuId" />
<result column="oil_ou_name" property="oilOuName" jdbcType="VARCHAR"/> <result column="OIL_OU_NAME" property="oilOuName" />
<result column="well_ou_id" property="wellOuId" jdbcType="VARCHAR"/> <result column="WELL_OU_ID" property="wellOuId" />
<result column="well_ou_name" property="wellOuName" jdbcType="VARCHAR"/> <result column="WELL_OU_NAME" property="wellOuName" />
<result column="p_line_name" property="pLineName" jdbcType="VARCHAR"/> <result column="P_LINE_NAME" property="pLineName" />
<result column="line_type" property="lineType" jdbcType="INTEGER"/> <result column="LINE_TYPE" property="lineType" />
<result column="grid_type" property="gridType" jdbcType="INTEGER"/> <result column="GRID_TYPE" property="gridType" />
<result column="install_capacity" property="installCapacity" jdbcType="DECIMAL"/> <result column="INSTALL_CAPACITY" property="installCapacity" />
<result column="array_incidence" property="arrayIncidence" jdbcType="DECIMAL"/> <result column="ARRAY_INCIDENCE" property="arrayIncidence" />
<result column="array_toward" property="arrayToward" jdbcType="DECIMAL"/> <result column="ARRAY_TOWARD" property="arrayToward" />
<result column="well_ou_id" property="wellOuId" jdbcType="VARCHAR"/> <result column="WELL_OU_ID" property="wellOuId" />
<result column="create_by_id" property="createById" jdbcType="VARCHAR"/> <result column="CREATE_BY_ID" property="createById" />
<result column="create_by_name" property="createByName" jdbcType="VARCHAR"/> <result column="CREATE_BY_NAME" property="createByName" />
<result column="create_time" property="createTime" jdbcType="DATE"/> <result column="CREATE_TIME" property="createTime" />
<result column="modify_by_id" property="modifyById" jdbcType="VARCHAR"/> <result column="MODIFY_BY_ID" property="modifyById" />
<result column="modify_by_name" property="modifyByName" jdbcType="VARCHAR"/> <result column="MODIFY_BY_NAME" property="modifyByName" />
<result column="modify_time" property="modifyTime" jdbcType="DATE"/> <result column="MODIFY_TIME" property="modifyTime" />
</resultMap> </resultMap>
<resultMap id="DataResultMap" type="pps.core.base.entity.BaseLineAllView"> <resultMap id="DataResultMap" type="pps.core.base.entity.BaseLineAllView">
<id column="id" property="id" jdbcType="INTEGER"/> <id column="ID" property="id" />
<result column="line_name" property="lineName" jdbcType="VARCHAR"/> <result column="LINE_NAME" property="lineName" />
<result column="oil_ou_id" property="oilOuId" jdbcType="VARCHAR"/> <result column="OIL_OU_ID" property="oilOuId" />
<result column="oil_ou_name" property="oilOuName" jdbcType="VARCHAR"/> <result column="OIL_OU_NAME" property="oilOuName" />
<result column="well_ou_id" property="wellOuId" jdbcType="VARCHAR"/> <result column="WELL_OU_ID" property="wellOuId" />
<result column="well_ou_name" property="wellOuName" jdbcType="VARCHAR"/> <result column="WELL_OU_NAME" property="wellOuName" />
<result column="longitude" property="longitude" jdbcType="DECIMAL"/> <result column="LONGITUDE" property="longitude" />
<result column="latitude" property="latitude" jdbcType="DECIMAL"/> <result column="LATITUDE" property="latitude" />
<result column="elevation" property="elevation" jdbcType="DECIMAL"/> <result column="ELEVATION" property="elevation" />
<result column="well_ou_id" property="wellOuId" jdbcType="VARCHAR"/> <result column="WELL_OU_ID" property="wellOuId" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id ID
, ,
parent_id, PARENT_ID,
line_name, LINE_NAME,
line_type, LINE_TYPE,
grid_type, GRID_TYPE,
install_capacity, INSTALL_CAPACITY,
array_incidence, ARRAY_INCIDENCE,
array_toward, ARRAY_TOWARD,
ou_id, OU_ID,
create_by_id, CREATE_BY_ID,
create_by_name, CREATE_BY_NAME,
create_time, CREATE_TIME,
modify_by_id, MODIFY_BY_ID,
modify_by_name, MODIFY_BY_NAME,
modify_time MODIFY_TIME
</sql> </sql>
<select id="selectOne" parameterType="pps.core.base.entity.BaseLineView" resultMap="BaseResultMap"> <select id="selectOne" parameterType="pps.core.base.entity.BaseLineView" resultMap="BaseResultMap">
select d.id oil_ou_id, SELECT D.ID OIL_OU_ID,
d.ou_name oil_ou_name, D.OU_NAME OIL_OU_NAME,
a.id well_ou_id, A.ID WELL_OU_ID,
a.ou_name well_ou_name, A.OU_NAME WELL_OU_NAME,
c.id, C.ID,
c.line_name, C.LINE_NAME,
c.parent_id, C.PARENT_ID,
e.line_name p_line_name, E.LINE_NAME P_LINE_NAME,
c.grid_type, C.GRID_TYPE,
c.line_type, C.LINE_TYPE,
c.install_capacity, C.INSTALL_CAPACITY,
c.array_incidence, C.ARRAY_INCIDENCE,
c.array_toward, C.ARRAY_TOWARD,
c.production_year, C.PRODUCTION_YEAR,
c.service_length C.SERVICE_LENGTH
from BASE_LINE c FROM BASE_LINE C
left join LEFT JOIN
SYS_ORGANIZATION a on c.well_ou_id = a.id SYS_ORGANIZATION A ON C.WELL_OU_ID = A.ID
left join LEFT JOIN
SYS_ORGANIZATION_REL b on a.id = b.ou_id SYS_ORGANIZATION_REL B ON A.ID = B.OU_ID
left join LEFT JOIN
BASE_LINE e on c.parent_id = e.id BASE_LINE E ON C.PARENT_ID = E.ID
left join LEFT JOIN
SYS_ORGANIZATION d on b.parent_ou_id = d.id SYS_ORGANIZATION D ON B.PARENT_OU_ID = D.ID
where c.id = #{id} WHERE C.ID = #{id}
</select> </select>
<select id="selectList" parameterType="pps.core.base.entity.BaseLineView" resultMap="AllResultMap"> <select id="selectList" parameterType="pps.core.base.entity.BaseLineView" resultMap="AllResultMap">
SELECT SELECT
d.id oil_ou_id, D.ID OIL_OU_ID,
d.ou_name oil_ou_name, D.OU_NAME OIL_OU_NAME,
a.id well_ou_id, A.ID WELL_OU_ID,
a.ou_name well_ou_name, A.OU_NAME WELL_OU_NAME,
c.id, C.ID,
c.line_name, C.LINE_NAME,
c.parent_id, C.PARENT_ID,
e.line_name p_line_name, E.LINE_NAME P_LINE_NAME,
c.grid_type, C.GRID_TYPE,
c.line_type, C.LINE_TYPE,
c.install_capacity, C.INSTALL_CAPACITY,
c.array_incidence, C.ARRAY_INCIDENCE,
c.array_toward C.ARRAY_TOWARD
FROM FROM
BASE_LINE c BASE_LINE C
left join LEFT JOIN
SYS_ORGANIZATION a on c.well_ou_id = a.id SYS_ORGANIZATION A ON C.WELL_OU_ID = A.ID
left join LEFT JOIN
SYS_ORGANIZATION_REL b on a.id = b.ou_id SYS_ORGANIZATION_REL B ON A.ID = B.OU_ID
left join LEFT JOIN
BASE_LINE e on c.parent_id = e.id BASE_LINE E ON C.PARENT_ID = E.ID
left join LEFT JOIN
SYS_ORGANIZATION d on b.parent_ou_id = d.id SYS_ORGANIZATION D ON B.PARENT_OU_ID = D.ID
<where> <where>
<if test="lineName!=null and lineName !=''"> <if test="lineName!=null and lineName !=''">
and c.line_name like concat('%',#{lineName},'%') AND C.LINE_NAME LIKE CONCAT('%',#{lineName},'%')
</if> </if>
<if test="wellOuId!=null and wellOuId !=''"> <if test="wellOuId!=null and wellOuId !=''">
and c.well_ou_id =#{wellOuId} AND C.WELL_OU_ID =#{wellOuId}
</if> </if>
<if test="ouIdList != null and ouIdList.size()>0"> <if test="ouIdList != null and ouIdList.size()>0">
and c.well_ou_id in AND C.WELL_OU_ID IN
<foreach collection="ouIdList" open="(" close=")" item="item" separator=","> <foreach collection="ouIdList" open="(" close=")" item="item" separator=",">
#{item} #{item}
</foreach> </foreach>
...@@ -144,56 +144,56 @@ ...@@ -144,56 +144,56 @@
<select id="selectDataList" parameterType="pps.core.base.entity.BaseLineView" resultMap="DataResultMap"> <select id="selectDataList" parameterType="pps.core.base.entity.BaseLineView" resultMap="DataResultMap">
SELECT SELECT
d.id oil_ou_id, D.ID OIL_OU_ID,
d.ou_name oil_ou_name, D.OU_NAME OIL_OU_NAME,
a.id well_ou_id, A.ID WELL_OU_ID,
a.ou_name well_ou_name, A.OU_NAME WELL_OU_NAME,
c.id, C.ID,
c.line_name, C.LINE_NAME,
c.grid_type, C.GRID_TYPE,
c.line_type, C.LINE_TYPE,
a.longitude, A.LONGITUDE,
a.latitude, A.LATITUDE,
a.elevation, A.ELEVATION,
a.province A.PROVINCE
FROM FROM
BASE_LINE c BASE_LINE C
left join LEFT JOIN
SYS_ORGANIZATION a on c.well_ou_id = a.id SYS_ORGANIZATION A ON C.WELL_OU_ID = A.ID
left join LEFT JOIN
SYS_ORGANIZATION_REL b on a.id = b.ou_id SYS_ORGANIZATION_REL B ON A.ID = B.OU_ID
left join LEFT JOIN
SYS_ORGANIZATION d on b.parent_ou_id = d.id SYS_ORGANIZATION D ON B.PARENT_OU_ID = D.ID
<where> <where>
<if test="id!=null and id !=''"> <if test="id!=null and id !=''">
and c.id = #{id} AND C.ID = #{id}
</if> </if>
<if test="wellOuId!=null and wellOuId !=''"> <if test="wellOuId!=null and wellOuId !=''">
and c.well_ou_id =#{wellOuId} AND C.WELL_OU_ID =#{wellOuId}
</if> </if>
<if test="oilOuId!=null and oilOuId !=''"> <if test="oilOuId!=null and oilOuId !=''">
and d.id =#{oilOuId} AND D.ID =#{oilOuId}
</if> </if>
</where> </where>
</select> </select>
<select id="selectListNew" parameterType="pps.core.base.entity.BaseLineView" resultMap="AllResultMap"> <select id="selectListNew" parameterType="pps.core.base.entity.BaseLineView" resultMap="AllResultMap">
SELECT SELECT
ou_id as oil_ou_id, OU_ID AS OIL_OU_ID,
id, ID,
line_name, LINE_NAME,
upper_line_id as parent_id, UPPER_LINE_ID AS PARENT_ID,
line_name p_line_name, LINE_NAME P_LINE_NAME,
grid_type_key as grid_type, GRID_TYPE_KEY AS GRID_TYPE,
line_type_key as line_type LINE_TYPE_KEY AS LINE_TYPE
FROM FROM
BASE_POWER_LINE BASE_POWER_LINE
<where> <where>
<if test="lineName!=null and lineName !=''"> <if test="lineName!=null and lineName !=''">
and line_name like CONCAT( '%', #{lineName}, '%' ) AND LINE_NAME LIKE CONCAT( '%', #{lineName}, '%' )
</if> </if>
<if test="ouIdList != null and ouIdList.size() > 0 "> <if test="ouIdList != null and ouIdList.size() > 0 ">
and ou_id in AND OU_ID IN
<foreach collection="ouIdList" open="(" close=")" item="item" separator=","> <foreach collection="ouIdList" open="(" close=")" item="item" separator=",">
#{item} #{item}
</foreach> </foreach>
......
...@@ -2,55 +2,58 @@ ...@@ -2,55 +2,58 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pps.core.base.mapper.BasePhotovoltaicPlantMapeAdjViewMapper"> <mapper namespace="pps.core.base.mapper.BasePhotovoltaicPlantMapeAdjViewMapper">
<resultMap id="BaseResultMap" type="pps.core.base.entity.BasePhotovoltaicPlantMapeAdjView"> <resultMap id="BaseResultMap" type="pps.core.base.entity.BasePhotovoltaicPlantMapeAdjView">
<id column="id" property="id" jdbcType="INTEGER"/> <id column="ID" property="id"/>
<result column="plant_id" property="plantId" jdbcType="VARCHAR"/> <result column="PLANT_ID" property="plantId"/>
<result column="mape_type" property="mapeType" jdbcType="INTEGER"/> <result column="MAPE_TYPE" property="mapeType"/>
<result column="mape_plus_val" property="mapePlusVal" jdbcType="DECIMAL"/> <result column="MAPE_PLUS_VAL" property="mapePlusVal"/>
<result column="create_by_id" property="createById" jdbcType="VARCHAR"/> <result column="CREATE_BY_ID" property="createById"/>
<result column="create_by_name" property="createByName" jdbcType="VARCHAR"/> <result column="CREATE_BY_NAME" property="createByName"/>
<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/> <result column="CREATE_TIME" property="createTime"/>
<result column="modify_by_id" property="modifyById" jdbcType="VARCHAR"/> <result column="MODIFY_BY_ID" property="modifyById"/>
<result column="modify_by_name" property="modifyByName" jdbcType="VARCHAR"/> <result column="MODIFY_BY_NAME" property="modifyByName"/>
<result column="modify_time" property="modifyTime" jdbcType="TIMESTAMP"/> <result column="MODIFY_TIME" property="modifyTime"/>
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id ID
, ,
plant_id, PLANT_ID,
mape_type, MAPE_TYPE,
mape_plus_val, MAPE_PLUS_VAL,
create_by_id, CREATE_BY_ID,
create_by_name, CREATE_BY_NAME,
create_time, CREATE_TIME,
modify_by_id, MODIFY_BY_ID,
modify_by_name, MODIFY_BY_NAME,
modify_time MODIFY_TIME
</sql> </sql>
<select id="selectOne" parameterType="pps.core.base.entity.BasePhotovoltaicPlantMapeAdjView" <select id="selectOne" parameterType="pps.core.base.entity.BasePhotovoltaicPlantMapeAdjView"
resultMap="BaseResultMap"> resultMap="BaseResultMap">
select SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from BASE_PHOTOVOLTAIC_PLANT_MAPE_ADJ FROM BASE_PHOTOVOLTAIC_PLANT_MAPE_ADJ
<where> <where>
<if test="plantId != null and plantId != ''"> <if test="plantId != null and plantId != ''">
and plant_id = #{plantId} AND PLANT_ID = #{plantId}
</if> </if>
<if test="mapeType != null"> <if test="mapeType != null">
and mape_type = #{mapeType} AND MAPE_TYPE = #{mapeType}
</if> </if>
<if test="id != null"> <if test="id != null">
and id = #{id} AND ID = #{id}
</if> </if>
</where> </where>
order by create_time desc ORDER BY CREATE_TIME DESC
limit 1 LIMIT 1
</select> </select>
<select id="selectList" parameterType="pps.core.base.entity.BasePhotovoltaicPlantMapeAdjView" <select id="selectList" parameterType="pps.core.base.entity.BasePhotovoltaicPlantMapeAdjView"
resultMap="BaseResultMap"> resultMap="BaseResultMap">
select SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from BASE_PHOTOVOLTAIC_PLANT_MAPE_ADJ FROM BASE_PHOTOVOLTAIC_PLANT_MAPE_ADJ
where WHERE
id=#{id} ID=#{id}
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -2,136 +2,139 @@ ...@@ -2,136 +2,139 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pps.core.base.mapper.BasePhotovoltaicPlantViewMapper"> <mapper namespace="pps.core.base.mapper.BasePhotovoltaicPlantViewMapper">
<resultMap id="BaseResultMap" type="pps.core.base.entity.BasePhotovoltaicPlantView"> <resultMap id="BaseResultMap" type="pps.core.base.entity.BasePhotovoltaicPlantView">
<id column="id" property="id" jdbcType="VARCHAR"/> <id column="ID" property="id"/>
<result column="is_deleted" property="isDeleted" jdbcType="INTEGER"/> <result column="IS_DELETED" property="isDeleted"/>
<result column="create_by_id" property="createById" jdbcType="VARCHAR"/> <result column="CREATE_BY_ID" property="createById"/>
<result column="create_by_name" property="createByName" jdbcType="VARCHAR"/> <result column="CREATE_BY_NAME" property="createByName"/>
<result column="create_time" property="createTime" jdbcType="DATE"/> <result column="CREATE_TIME" property="createTime"/>
<result column="modify_by_id" property="modifyById" jdbcType="VARCHAR"/> <result column="MODIFY_BY_ID" property="modifyById"/>
<result column="modify_by_name" property="modifyByName" jdbcType="VARCHAR"/> <result column="MODIFY_BY_NAME" property="modifyByName"/>
<result column="modify_time" property="modifyTime" jdbcType="DATE"/> <result column="MODIFY_TIME" property="modifyTime"/>
<result column="ou_id" property="ouId" jdbcType="VARCHAR"/> <result column="OU_ID" property="ouId"/>
<result column="ou_name" property="ouName" jdbcType="VARCHAR"/> <result column="OU_NAME" property="ouName"/>
<result column="station_name" property="stationName" jdbcType="VARCHAR"/> <result column="STATION_NAME" property="stationName"/>
<result column="maker_number" property="makerNumber" jdbcType="VARCHAR"/> <result column="MAKER_NUMBER" property="makerNumber"/>
<result column="photovoltaic_model_key" property="photovoltaicModelKey" jdbcType="VARCHAR"/> <result column="PHOTOVOLTAIC_MODEL_KEY" property="photovoltaicModelKey"/>
<result column="photovoltaic_model_name" property="photovoltaicModelName" jdbcType="VARCHAR"/> <result column="PHOTOVOLTAIC_MODEL_NAME" property="photovoltaicModelName"/>
<result column="mounting_angle" property="mountingAngle" jdbcType="DECIMAL"/> <result column="MOUNTING_ANGLE" property="mountingAngle"/>
<result column="total_power" property="totalPower" jdbcType="DECIMAL"/> <result column="TOTAL_POWER" property="totalPower"/>
<result column="array_orientation" property="arrayOrientation" jdbcType="DECIMAL"/> <result column="ARRAY_ORIENTATION" property="arrayOrientation"/>
<result column="city_code" property="cityCode" jdbcType="VARCHAR"/> <result column="CITY_CODE" property="cityCode"/>
<result column="province_code" property="provinceCode" jdbcType="VARCHAR"/> <result column="PROVINCE_CODE" property="provinceCode"/>
<result column="longitude" property="longitude" jdbcType="DECIMAL"/> <result column="LONGITUDE" property="longitude"/>
<result column="latitude" property="latitude" jdbcType="DECIMAL"/> <result column="LATITUDE" property="latitude"/>
<result column="elevation" property="elevation" jdbcType="DECIMAL"/> <result column="ELEVATION" property="elevation"/>
<result column="area_code" property="areaCode" jdbcType="INTEGER"/> <result column="AREA_CODE" property="areaCode"/>
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id ID
, ,
is_deleted, IS_DELETED,
create_by_id, CREATE_BY_ID,
create_by_name, CREATE_BY_NAME,
create_time, CREATE_TIME,
modify_by_id, MODIFY_BY_ID,
modify_by_name, MODIFY_BY_NAME,
modify_time, MODIFY_TIME,
ou_id, OU_ID,
ou_name, OU_NAME,
station_name, STATION_NAME,
maker_number, MAKER_NUMBER,
photovoltaic_model_key, PHOTOVOLTAIC_MODEL_KEY,
photovoltaic_model_name, PHOTOVOLTAIC_MODEL_NAME,
mounting_angle, MOUNTING_ANGLE,
total_power, TOTAL_POWER,
array_orientation, ARRAY_ORIENTATION,
longitude, LONGITUDE,
latitude, LATITUDE,
elevation, ELEVATION,
area_code AREA_CODE
</sql> </sql>
<select id="selectOne" parameterType="pps.core.base.entity.BasePhotovoltaicPlantView" resultMap="BaseResultMap"> <select id="selectOne" parameterType="pps.core.base.entity.BasePhotovoltaicPlantView" resultMap="BaseResultMap">
select SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from BASE_PHOTOVOLTAIC_PLANT FROM BASE_PHOTOVOLTAIC_PLANT
where WHERE
id=#{id} ID=#{id}
</select> </select>
<select id="selectList" parameterType="pps.core.base.entity.BasePhotovoltaicPlantView" resultMap="BaseResultMap"> <select id="selectList" parameterType="pps.core.base.entity.BasePhotovoltaicPlantView" resultMap="BaseResultMap">
select SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from BASE_PHOTOVOLTAIC_PLANT FROM BASE_PHOTOVOLTAIC_PLANT
where WHERE
id=#{id} ID=#{id}
</select> </select>
<select id="selectPlantDetailList" parameterType="pps.core.base.entity.BasePhotovoltaicPlantView" <select id="selectPlantDetailList" parameterType="pps.core.base.entity.BasePhotovoltaicPlantView"
resultMap="BaseResultMap"> resultMap="BaseResultMap">
select p.id, SELECT P.ID,
p.is_deleted, P.IS_DELETED,
p.create_by_id, P.CREATE_BY_ID,
p.create_by_name, P.CREATE_BY_NAME,
p.create_time, P.CREATE_TIME,
p.modify_by_id, P.MODIFY_BY_ID,
p.modify_by_name, P.MODIFY_BY_NAME,
p.modify_time, P.MODIFY_TIME,
p.ou_id, P.OU_ID,
p.ou_name, P.OU_NAME,
p.station_name, P.STATION_NAME,
p.maker_number, P.MAKER_NUMBER,
p.photovoltaic_model_key, P.PHOTOVOLTAIC_MODEL_KEY,
p.photovoltaic_model_name, P.PHOTOVOLTAIC_MODEL_NAME,
p.mounting_angle, P.MOUNTING_ANGLE,
p.total_power, P.TOTAL_POWER,
p.array_orientation, P.ARRAY_ORIENTATION,
sa.city_code, SA.CITY_CODE,
sa.province_code SA.PROVINCE_CODE
from BASE_PHOTOVOLTAIC_PLANT p FROM BASE_PHOTOVOLTAIC_PLANT P
join SYS_ORGANIZATION so on so.id = p.ou_id JOIN SYS_ORGANIZATION SO ON SO.ID = P.OU_ID
left join SYS_AREA sa on sa.id = so.province LEFT JOIN SYS_AREA SA ON SA.ID = SO.PROVINCE
where p.is_deleted = #{isDeleted} WHERE P.IS_DELETED = #{isDeleted}
</select> </select>
<select id="selectPlantList" resultMap="BaseResultMap"> <select id="selectPlantList" resultMap="BaseResultMap">
SELECT p.id, SELECT P.ID,
p.is_deleted, P.IS_DELETED,
p.create_by_id, P.CREATE_BY_ID,
p.create_by_name, P.CREATE_BY_NAME,
p.create_time, P.CREATE_TIME,
p.modify_by_id, P.MODIFY_BY_ID,
p.modify_by_name, P.MODIFY_BY_NAME,
p.modify_time, P.MODIFY_TIME,
p.ou_id, P.OU_ID,
p.ou_name, P.OU_NAME,
p.station_name, P.STATION_NAME,
p.maker_number, P.MAKER_NUMBER,
p.photovoltaic_model_key, P.PHOTOVOLTAIC_MODEL_KEY,
p.photovoltaic_model_name, P.PHOTOVOLTAIC_MODEL_NAME,
p.mounting_angle, P.MOUNTING_ANGLE,
p.total_power, P.TOTAL_POWER,
p.array_orientation, P.ARRAY_ORIENTATION,
p.area_code, P.AREA_CODE,
a.city_code A.CITY_CODE
FROM BASE_PHOTOVOLTAIC_PLANT p FROM BASE_PHOTOVOLTAIC_PLANT P
JOIN SYS_AREA a ON a.id = p.area_code JOIN SYS_AREA A ON A.ID = P.AREA_CODE
WHERE p.is_deleted = 1 WHERE P.IS_DELETED = 1
AND p.area_code IS NOT NULL AND P.AREA_CODE IS NOT NULL
<if test="ouIdNotIn != null and ouIdNotIn.size() > 0"> <if test="ouIdNotIn != null and ouIdNotIn.size() > 0">
AND p.ou_id NOT IN AND P.OU_ID NOT IN
<foreach collection="ouIdNotIn" open="(" close=")" separator="," item="item"> <foreach collection="ouIdNotIn" open="(" close=")" separator="," item="item">
#{item} #{item}
</foreach> </foreach>
</if> </if>
<if test="ouId != null and ouId != ''"> <if test="ouId != null and ouId != ''">
AND p.ou_id = #{ouId} AND P.OU_ID = #{ouId}
</if> </if>
ORDER BY modify_time DESC ORDER BY MODIFY_TIME DESC
</select> </select>
<insert id="batchInsertList" parameterType="list"> <insert id="batchInsertList" parameterType="list">
INSERT INTO BASE_PHOTOVOLTAIC_PLANT (id, is_deleted, create_by_id, create_by_name, create_time, modify_by_id, INSERT INTO BASE_PHOTOVOLTAIC_PLANT (ID, IS_DELETED, CREATE_BY_ID, CREATE_BY_NAME, CREATE_TIME, MODIFY_BY_ID,
modify_by_name, modify_time, ou_id, ou_name, station_name, maker_number, photovoltaic_model_name, MODIFY_BY_NAME, MODIFY_TIME, OU_ID, OU_NAME, STATION_NAME, MAKER_NUMBER, PHOTOVOLTAIC_MODEL_NAME,
mounting_angle, total_power, array_orientation, longitude, latitude, elevation, MOUNTING_ANGLE, TOTAL_POWER, ARRAY_ORIENTATION, LONGITUDE, LATITUDE, ELEVATION,
area_code) AREA_CODE)
VALUES VALUES
<foreach collection="list" item="item" separator=","> <foreach collection="list" item="item" separator=",">
( (
...@@ -160,18 +163,18 @@ ...@@ -160,18 +163,18 @@
</insert> </insert>
<resultMap id="ExtendResultMap" type="pps.core.base.entity.BasePhotovoltaicPlantView" extends="BaseResultMap"> <resultMap id="ExtendResultMap" type="pps.core.base.entity.BasePhotovoltaicPlantView" extends="BaseResultMap">
<result column="strategy_id" property="strategyId" jdbcType="VARCHAR"/> <result column="STRATEGY_ID" property="strategyId"/>
</resultMap> </resultMap>
<select id="selectPlantStrategyList" resultMap="ExtendResultMap"> <select id="selectPlantStrategyList" resultMap="ExtendResultMap">
SELECT l.strategy_id, SELECT L.STRATEGY_ID,
t.station_name T.STATION_NAME
FROM BASE_POWER_LINE l FROM BASE_POWER_LINE L
LEFT JOIN BASE_POWER_LINE_PLANT p ON l.id = p.line_id LEFT JOIN BASE_POWER_LINE_PLANT P ON L.ID = P.LINE_ID
LEFT JOIN BASE_PHOTOVOLTAIC_PLANT t ON p.plant_id = t.id LEFT JOIN BASE_PHOTOVOLTAIC_PLANT T ON P.PLANT_ID = T.ID
WHERE l.is_deleted = 1 WHERE L.IS_DELETED = 1
AND l.strategy_id &lt;&gt; '' AND L.STRATEGY_ID &lt;&gt; ''
AND p.is_deleted = 1 AND P.IS_DELETED = 1
AND t.is_deleted = 1 AND T.IS_DELETED = 1
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -2,60 +2,61 @@ ...@@ -2,60 +2,61 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pps.core.base.mapper.BasePowerLineDieselViewMapper"> <mapper namespace="pps.core.base.mapper.BasePowerLineDieselViewMapper">
<resultMap id="BaseResultMap" type="pps.core.base.entity.BasePowerLineDieselView"> <resultMap id="BaseResultMap" type="pps.core.base.entity.BasePowerLineDieselView">
<id column="id" property="id" jdbcType="VARCHAR"/> <id column="ID" property="id"/>
<result column="is_deleted" property="isDeleted" jdbcType="INTEGER"/> <result column="IS_DELETED" property="isDeleted"/>
<result column="create_by_id" property="createById" jdbcType="VARCHAR"/> <result column="CREATE_BY_ID" property="createById"/>
<result column="create_by_name" property="createByName" jdbcType="VARCHAR"/> <result column="CREATE_BY_NAME" property="createByName"/>
<result column="create_time" property="createTime" jdbcType="DATE"/> <result column="CREATE_TIME" property="createTime"/>
<result column="modify_by_id" property="modifyById" jdbcType="VARCHAR"/> <result column="MODIFY_BY_ID" property="modifyById"/>
<result column="modify_by_name" property="modifyByName" jdbcType="VARCHAR"/> <result column="MODIFY_BY_NAME" property="modifyByName"/>
<result column="modify_time" property="modifyTime" jdbcType="DATE"/> <result column="MODIFY_TIME" property="modifyTime"/>
<result column="line_id" property="lineId" jdbcType="VARCHAR"/> <result column="LINE_ID" property="lineId"/>
<result column="diesel_id" property="dieselId" jdbcType="VARCHAR"/> <result column="DIESEL_ID" property="dieselId"/>
<result column="ou_id" property="ouId" jdbcType="VARCHAR"/> <result column="OU_ID" property="ouId"/>
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id ID
, ,
is_deleted, IS_DELETED,
create_by_id, CREATE_BY_ID,
create_by_name, CREATE_BY_NAME,
create_time, CREATE_TIME,
modify_by_id, MODIFY_BY_ID,
modify_by_name, MODIFY_BY_NAME,
modify_time, MODIFY_TIME,
line_id, LINE_ID,
diesel_id, DIESEL_ID,
ou_id OU_ID
</sql> </sql>
<resultMap id="ExtendsResultMap" type="pps.core.base.entity.BasePowerLineDieselView" extends="BaseResultMap"> <resultMap id="ExtendsResultMap" type="pps.core.base.entity.BasePowerLineDieselView" extends="BaseResultMap">
<result column="device_name" property="deviceName" jdbcType="VARCHAR"/> <result column="DEVICE_NAME" property="deviceName"/>
<result column="standby_power" property="standbyPower" jdbcType="DECIMAL"/> <result column="STANDBY_POWER" property="standbyPower"/>
</resultMap> </resultMap>
<select id="selectOne" parameterType="pps.core.base.entity.BasePowerLineDieselView" resultMap="BaseResultMap"> <select id="selectOne" parameterType="pps.core.base.entity.BasePowerLineDieselView" resultMap="BaseResultMap">
select SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from BASE_POWER_LINE_DIESEL FROM BASE_POWER_LINE_DIESEL
where WHERE
id=#{id} ID=#{id}
</select> </select>
<select id="selectList" parameterType="pps.core.base.entity.BasePowerLineDieselView" resultMap="ExtendsResultMap"> <select id="selectList" parameterType="pps.core.base.entity.BasePowerLineDieselView" resultMap="ExtendsResultMap">
SELECT l.id, SELECT L.ID,
l.diesel_id, L.DIESEL_ID,
g.device_name, G.DEVICE_NAME,
g.standby_power G.STANDBY_POWER
FROM BASE_POWER_LINE_DIESEL l FROM BASE_POWER_LINE_DIESEL L
LEFT JOIN BASE_DIESEL_GENERATOR g ON l.diesel_id = g.id LEFT JOIN BASE_DIESEL_GENERATOR G ON L.DIESEL_ID = G.ID
AND g.is_deleted = 1 AND G.IS_DELETED = 1
WHERE l.line_id = #{lineId} WHERE L.LINE_ID = #{lineId}
</select> </select>
<insert id="batchInsertList" parameterType="list"> <insert id="batchInsertList" parameterType="list">
INSERT INTO BASE_POWER_LINE_DIESEL ( id, create_by_id, create_by_name, create_time, modify_by_id, INSERT INTO BASE_POWER_LINE_DIESEL ( ID, CREATE_BY_ID, CREATE_BY_NAME, CREATE_TIME, MODIFY_BY_ID,
modify_by_name, modify_time, line_id, diesel_id, ou_id ) MODIFY_BY_NAME, MODIFY_TIME, LINE_ID, DIESEL_ID, OU_ID )
VALUES VALUES
<foreach collection="list" item="item" separator=","> <foreach collection="list" item="item" separator=",">
( (
......
...@@ -2,63 +2,64 @@ ...@@ -2,63 +2,64 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pps.core.base.mapper.BasePowerLinePlantViewMapper"> <mapper namespace="pps.core.base.mapper.BasePowerLinePlantViewMapper">
<resultMap id="BaseResultMap" type="pps.core.base.entity.BasePowerLinePlantView"> <resultMap id="BaseResultMap" type="pps.core.base.entity.BasePowerLinePlantView">
<id column="id" property="id" jdbcType="VARCHAR"/> <id column="ID" property="id" />
<result column="is_deleted" property="isDeleted" jdbcType="INTEGER"/> <result column="IS_DELETED" property="isDeleted" />
<result column="create_by_id" property="createById" jdbcType="VARCHAR"/> <result column="CREATE_BY_ID" property="createById" />
<result column="create_by_name" property="createByName" jdbcType="VARCHAR"/> <result column="CREATE_BY_NAME" property="createByName" />
<result column="create_time" property="createTime" jdbcType="DATE"/> <result column="CREATE_TIME" property="createTime" />
<result column="modify_by_id" property="modifyById" jdbcType="VARCHAR"/> <result column="MODIFY_BY_ID" property="modifyById" />
<result column="modify_by_name" property="modifyByName" jdbcType="VARCHAR"/> <result column="MODIFY_BY_NAME" property="modifyByName" />
<result column="modify_time" property="modifyTime" jdbcType="DATE"/> <result column="MODIFY_TIME" property="modifyTime" />
<result column="line_id" property="lineId" jdbcType="VARCHAR"/> <result column="LINE_ID" property="lineId" />
<result column="plant_id" property="plantId" jdbcType="VARCHAR"/> <result column="PLANT_ID" property="plantId" />
<result column="ou_id" property="ouId" jdbcType="VARCHAR"/> <result column="OU_ID" property="ouId" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id ID
, ,
is_deleted, IS_DELETED,
create_by_id, CREATE_BY_ID,
create_by_name, CREATE_BY_NAME,
create_time, CREATE_TIME,
modify_by_id, MODIFY_BY_ID,
modify_by_name, MODIFY_BY_NAME,
modify_time, MODIFY_TIME,
line_id, LINE_ID,
plant_id, PLANT_ID,
ou_id OU_ID
</sql> </sql>
<resultMap id="ExtendsResultMap" type="pps.core.base.entity.BasePowerLinePlantView" extends="BaseResultMap"> <resultMap id="ExtendsResultMap" type="pps.core.base.entity.BasePowerLinePlantView" extends="BaseResultMap">
<result column="station_name" property="stationName" jdbcType="VARCHAR"/> <result column="STATION_NAME" property="stationName" />
<result column="total_power" property="totalPower" jdbcType="DECIMAL"/> <result column="TOTAL_POWER" property="totalPower" />
<result column="area_code" property="areaCode" jdbcType="INTEGER"/> <result column="AREA_CODE" property="areaCode" />
<result column="longitude" property="longitude" jdbcType="DECIMAL"/> <result column="LONGITUDE" property="longitude" />
<result column="latitude" property="latitude" jdbcType="DECIMAL"/> <result column="LATITUDE" property="latitude" />
</resultMap> </resultMap>
<select id="selectOne" parameterType="pps.core.base.entity.BasePowerLinePlantView" resultMap="BaseResultMap"> <select id="selectOne" parameterType="pps.core.base.entity.BasePowerLinePlantView" resultMap="BaseResultMap">
select SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from BASE_POWER_LINE_PLANT FROM BASE_POWER_LINE_PLANT
where WHERE
id=#{id} ID=#{id}
</select> </select>
<select id="selectList" parameterType="pps.core.base.entity.BasePowerLinePlantView" resultMap="ExtendsResultMap"> <select id="selectList" parameterType="pps.core.base.entity.BasePowerLinePlantView" resultMap="ExtendsResultMap">
SELECT l.id, SELECT L.ID,
l.plant_id, L.PLANT_ID,
p.station_name, P.STATION_NAME,
p.total_power P.TOTAL_POWER
FROM BASE_POWER_LINE_PLANT l FROM BASE_POWER_LINE_PLANT L
LEFT JOIN BASE_PHOTOVOLTAIC_PLANT p ON l.plant_id = p.id LEFT JOIN BASE_PHOTOVOLTAIC_PLANT P ON L.PLANT_ID = P.ID
AND p.is_deleted = 1 AND P.IS_DELETED = 1
WHERE l.line_id = #{lineId} WHERE L.LINE_ID = #{lineId}
</select> </select>
<insert id="batchInsertList" parameterType="list"> <insert id="batchInsertList" parameterType="list">
INSERT INTO BASE_POWER_LINE_PLANT ( id, create_by_id, create_by_name, create_time, modify_by_id, INSERT INTO BASE_POWER_LINE_PLANT ( ID, CREATE_BY_ID, CREATE_BY_NAME, CREATE_TIME, MODIFY_BY_ID,
modify_by_name, modify_time, line_id, plant_id, ou_id ) MODIFY_BY_NAME, MODIFY_TIME, LINE_ID, PLANT_ID, OU_ID )
VALUES VALUES
<foreach collection="list" item="item" separator=","> <foreach collection="list" item="item" separator=",">
( (
...@@ -78,35 +79,35 @@ ...@@ -78,35 +79,35 @@
<select id="selectPlantListByParam" parameterType="pps.core.base.entity.BasePowerLinePlantView" <select id="selectPlantListByParam" parameterType="pps.core.base.entity.BasePowerLinePlantView"
resultMap="ExtendsResultMap"> resultMap="ExtendsResultMap">
SELECT l.id, SELECT L.ID,
l.line_id, L.LINE_ID,
l.plant_id, L.PLANT_ID,
p.area_code, P.AREA_CODE,
p.longitude, P.LONGITUDE,
p.latitude, P.LATITUDE,
p.station_name, P.STATION_NAME,
p.total_power P.TOTAL_POWER
FROM BASE_POWER_LINE b FROM BASE_POWER_LINE B
JOIN BASE_POWER_LINE_PLANT l ON b.id = l.line_id JOIN BASE_POWER_LINE_PLANT L ON B.ID = L.LINE_ID
JOIN BASE_PHOTOVOLTAIC_PLANT p ON l.plant_id = p.id JOIN BASE_PHOTOVOLTAIC_PLANT P ON L.PLANT_ID = P.ID
WHERE WHERE
b.is_deleted = 1 B.IS_DELETED = 1
AND l.is_deleted = 1 AND L.IS_DELETED = 1
AND p.is_deleted = 1 AND P.IS_DELETED = 1
<if test="ouIds != null and ouIds.size() > 0 "> <if test="ouIds != null and ouIds.size() > 0 ">
AND b.ou_id in AND B.OU_ID IN
<foreach collection="ouIds" separator="," item="item" open="(" close=")"> <foreach collection="ouIds" separator="," item="item" open="(" close=")">
#{item} #{item}
</foreach> </foreach>
</if> </if>
<if test="lineName != null and lineName != ''"> <if test="lineName != null and lineName != ''">
AND b.line_name = #{lineName} AND B.LINE_NAME = #{lineName}
</if> </if>
<if test="lineId != null and lineId != ''"> <if test="lineId != null and lineId != ''">
AND l.line_id = #{lineId} AND L.LINE_ID = #{lineId}
</if> </if>
<if test="lineIds != null and lineIds.size() > 0 "> <if test="lineIds != null and lineIds.size() > 0 ">
AND l.line_id IN AND L.LINE_ID IN
<foreach collection="lineIds" open="(" close=")" separator="," item="item"> <foreach collection="lineIds" open="(" close=")" separator="," item="item">
#{item} #{item}
</foreach> </foreach>
......
...@@ -2,82 +2,83 @@ ...@@ -2,82 +2,83 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pps.core.base.mapper.BasePowerLineStorageViewMapper"> <mapper namespace="pps.core.base.mapper.BasePowerLineStorageViewMapper">
<resultMap id="BaseResultMap" type="pps.core.base.entity.BasePowerLineStorageView"> <resultMap id="BaseResultMap" type="pps.core.base.entity.BasePowerLineStorageView">
<id column="id" property="id" jdbcType="VARCHAR"/> <id column="ID" property="id" />
<result column="is_deleted" property="isDeleted" jdbcType="INTEGER"/> <result column="IS_DELETED" property="isDeleted" />
<result column="create_by_id" property="createById" jdbcType="VARCHAR"/> <result column="CREATE_BY_ID" property="createById" />
<result column="create_by_name" property="createByName" jdbcType="VARCHAR"/> <result column="CREATE_BY_NAME" property="createByName" />
<result column="create_time" property="createTime" jdbcType="DATE"/> <result column="CREATE_TIME" property="createTime" />
<result column="modify_by_id" property="modifyById" jdbcType="VARCHAR"/> <result column="MODIFY_BY_ID" property="modifyById" />
<result column="modify_by_name" property="modifyByName" jdbcType="VARCHAR"/> <result column="MODIFY_BY_NAME" property="modifyByName" />
<result column="modify_time" property="modifyTime" jdbcType="DATE"/> <result column="MODIFY_TIME" property="modifyTime" />
<result column="line_id" property="lineId" jdbcType="VARCHAR"/> <result column="LINE_ID" property="lineId" />
<result column="storage_id" property="storageId" jdbcType="VARCHAR"/> <result column="STORAGE_ID" property="storageId" />
<result column="ou_id" property="ouId" jdbcType="VARCHAR"/> <result column="OU_ID" property="ouId" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id ID
, ,
is_deleted, IS_DELETED,
create_by_id, CREATE_BY_ID,
create_by_name, CREATE_BY_NAME,
create_time, CREATE_TIME,
modify_by_id, MODIFY_BY_ID,
modify_by_name, MODIFY_BY_NAME,
modify_time, MODIFY_TIME,
line_id, LINE_ID,
storage_id, STORAGE_ID,
ou_id OU_ID
</sql> </sql>
<resultMap id="ExtendsResultMap" type="pps.core.base.entity.BasePowerLineStorageView" extends="BaseResultMap"> <resultMap id="ExtendsResultMap" type="pps.core.base.entity.BasePowerLineStorageView" extends="BaseResultMap">
<result column="device_name" property="deviceName" jdbcType="VARCHAR"/> <result column="DEVICE_NAME" property="deviceName" />
<result column="apparatus_capacity" property="apparatusCapacity" jdbcType="DECIMAL"/> <result column="APPARATUS_CAPACITY" property="apparatusCapacity" />
<result column="rated_discharge_power" property="ratedDischargePower" jdbcType="DECIMAL"/> <result column="RATED_DISCHARGE_POWER" property="ratedDischargePower" />
<result column="rated_discharge_depth" property="ratedDischargeDepth" jdbcType="DECIMAL"/> <result column="RATED_DISCHARGE_DEPTH" property="ratedDischargeDepth" />
<result column="rated_discharge_efficiency" property="ratedDischargeEfficiency" jdbcType="DECIMAL"/> <result column="RATED_DISCHARGE_EFFICIENCY" property="ratedDischargeEfficiency" />
</resultMap> </resultMap>
<select id="selectOne" parameterType="pps.core.base.entity.BasePowerLineStorageView" resultMap="BaseResultMap"> <select id="selectOne" parameterType="pps.core.base.entity.BasePowerLineStorageView" resultMap="BaseResultMap">
select SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from BASE_POWER_LINE_STORAGE FROM BASE_POWER_LINE_STORAGE
where WHERE
id=#{id} ID=#{id}
</select> </select>
<select id="selectList" parameterType="pps.core.base.entity.BasePowerLineStorageView" resultMap="ExtendsResultMap"> <select id="selectList" parameterType="pps.core.base.entity.BasePowerLineStorageView" resultMap="ExtendsResultMap">
SELECT l.id, SELECT L.ID,
l.storage_id, L.STORAGE_ID,
d.device_name, D.DEVICE_NAME,
d.apparatus_capacity D.APPARATUS_CAPACITY
FROM BASE_POWER_LINE_STORAGE l FROM BASE_POWER_LINE_STORAGE L
LEFT JOIN BASE_ENERGY_STORAGE_DEVICE d ON l.storage_id = d.id LEFT JOIN BASE_ENERGY_STORAGE_DEVICE D ON L.STORAGE_ID = D.ID
AND d.is_deleted = 1 AND D.IS_DELETED = 1
WHERE l.line_id = #{lineId} WHERE L.LINE_ID = #{lineId}
</select> </select>
<select id="selectStorageAverageByLineIds" parameterType="pps.core.base.entity.BasePowerLineStorageView" <select id="selectStorageAverageByLineIds" parameterType="pps.core.base.entity.BasePowerLineStorageView"
resultMap="ExtendsResultMap"> resultMap="ExtendsResultMap">
SELECT SELECT
s.line_id, S.LINE_ID,
ROUND( AVG( d.rated_discharge_depth ) / 100, 2 ) AS rated_discharge_depth, ROUND( AVG( D.RATED_DISCHARGE_DEPTH ) / 100, 2 ) AS RATED_DISCHARGE_DEPTH,
ROUND( AVG( d.rated_discharge_efficiency ) / 100, 2 ) AS rated_discharge_efficiency, ROUND( AVG( D.RATED_DISCHARGE_EFFICIENCY ) / 100, 2 ) AS RATED_DISCHARGE_EFFICIENCY,
AVG( d.rated_discharge_power ) AS rated_discharge_power AVG( D.RATED_DISCHARGE_POWER ) AS RATED_DISCHARGE_POWER
FROM FROM
BASE_POWER_LINE_STORAGE s BASE_POWER_LINE_STORAGE S
JOIN BASE_ENERGY_STORAGE_DEVICE d ON s.storage_id = d.id JOIN BASE_ENERGY_STORAGE_DEVICE D ON S.STORAGE_ID = D.ID
WHERE WHERE
s.line_id IN S.LINE_ID IN
<foreach collection="list" open="(" close=")" separator="," item="item"> <foreach collection="list" open="(" close=")" separator="," item="item">
#{item} #{item}
</foreach> </foreach>
GROUP BY GROUP BY
s.line_id S.LINE_ID
</select> </select>
<insert id="batchInsertList" parameterType="list"> <insert id="batchInsertList" parameterType="list">
INSERT INTO BASE_POWER_LINE_STORAGE ( id, create_by_id, create_by_name, create_time, modify_by_id, INSERT INTO BASE_POWER_LINE_STORAGE ( ID, CREATE_BY_ID, CREATE_BY_NAME, CREATE_TIME, MODIFY_BY_ID,
modify_by_name, modify_time, line_id, storage_id, ou_id ) MODIFY_BY_NAME, MODIFY_TIME, LINE_ID, STORAGE_ID, OU_ID )
VALUES VALUES
<foreach collection="list" item="item" separator=","> <foreach collection="list" item="item" separator=",">
( (
......
...@@ -2,95 +2,96 @@ ...@@ -2,95 +2,96 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pps.core.base.mapper.BasePowerLineViewMapper"> <mapper namespace="pps.core.base.mapper.BasePowerLineViewMapper">
<resultMap id="BaseResultMap" type="pps.core.base.entity.BasePowerLineView"> <resultMap id="BaseResultMap" type="pps.core.base.entity.BasePowerLineView">
<id column="id" property="id" jdbcType="VARCHAR"/> <id column="ID" property="id" />
<result column="is_deleted" property="isDeleted" jdbcType="INTEGER"/> <result column="IS_DELETED" property="isDeleted" />
<result column="create_by_id" property="createById" jdbcType="VARCHAR"/> <result column="CREATE_BY_ID" property="createById" />
<result column="create_by_name" property="createByName" jdbcType="VARCHAR"/> <result column="CREATE_BY_NAME" property="createByName" />
<result column="create_time" property="createTime" jdbcType="DATE"/> <result column="CREATE_TIME" property="createTime" />
<result column="modify_by_id" property="modifyById" jdbcType="VARCHAR"/> <result column="MODIFY_BY_ID" property="modifyById" />
<result column="modify_by_name" property="modifyByName" jdbcType="VARCHAR"/> <result column="MODIFY_BY_NAME" property="modifyByName" />
<result column="modify_time" property="modifyTime" jdbcType="DATE"/> <result column="MODIFY_TIME" property="modifyTime" />
<result column="ou_id" property="ouId" jdbcType="VARCHAR"/> <result column="OU_ID" property="ouId" />
<result column="upper_line_id" property="upperLineId" jdbcType="VARCHAR"/> <result column="UPPER_LINE_ID" property="upperLineId" />
<result column="line_name" property="lineName" jdbcType="VARCHAR"/> <result column="LINE_NAME" property="lineName" />
<result column="grid_type_key" property="gridTypeKey" jdbcType="VARCHAR"/> <result column="GRID_TYPE_KEY" property="gridTypeKey" />
<result column="line_type_key" property="lineTypeKey" jdbcType="VARCHAR"/> <result column="LINE_TYPE_KEY" property="lineTypeKey" />
<result column="strategy_id" property="strategyId" jdbcType="VARCHAR"/> <result column="STRATEGY_ID" property="strategyId" />
<result column="is_share_dispatch" property="isShareDispatch" jdbcType="INTEGER"/> <result column="IS_SHARE_DISPATCH" property="isShareDispatch" />
<result column="is_reverse_dispatch" property="isReverseDispatch" jdbcType="INTEGER"/> <result column="IS_REVERSE_DISPATCH" property="isReverseDispatch" />
<result column="start_interval" property="startInterval" jdbcType="INTEGER"/> <result column="START_INTERVAL" property="startInterval" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id ID
, ,
is_deleted, IS_DELETED,
create_by_id, CREATE_BY_ID,
create_by_name, CREATE_BY_NAME,
create_time, CREATE_TIME,
modify_by_id, MODIFY_BY_ID,
modify_by_name, MODIFY_BY_NAME,
modify_time, MODIFY_TIME,
ou_id, OU_ID,
upper_line_id, UPPER_LINE_ID,
line_name, LINE_NAME,
grid_type_key, GRID_TYPE_KEY,
line_type_key, LINE_TYPE_KEY,
strategy_id, STRATEGY_ID,
is_share_dispatch, IS_SHARE_DISPATCH,
is_reverse_dispatch, IS_REVERSE_DISPATCH,
start_interval START_INTERVAL
</sql> </sql>
<resultMap id="ExtendsResultMap" type="pps.core.base.entity.BasePowerLineView" extends="BaseResultMap"> <resultMap id="ExtendsResultMap" type="pps.core.base.entity.BasePowerLineView" extends="BaseResultMap">
<result column="upper_line_name" property="upperLineName" jdbcType="VARCHAR"/> <result column="UPPER_LINE_NAME" property="upperLineName" />
<result column="policy_name" property="policyName" jdbcType="VARCHAR"/> <result column="POLICY_NAME" property="policyName" />
<result column="wellhead_count" property="wellheadCount" jdbcType="INTEGER"/> <result column="WELLHEAD_COUNT" property="wellheadCount" />
<result column="ou_name" property="ouName" jdbcType="VARCHAR"/> <result column="OU_NAME" property="ouName" />
</resultMap> </resultMap>
<select id="selectOne" parameterType="pps.core.base.entity.BasePowerLineView" resultMap="ExtendsResultMap"> <select id="selectOne" parameterType="pps.core.base.entity.BasePowerLineView" resultMap="ExtendsResultMap">
select SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
, ( SELECT line_name FROM BASE_POWER_LINE l WHERE l.id = BASE_POWER_LINE.upper_line_id ) AS upper_line_name , ( SELECT LINE_NAME FROM BASE_POWER_LINE L WHERE L.ID = BASE_POWER_LINE.UPPER_LINE_ID ) AS UPPER_LINE_NAME
, ( SELECT policy_name FROM BASE_PRICE_STRATEGY s WHERE s.id = BASE_POWER_LINE.strategy_id ) AS policy_name , ( SELECT POLICY_NAME FROM BASE_PRICE_STRATEGY S WHERE S.ID = BASE_POWER_LINE.STRATEGY_ID ) AS POLICY_NAME
from BASE_POWER_LINE FROM BASE_POWER_LINE
where WHERE
id=#{id} ID=#{id}
</select> </select>
<select id="selectList" parameterType="pps.core.base.entity.BasePowerLineView" resultMap="ExtendsResultMap"> <select id="selectList" parameterType="pps.core.base.entity.BasePowerLineView" resultMap="ExtendsResultMap">
select SELECT
b.id, B.ID,
b.ou_id, B.OU_ID,
b.upper_line_id, B.UPPER_LINE_ID,
b.line_name, B.LINE_NAME,
b.grid_type_key, B.GRID_TYPE_KEY,
b.line_type_key, B.LINE_TYPE_KEY,
b.strategy_id, B.STRATEGY_ID,
b.is_share_dispatch, B.IS_SHARE_DISPATCH,
b.is_reverse_dispatch, B.IS_REVERSE_DISPATCH,
b.start_interval, B.START_INTERVAL,
( SELECT line_name FROM BASE_POWER_LINE l WHERE l.id = b.upper_line_id ) AS upper_line_name, ( SELECT LINE_NAME FROM BASE_POWER_LINE L WHERE L.ID = B.UPPER_LINE_ID ) AS UPPER_LINE_NAME,
( SELECT COUNT( 1 ) FROM BASE_POWER_LINE_WELLHEAD w WHERE b.id = w.line_id ) AS wellhead_count, ( SELECT COUNT( 1 ) FROM BASE_POWER_LINE_WELLHEAD W WHERE B.ID = W.LINE_ID ) AS WELLHEAD_COUNT,
o.ou_name O.OU_NAME
from BASE_POWER_LINE b FROM BASE_POWER_LINE B
LEFT JOIN SYS_ORGANIZATION o ON b.ou_id = o.id LEFT JOIN SYS_ORGANIZATION O ON B.OU_ID = O.ID
where WHERE
b.is_deleted = 1 B.IS_DELETED = 1
AND o.is_deleted = 1 AND O.IS_DELETED = 1
AND b.ou_id in AND B.OU_ID IN
<foreach collection="ouList" open="(" close=")" separator="," item="item"> <foreach collection="ouList" open="(" close=")" separator="," item="item">
#{item} #{item}
</foreach> </foreach>
<if test="lineName != null and lineName != ''"> <if test="lineName != null and lineName != ''">
AND b.line_name LIKE CONCAT( '%', #{lineName}, '%' ) AND B.LINE_NAME LIKE CONCAT( '%', #{lineName}, '%' )
</if> </if>
<if test="lineTypeKey != null and lineTypeKey != ''"> <if test="lineTypeKey != null and lineTypeKey != ''">
AND b.line_type_key = #{lineTypeKey} AND B.LINE_TYPE_KEY = #{lineTypeKey}
</if> </if>
ORDER BY ORDER BY
o.ou_name ASC, O.OU_NAME ASC,
b.line_type_key ASC, B.LINE_TYPE_KEY ASC,
b.line_name ASC B.LINE_NAME ASC
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -2,111 +2,112 @@ ...@@ -2,111 +2,112 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pps.core.base.mapper.BasePowerLineWellheadViewMapper"> <mapper namespace="pps.core.base.mapper.BasePowerLineWellheadViewMapper">
<resultMap id="BaseResultMap" type="pps.core.base.entity.BasePowerLineWellheadView"> <resultMap id="BaseResultMap" type="pps.core.base.entity.BasePowerLineWellheadView">
<id column="id" property="id" jdbcType="VARCHAR"/> <id column="ID" property="id"/>
<result column="is_deleted" property="isDeleted" jdbcType="INTEGER"/> <result column="IS_DELETED" property="isDeleted"/>
<result column="create_by_id" property="createById" jdbcType="VARCHAR"/> <result column="CREATE_BY_ID" property="createById"/>
<result column="create_by_name" property="createByName" jdbcType="VARCHAR"/> <result column="CREATE_BY_NAME" property="createByName"/>
<result column="create_time" property="createTime" jdbcType="DATE"/> <result column="CREATE_TIME" property="createTime"/>
<result column="modify_by_id" property="modifyById" jdbcType="VARCHAR"/> <result column="MODIFY_BY_ID" property="modifyById"/>
<result column="modify_by_name" property="modifyByName" jdbcType="VARCHAR"/> <result column="MODIFY_BY_NAME" property="modifyByName"/>
<result column="modify_time" property="modifyTime" jdbcType="DATE"/> <result column="MODIFY_TIME" property="modifyTime"/>
<result column="line_id" property="lineId" jdbcType="VARCHAR"/> <result column="LINE_ID" property="lineId"/>
<result column="wellhead_id" property="wellheadId" jdbcType="VARCHAR"/> <result column="WELLHEAD_ID" property="wellheadId"/>
<result column="ou_id" property="ouId" jdbcType="VARCHAR"/> <result column="OU_ID" property="ouId"/>
<result column="start_seq" property="startSeq" jdbcType="INTEGER"/> <result column="START_SEQ" property="startSeq"/>
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id ID
, ,
is_deleted, IS_DELETED,
create_by_id, CREATE_BY_ID,
create_by_name, CREATE_BY_NAME,
create_time, CREATE_TIME,
modify_by_id, MODIFY_BY_ID,
modify_by_name, MODIFY_BY_NAME,
modify_time, MODIFY_TIME,
line_id, LINE_ID,
wellhead_id, WELLHEAD_ID,
ou_id, OU_ID,
start_seq START_SEQ
</sql> </sql>
<resultMap id="ExtendsResultMap" type="pps.core.base.entity.BasePowerLineWellheadView" extends="BaseResultMap"> <resultMap id="ExtendsResultMap" type="pps.core.base.entity.BasePowerLineWellheadView" extends="BaseResultMap">
<result column="well_number" property="wellNumber" jdbcType="VARCHAR"/> <result column="WELL_NUMBER" property="wellNumber"/>
<result column="run_type_key" property="runTypeKey" jdbcType="VARCHAR"/> <result column="RUN_TYPE_KEY" property="runTypeKey"/>
<result column="run_type_name" property="runTypeName" jdbcType="VARCHAR"/> <result column="RUN_TYPE_NAME" property="runTypeName"/>
<result column="service_rating" property="serviceRating" jdbcType="DECIMAL"/> <result column="SERVICE_RATING" property="serviceRating"/>
<result column="rated_power" property="ratedPower" jdbcType="DECIMAL"/> <result column="RATED_POWER" property="ratedPower"/>
<result column="line_name" property="lineName" jdbcType="VARCHAR"/> <result column="LINE_NAME" property="lineName"/>
</resultMap> </resultMap>
<select id="selectOne" parameterType="pps.core.base.entity.BasePowerLineWellheadView" resultMap="BaseResultMap"> <select id="selectOne" parameterType="pps.core.base.entity.BasePowerLineWellheadView" resultMap="BaseResultMap">
select SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from BASE_POWER_LINE_WELLHEAD FROM BASE_POWER_LINE_WELLHEAD
where WHERE
id=#{id} ID=#{id}
</select> </select>
<select id="selectList" parameterType="pps.core.base.entity.BasePowerLineWellheadView" resultMap="ExtendsResultMap"> <select id="selectList" parameterType="pps.core.base.entity.BasePowerLineWellheadView" resultMap="ExtendsResultMap">
SELECT l.id, SELECT L.ID,
l.wellhead_id, L.WELLHEAD_ID,
l.start_seq, L.START_SEQ,
w.well_number, W.WELL_NUMBER,
w.run_type_key, W.RUN_TYPE_KEY,
w.service_rating W.SERVICE_RATING
FROM BASE_POWER_LINE_WELLHEAD l FROM BASE_POWER_LINE_WELLHEAD L
LEFT JOIN BASE_WELLHEAD w ON l.wellhead_id = w.id LEFT JOIN BASE_WELLHEAD W ON L.WELLHEAD_ID = W.ID
AND w.is_deleted = 1 AND W.IS_DELETED = 1
WHERE l.line_id = #{lineId} WHERE L.LINE_ID = #{lineId}
<if test="wellheadId != null and wellheadId != ''"> <if test="wellheadId != null and wellheadId != ''">
AND l.wellhead_id = #{wellheadId} AND L.WELLHEAD_ID = #{wellheadId}
</if> </if>
ORDER BY ORDER BY
l.start_seq ASC L.START_SEQ ASC
</select> </select>
<select id="selectWellheadListByParam" parameterType="pps.core.base.entity.BasePowerLineWellheadView" <select id="selectWellheadListByParam" parameterType="pps.core.base.entity.BasePowerLineWellheadView"
resultMap="ExtendsResultMap"> resultMap="ExtendsResultMap">
SELECT SELECT
p.line_name, P.LINE_NAME,
p.id AS line_id, P.ID AS LINE_ID,
w.id AS wellhead_id, W.ID AS WELLHEAD_ID,
w.well_number, W.WELL_NUMBER,
w.run_type_key, W.RUN_TYPE_KEY,
w.run_type_name, W.RUN_TYPE_NAME,
w.rated_power W.RATED_POWER
FROM FROM
BASE_POWER_LINE p BASE_POWER_LINE P
JOIN BASE_POWER_LINE_WELLHEAD l ON p.id = l.line_id JOIN BASE_POWER_LINE_WELLHEAD L ON P.ID = L.LINE_ID
JOIN BASE_WELLHEAD w ON l.wellhead_id = w.id JOIN BASE_WELLHEAD W ON L.WELLHEAD_ID = W.ID
WHERE WHERE
p.is_deleted = 1 P.IS_DELETED = 1
AND l.is_deleted = 1 AND L.IS_DELETED = 1
AND w.is_deleted = 1 AND W.IS_DELETED = 1
<if test="ouIds != null and ouIds.size() > 0 "> <if test="ouIds != null and ouIds.size() > 0 ">
AND p.ou_id in AND P.OU_ID IN
<foreach collection="ouIds" separator="," item="item" open="(" close=")"> <foreach collection="ouIds" separator="," item="item" open="(" close=")">
#{item} #{item}
</foreach> </foreach>
</if> </if>
<if test="lineName != null and lineName != ''"> <if test="lineName != null and lineName != ''">
AND p.line_name = #{lineName} AND P.LINE_NAME = #{lineName}
</if> </if>
<if test="runTypeKey != null and runTypeKey != ''"> <if test="runTypeKey != null and runTypeKey != ''">
AND w.run_type_key = #{runTypeKey} AND W.RUN_TYPE_KEY = #{runTypeKey}
</if> </if>
<if test="lineId != null and lineId != ''"> <if test="lineId != null and lineId != ''">
AND p.id = #{lineId} AND P.ID = #{lineId}
</if> </if>
<if test="lineIds != null and lineIds.size() > 0 "> <if test="lineIds != null and lineIds.size() > 0 ">
AND p.id IN AND P.ID IN
<foreach collection="lineIds" open="(" close=")" separator="," item="item"> <foreach collection="lineIds" open="(" close=")" separator="," item="item">
#{item} #{item}
</foreach> </foreach>
</if> </if>
<if test="wellheadIds != null and wellheadIds.size() > 0"> <if test="wellheadIds != null and wellheadIds.size() > 0">
AND l.wellhead_id NOT IN AND L.WELLHEAD_ID NOT IN
<foreach collection="wellheadIds" open="(" close=")" separator="," item="item"> <foreach collection="wellheadIds" open="(" close=")" separator="," item="item">
#{item} #{item}
</foreach> </foreach>
...@@ -114,8 +115,8 @@ ...@@ -114,8 +115,8 @@
</select> </select>
<insert id="batchInsertList" parameterType="list"> <insert id="batchInsertList" parameterType="list">
INSERT INTO BASE_POWER_LINE_WELLHEAD ( id, create_by_id, create_by_name, create_time, modify_by_id, INSERT INTO BASE_POWER_LINE_WELLHEAD ( ID, CREATE_BY_ID, CREATE_BY_NAME, CREATE_TIME, MODIFY_BY_ID,
modify_by_name, modify_time, line_id, wellhead_id, ou_id, start_seq ) MODIFY_BY_NAME, MODIFY_TIME, LINE_ID, WELLHEAD_ID, OU_ID, START_SEQ )
VALUES VALUES
<foreach collection="list" item="item" separator=","> <foreach collection="list" item="item" separator=",">
( (
...@@ -136,14 +137,14 @@ ...@@ -136,14 +137,14 @@
<select id="selectWellheadListByPlant" parameterType="pps.core.base.entity.BasePowerLineWellheadView" <select id="selectWellheadListByPlant" parameterType="pps.core.base.entity.BasePowerLineWellheadView"
resultMap="ExtendsResultMap"> resultMap="ExtendsResultMap">
SELECT b.well_number SELECT B.WELL_NUMBER
FROM BASE_POWER_LINE_PLANT p FROM BASE_POWER_LINE_PLANT P
JOIN BASE_POWER_LINE_WELLHEAD w ON p.line_id = w.line_id JOIN BASE_POWER_LINE_WELLHEAD W ON P.LINE_ID = W.LINE_ID
JOIN BASE_WELLHEAD b ON w.wellhead_id = b.id JOIN BASE_WELLHEAD B ON W.WELLHEAD_ID = B.ID
WHERE p.is_deleted = 1 WHERE P.IS_DELETED = 1
AND w.is_deleted = 1 AND W.IS_DELETED = 1
AND b.is_deleted = 1 AND B.IS_DELETED = 1
AND p.plant_id IN AND P.PLANT_ID IN
<foreach collection="plantIds" open="(" close=")" separator="," item="item"> <foreach collection="plantIds" open="(" close=")" separator="," item="item">
#{item} #{item}
</foreach> </foreach>
......
...@@ -2,71 +2,73 @@ ...@@ -2,71 +2,73 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pps.core.base.mapper.BasePriceStrategyDetailViewMapper"> <mapper namespace="pps.core.base.mapper.BasePriceStrategyDetailViewMapper">
<resultMap id="BaseResultMap" type="pps.core.base.entity.BasePriceStrategyDetailView"> <resultMap id="BaseResultMap" type="pps.core.base.entity.BasePriceStrategyDetailView">
<id column="id" property="id" jdbcType="VARCHAR"/> <id column="ID" property="id" />
<result column="is_deleted" property="isDeleted" jdbcType="INTEGER"/> <result column="IS_DELETED" property="isDeleted" />
<result column="create_by_id" property="createById" jdbcType="VARCHAR"/> <result column="CREATE_BY_ID" property="createById" />
<result column="create_by_name" property="createByName" jdbcType="VARCHAR"/> <result column="CREATE_BY_NAME" property="createByName" />
<result column="create_time" property="createTime" jdbcType="DATE"/> <result column="CREATE_TIME" property="createTime" />
<result column="modify_by_id" property="modifyById" jdbcType="VARCHAR"/> <result column="MODIFY_BY_ID" property="modifyById" />
<result column="modify_by_name" property="modifyByName" jdbcType="VARCHAR"/> <result column="MODIFY_BY_NAME" property="modifyByName" />
<result column="modify_time" property="modifyTime" jdbcType="DATE"/> <result column="MODIFY_TIME" property="modifyTime" />
<result column="strategy_id" property="strategyId" jdbcType="VARCHAR"/> <result column="STRATEGY_ID" property="strategyId" />
<result column="strategy_month" property="strategyMonth" jdbcType="VARCHAR"/> <result column="STRATEGY_MONTH" property="strategyMonth" />
<result column="period_type_key" property="periodTypeKey" jdbcType="VARCHAR"/> <result column="PERIOD_TYPE_KEY" property="periodTypeKey" />
<result column="start_time" property="startTime" jdbcType="VARCHAR"/> <result column="START_TIME" property="startTime" />
<result column="end_time" property="endTime" jdbcType="VARCHAR"/> <result column="END_TIME" property="endTime" />
<result column="electrovalence" property="electrovalence" jdbcType="DECIMAL"/> <result column="ELECTROVALENCE" property="electrovalence" />
<result column="internal_settlement_price" property="internalSettlementPrice" jdbcType="DECIMAL"/> <result column="INTERNAL_SETTLEMENT_PRICE" property="internalSettlementPrice" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id ID
, ,
is_deleted, IS_DELETED,
create_by_id, CREATE_BY_ID,
create_by_name, CREATE_BY_NAME,
create_time, CREATE_TIME,
modify_by_id, MODIFY_BY_ID,
modify_by_name, MODIFY_BY_NAME,
modify_time, MODIFY_TIME,
strategy_id, STRATEGY_ID,
strategy_month, STRATEGY_MONTH,
period_type_key, PERIOD_TYPE_KEY,
start_time, START_TIME,
end_time, END_TIME,
electrovalence, ELECTROVALENCE,
internal_settlement_price INTERNAL_SETTLEMENT_PRICE
</sql> </sql>
<select id="selectOne" parameterType="pps.core.base.entity.BasePriceStrategyDetailView" resultMap="BaseResultMap"> <select id="selectOne" parameterType="pps.core.base.entity.BasePriceStrategyDetailView" resultMap="BaseResultMap">
select SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from BASE_PRICE_STRATEGY_DETAIL FROM BASE_PRICE_STRATEGY_DETAIL
where WHERE
id=#{id} ID=#{id}
</select> </select>
<select id="selectList" parameterType="pps.core.base.entity.BasePriceStrategyDetailView" resultMap="BaseResultMap"> <select id="selectList" parameterType="pps.core.base.entity.BasePriceStrategyDetailView" resultMap="BaseResultMap">
select SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from BASE_PRICE_STRATEGY_DETAIL FROM BASE_PRICE_STRATEGY_DETAIL
where WHERE
id=#{id} ID=#{id}
</select> </select>
<insert id="batchInsertList" parameterType="list"> <insert id="batchInsertList" parameterType="list">
INSERT INTO BASE_PRICE_STRATEGY_DETAIL ( INSERT INTO BASE_PRICE_STRATEGY_DETAIL (
id, ID,
create_by_id, CREATE_BY_ID,
create_by_name, CREATE_BY_NAME,
create_time, CREATE_TIME,
modify_by_id, MODIFY_BY_ID,
modify_by_name, MODIFY_BY_NAME,
modify_time, MODIFY_TIME,
strategy_id, STRATEGY_ID,
strategy_month, STRATEGY_MONTH,
period_type_key, PERIOD_TYPE_KEY,
start_time, START_TIME,
end_time, END_TIME,
electrovalence, ELECTROVALENCE,
internal_settlement_price INTERNAL_SETTLEMENT_PRICE
) )
VALUES VALUES
<foreach collection="list" item="item" separator=","> <foreach collection="list" item="item" separator=",">
...@@ -91,24 +93,24 @@ ...@@ -91,24 +93,24 @@
<select id="selectDetailList" parameterType="pps.core.base.entity.BasePriceStrategyDetailView" <select id="selectDetailList" parameterType="pps.core.base.entity.BasePriceStrategyDetailView"
resultMap="BaseResultMap"> resultMap="BaseResultMap">
SELECT d.strategy_month, SELECT D.STRATEGY_MONTH,
d.period_type_key, D.PERIOD_TYPE_KEY,
d.start_time, D.START_TIME,
d.end_time, D.END_TIME,
d.electrovalence D.ELECTROVALENCE
FROM BASE_PRICE_STRATEGY_MONTH m FROM BASE_PRICE_STRATEGY_MONTH M
LEFT JOIN BASE_PRICE_STRATEGY_DETAIL d ON m.strategy_month = d.strategy_month LEFT JOIN BASE_PRICE_STRATEGY_DETAIL D ON M.STRATEGY_MONTH = D.STRATEGY_MONTH
AND m.strategy_id = d.strategy_id AND M.STRATEGY_ID = D.STRATEGY_ID
WHERE m.is_deleted = 1 WHERE M.IS_DELETED = 1
AND d.is_deleted = 1 AND D.IS_DELETED = 1
AND m.strategy_id = #{strategyId} AND M.STRATEGY_ID = #{strategyId}
<if test="monthList != null and monthList.size() > 0"> <if test="monthList != null and monthList.size() > 0">
AND m.strategy_month IN AND M.STRATEGY_MONTH IN
<foreach collection="monthList" item="item" open="(" close=")" separator=","> <foreach collection="monthList" item="item" open="(" close=")" separator=",">
#{item} #{item}
</foreach> </foreach>
</if> </if>
ORDER BY CAST(m.strategy_month AS SIGNED INTEGER), ORDER BY CAST(M.STRATEGY_MONTH AS SIGNED INTEGER),
d.start_time D.START_TIME
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -2,48 +2,51 @@ ...@@ -2,48 +2,51 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pps.core.base.mapper.BasePriceStrategyMonthViewMapper"> <mapper namespace="pps.core.base.mapper.BasePriceStrategyMonthViewMapper">
<resultMap id="BaseResultMap" type="pps.core.base.entity.BasePriceStrategyMonthView"> <resultMap id="BaseResultMap" type="pps.core.base.entity.BasePriceStrategyMonthView">
<id column="id" property="id" jdbcType="VARCHAR"/> <id column="ID" property="id" />
<result column="is_deleted" property="isDeleted" jdbcType="INTEGER"/> <result column="IS_DELETED" property="isDeleted" />
<result column="create_by_id" property="createById" jdbcType="VARCHAR"/> <result column="CREATE_BY_ID" property="createById" />
<result column="create_by_name" property="createByName" jdbcType="VARCHAR"/> <result column="CREATE_BY_NAME" property="createByName" />
<result column="create_time" property="createTime" jdbcType="DATE"/> <result column="CREATE_TIME" property="createTime" />
<result column="modify_by_id" property="modifyById" jdbcType="VARCHAR"/> <result column="MODIFY_BY_ID" property="modifyById" />
<result column="modify_by_name" property="modifyByName" jdbcType="VARCHAR"/> <result column="MODIFY_BY_NAME" property="modifyByName" />
<result column="modify_time" property="modifyTime" jdbcType="DATE"/> <result column="MODIFY_TIME" property="modifyTime" />
<result column="strategy_id" property="strategyId" jdbcType="VARCHAR"/> <result column="STRATEGY_ID" property="strategyId" />
<result column="strategy_month" property="strategyMonth" jdbcType="VARCHAR"/> <result column="STRATEGY_MONTH" property="strategyMonth" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id ID
, ,
is_deleted, IS_DELETED,
create_by_id, CREATE_BY_ID,
create_by_name, CREATE_BY_NAME,
create_time, CREATE_TIME,
modify_by_id, MODIFY_BY_ID,
modify_by_name, MODIFY_BY_NAME,
modify_time, MODIFY_TIME,
strategy_id, STRATEGY_ID,
strategy_month STRATEGY_MONTH
</sql> </sql>
<select id="selectOne" parameterType="pps.core.base.entity.BasePriceStrategyMonthView" resultMap="BaseResultMap"> <select id="selectOne" parameterType="pps.core.base.entity.BasePriceStrategyMonthView" resultMap="BaseResultMap">
select SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from BASE_PRICE_STRATEGY_MONTH FROM BASE_PRICE_STRATEGY_MONTH
where WHERE
id=#{id} ID=#{id}
</select> </select>
<select id="selectList" parameterType="pps.core.base.entity.BasePriceStrategyMonthView" resultMap="BaseResultMap"> <select id="selectList" parameterType="pps.core.base.entity.BasePriceStrategyMonthView" resultMap="BaseResultMap">
select SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from BASE_PRICE_STRATEGY_MONTH FROM BASE_PRICE_STRATEGY_MONTH
where WHERE
id=#{id} ID=#{id}
</select> </select>
<insert id="batchInsertList" parameterType="list"> <insert id="batchInsertList" parameterType="list">
INSERT INTO BASE_PRICE_STRATEGY_MONTH ( id, create_by_id, create_by_name, create_time, modify_by_id, INSERT INTO BASE_PRICE_STRATEGY_MONTH ( ID, CREATE_BY_ID, CREATE_BY_NAME, CREATE_TIME, MODIFY_BY_ID,
modify_by_name, modify_time, strategy_id, strategy_month ) MODIFY_BY_NAME, MODIFY_TIME, STRATEGY_ID, STRATEGY_MONTH )
VALUES VALUES
<foreach collection="list" item="item" separator=","> <foreach collection="list" item="item" separator=",">
( (
......
...@@ -2,67 +2,69 @@ ...@@ -2,67 +2,69 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pps.core.base.mapper.BasePriceStrategyViewMapper"> <mapper namespace="pps.core.base.mapper.BasePriceStrategyViewMapper">
<resultMap id="BaseResultMap" type="pps.core.base.entity.BasePriceStrategyView"> <resultMap id="BaseResultMap" type="pps.core.base.entity.BasePriceStrategyView">
<id column="id" property="id" jdbcType="VARCHAR"/> <id column="ID" property="id" />
<result column="is_deleted" property="isDeleted" jdbcType="INTEGER"/> <result column="IS_DELETED" property="isDeleted" />
<result column="create_by_id" property="createById" jdbcType="VARCHAR"/> <result column="CREATE_BY_ID" property="createById" />
<result column="create_by_name" property="createByName" jdbcType="VARCHAR"/> <result column="CREATE_BY_NAME" property="createByName" />
<result column="create_time" property="createTime" jdbcType="DATE"/> <result column="CREATE_TIME" property="createTime" />
<result column="modify_by_id" property="modifyById" jdbcType="VARCHAR"/> <result column="MODIFY_BY_ID" property="modifyById" />
<result column="modify_by_name" property="modifyByName" jdbcType="VARCHAR"/> <result column="MODIFY_BY_NAME" property="modifyByName" />
<result column="modify_time" property="modifyTime" jdbcType="DATE"/> <result column="MODIFY_TIME" property="modifyTime" />
<result column="policy_name" property="policyName" jdbcType="VARCHAR"/> <result column="POLICY_NAME" property="policyName" />
<result column="area_code" property="areaCode" jdbcType="INTEGER"/> <result column="AREA_CODE" property="areaCode" />
<result column="strategy_year" property="strategyYear" jdbcType="VARCHAR"/> <result column="STRATEGY_YEAR" property="strategyYear" />
<result column="is_fixed_price" property="isFixedPrice" jdbcType="INTEGER"/> <result column="IS_FIXED_PRICE" property="isFixedPrice" />
<result column="fixed_electricity_price" property="fixedElectricityPrice" jdbcType="DECIMAL"/> <result column="FIXED_ELECTRICITY_PRICE" property="fixedElectricityPrice" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id ID
, ,
is_deleted, IS_DELETED,
create_by_id, CREATE_BY_ID,
create_by_name, CREATE_BY_NAME,
create_time, CREATE_TIME,
modify_by_id, MODIFY_BY_ID,
modify_by_name, MODIFY_BY_NAME,
modify_time, MODIFY_TIME,
policy_name, POLICY_NAME,
area_code, AREA_CODE,
strategy_year, STRATEGY_YEAR,
is_fixed_price, IS_FIXED_PRICE,
fixed_electricity_price FIXED_ELECTRICITY_PRICE
</sql> </sql>
<select id="selectOne" parameterType="pps.core.base.entity.BasePriceStrategyView" resultMap="BaseResultMap"> <select id="selectOne" parameterType="pps.core.base.entity.BasePriceStrategyView" resultMap="BaseResultMap">
select SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from BASE_PRICE_STRATEGY FROM BASE_PRICE_STRATEGY
where WHERE
id=#{id} ID=#{id}
</select> </select>
<resultMap id="ExtendResultMap" type="pps.core.base.entity.BasePriceStrategyView" extends="BaseResultMap"> <resultMap id="ExtendResultMap" type="pps.core.base.entity.BasePriceStrategyView" extends="BaseResultMap">
<result column="is_fixed_price_value" property="isFixedPriceValue" jdbcType="VARCHAR"/> <result column="IS_FIXED_PRICE_VALUE" property="isFixedPriceValue" />
</resultMap> </resultMap>
<select id="selectList" parameterType="pps.core.base.entity.BasePriceStrategyView" resultMap="ExtendResultMap"> <select id="selectList" parameterType="pps.core.base.entity.BasePriceStrategyView" resultMap="ExtendResultMap">
SELECT id, SELECT ID,
policy_name, POLICY_NAME,
area_code, AREA_CODE,
strategy_year, STRATEGY_YEAR,
is_fixed_price, IS_FIXED_PRICE,
fixed_electricity_price, FIXED_ELECTRICITY_PRICE,
CASE CASE
is_fixed_price IS_FIXED_PRICE
WHEN 0 THEN WHEN 0 THEN
'是' '是'
ELSE '否' ELSE '否'
END is_fixed_price_value END IS_FIXED_PRICE_VALUE
FROM BASE_PRICE_STRATEGY FROM BASE_PRICE_STRATEGY
WHERE WHERE
is_deleted = 1 IS_DELETED = 1
<if test=" param.policyName != null and param.policyName != '' "> <if test=" param.policyName != null and param.policyName != '' ">
AND policy_name LIKE CONCAT( '%', #{param.policyName}, '%' ) AND POLICY_NAME LIKE CONCAT( '%', #{param.policyName}, '%' )
</if> </if>
ORDER BY modify_time DESC ORDER BY MODIFY_TIME DESC
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -2,13 +2,13 @@ ...@@ -2,13 +2,13 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pps.core.base.mapper.BaseProjectInfoPredictedDataViewMapper"> <mapper namespace="pps.core.base.mapper.BaseProjectInfoPredictedDataViewMapper">
<insert id="batchInsert"> <insert id="batchInsert">
insert into BASE_PROJECT_INFO_PREDICTED_DATA( INSERT INTO BASE_PROJECT_INFO_PREDICTED_DATA(
project_id, PROJECT_ID,
particular_year, PARTICULAR_YEAR,
predicted_power, PREDICTED_POWER,
create_by_id, CREATE_BY_ID,
create_by_name, CREATE_BY_NAME,
create_time CREATE_TIME
) VALUES ) VALUES
<foreach collection="list" item="item" separator=","> <foreach collection="list" item="item" separator=",">
( (
......
...@@ -2,59 +2,62 @@ ...@@ -2,59 +2,62 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pps.core.base.mapper.BaseWellheadViewMapper"> <mapper namespace="pps.core.base.mapper.BaseWellheadViewMapper">
<resultMap id="BaseResultMap" type="pps.core.base.entity.BaseWellheadView"> <resultMap id="BaseResultMap" type="pps.core.base.entity.BaseWellheadView">
<id column="id" property="id" jdbcType="VARCHAR"/> <id column="ID" property="id" />
<result column="is_deleted" property="isDeleted" jdbcType="INTEGER"/> <result column="IS_DELETED" property="isDeleted" />
<result column="create_by_id" property="createById" jdbcType="VARCHAR"/> <result column="CREATE_BY_ID" property="createById" />
<result column="create_by_name" property="createByName" jdbcType="VARCHAR"/> <result column="CREATE_BY_NAME" property="createByName" />
<result column="create_time" property="createTime" jdbcType="DATE"/> <result column="CREATE_TIME" property="createTime" />
<result column="modify_by_id" property="modifyById" jdbcType="VARCHAR"/> <result column="MODIFY_BY_ID" property="modifyById" />
<result column="modify_by_name" property="modifyByName" jdbcType="VARCHAR"/> <result column="MODIFY_BY_NAME" property="modifyByName" />
<result column="modify_time" property="modifyTime" jdbcType="DATE"/> <result column="MODIFY_TIME" property="modifyTime" />
<result column="ou_id" property="ouId" jdbcType="VARCHAR"/> <result column="OU_ID" property="ouId" />
<result column="ou_name" property="ouName" jdbcType="VARCHAR"/> <result column="OU_NAME" property="ouName" />
<result column="well_number" property="wellNumber" jdbcType="VARCHAR"/> <result column="WELL_NUMBER" property="wellNumber" />
<result column="run_type_key" property="runTypeKey" jdbcType="VARCHAR"/> <result column="RUN_TYPE_KEY" property="runTypeKey" />
<result column="run_type_name" property="runTypeName" jdbcType="VARCHAR"/> <result column="RUN_TYPE_NAME" property="runTypeName" />
<result column="service_rating" property="serviceRating" jdbcType="DECIMAL"/> <result column="SERVICE_RATING" property="serviceRating" />
<result column="rated_power" property="ratedPower" jdbcType="DECIMAL"/> <result column="RATED_POWER" property="ratedPower" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id ID
, ,
is_deleted, IS_DELETED,
create_by_id, CREATE_BY_ID,
create_by_name, CREATE_BY_NAME,
create_time, CREATE_TIME,
modify_by_id, MODIFY_BY_ID,
modify_by_name, MODIFY_BY_NAME,
modify_time, MODIFY_TIME,
ou_id, OU_ID,
ou_name, OU_NAME,
well_number, WELL_NUMBER,
run_type_key, RUN_TYPE_KEY,
run_type_name, RUN_TYPE_NAME,
service_rating, SERVICE_RATING,
rated_power RATED_POWER
</sql> </sql>
<select id="selectOne" parameterType="pps.core.base.entity.BaseWellheadView" resultMap="BaseResultMap"> <select id="selectOne" parameterType="pps.core.base.entity.BaseWellheadView" resultMap="BaseResultMap">
select SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from BASE_WELLHEAD FROM BASE_WELLHEAD
where WHERE
id=#{id} ID=#{id}
</select> </select>
<select id="selectList" parameterType="pps.core.base.entity.BaseWellheadView" resultMap="BaseResultMap"> <select id="selectList" parameterType="pps.core.base.entity.BaseWellheadView" resultMap="BaseResultMap">
select SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from BASE_WELLHEAD FROM BASE_WELLHEAD
where WHERE
id=#{id} ID=#{id}
</select> </select>
<insert id="batchInsertList" parameterType="list"> <insert id="batchInsertList" parameterType="list">
INSERT INTO BASE_WELLHEAD (id, is_deleted, create_by_id, create_by_name, create_time, modify_by_id, INSERT INTO BASE_WELLHEAD (ID, IS_DELETED, CREATE_BY_ID, CREATE_BY_NAME, CREATE_TIME, MODIFY_BY_ID,
modify_by_name, modify_time, ou_id, ou_name, well_number, run_type_key, run_type_name, service_rating, MODIFY_BY_NAME, MODIFY_TIME, OU_ID, OU_NAME, WELL_NUMBER, RUN_TYPE_KEY, RUN_TYPE_NAME, SERVICE_RATING,
rated_power) VALUES RATED_POWER) VALUES
<foreach collection="list" item="item" separator=","> <foreach collection="list" item="item" separator=",">
( (
#{item.id}, #{item.id},
......
...@@ -2,50 +2,53 @@ ...@@ -2,50 +2,53 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pps.core.base.mapper.BaseWindTowerViewMapper"> <mapper namespace="pps.core.base.mapper.BaseWindTowerViewMapper">
<resultMap id="BaseResultMap" type="pps.core.base.entity.BaseWindTowerView"> <resultMap id="BaseResultMap" type="pps.core.base.entity.BaseWindTowerView">
<id column="id" property="id" jdbcType="VARCHAR"/> <id column="ID" property="id" />
<result column="is_deleted" property="isDeleted" jdbcType="INTEGER"/> <result column="IS_DELETED" property="isDeleted" />
<result column="create_by_id" property="createById" jdbcType="VARCHAR"/> <result column="CREATE_BY_ID" property="createById" />
<result column="create_by_name" property="createByName" jdbcType="VARCHAR"/> <result column="CREATE_BY_NAME" property="createByName" />
<result column="create_time" property="createTime" jdbcType="VARCHAR"/> <result column="CREATE_TIME" property="createTime" />
<result column="modify_by_id" property="modifyById" jdbcType="VARCHAR"/> <result column="MODIFY_BY_ID" property="modifyById" />
<result column="modify_by_name" property="modifyByName" jdbcType="VARCHAR"/> <result column="MODIFY_BY_NAME" property="modifyByName" />
<result column="modify_time" property="modifyTime" jdbcType="VARCHAR"/> <result column="MODIFY_TIME" property="modifyTime" />
<result column="station_id" property="stationId" jdbcType="VARCHAR"/> <result column="STATION_ID" property="stationId" />
<result column="tower_id" property="towerId" jdbcType="VARCHAR"/> <result column="TOWER_ID" property="towerId" />
<result column="tower_name" property="towerName" jdbcType="VARCHAR"/> <result column="TOWER_NAME" property="towerName" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id ID
, ,
is_deleted, IS_DELETED,
create_by_id, CREATE_BY_ID,
create_by_name, CREATE_BY_NAME,
create_time, CREATE_TIME,
modify_by_id, MODIFY_BY_ID,
modify_by_name, MODIFY_BY_NAME,
modify_time, MODIFY_TIME,
station_id, STATION_ID,
tower_id, TOWER_ID,
tower_name TOWER_NAME
</sql> </sql>
<select id="selectOne" parameterType="pps.core.base.entity.BaseWindTowerView" resultMap="BaseResultMap"> <select id="selectOne" parameterType="pps.core.base.entity.BaseWindTowerView" resultMap="BaseResultMap">
select SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from BASE_WIND_TOWER FROM BASE_WIND_TOWER
where WHERE
id=#{id} ID=#{id}
</select> </select>
<select id="selectList" parameterType="pps.core.base.entity.BaseWindTowerView" resultMap="BaseResultMap"> <select id="selectList" parameterType="pps.core.base.entity.BaseWindTowerView" resultMap="BaseResultMap">
select SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from BASE_WIND_TOWER FROM BASE_WIND_TOWER
where WHERE
id=#{id} ID=#{id}
</select> </select>
<insert id="batchInsert" parameterType="list"> <insert id="batchInsert" parameterType="list">
INSERT INTO BASE_WIND_TOWER (id, is_deleted, create_by_id, create_by_name, create_time, modify_by_id, INSERT INTO BASE_WIND_TOWER (ID, IS_DELETED, CREATE_BY_ID, CREATE_BY_NAME, CREATE_TIME, MODIFY_BY_ID,
modify_by_name, modify_time, station_id, tower_id, tower_name) VALUES MODIFY_BY_NAME, MODIFY_TIME, STATION_ID, TOWER_ID, TOWER_NAME) VALUES
<foreach collection="list" item="item" separator=","> <foreach collection="list" item="item" separator=",">
( (
#{item.id}, #{item.id},
......
...@@ -2,119 +2,120 @@ ...@@ -2,119 +2,120 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pps.core.base.mapper.BaseWindTurbineViewMapper"> <mapper namespace="pps.core.base.mapper.BaseWindTurbineViewMapper">
<resultMap id="BaseResultMap" type="pps.core.base.entity.BaseWindTurbineView"> <resultMap id="BaseResultMap" type="pps.core.base.entity.BaseWindTurbineView">
<id column="id" property="id" jdbcType="VARCHAR"/> <id column="ID" property="id" />
<result column="is_deleted" property="isDeleted" jdbcType="INTEGER"/> <result column="IS_DELETED" property="isDeleted" />
<result column="create_by_id" property="createById" jdbcType="VARCHAR"/> <result column="CREATE_BY_ID" property="createById" />
<result column="create_by_name" property="createByName" jdbcType="VARCHAR"/> <result column="CREATE_BY_NAME" property="createByName" />
<result column="create_time" property="createTime" jdbcType="DATE"/> <result column="CREATE_TIME" property="createTime" />
<result column="modify_by_id" property="modifyById" jdbcType="VARCHAR"/> <result column="MODIFY_BY_ID" property="modifyById" />
<result column="modify_by_name" property="modifyByName" jdbcType="VARCHAR"/> <result column="MODIFY_BY_NAME" property="modifyByName" />
<result column="modify_time" property="modifyTime" jdbcType="DATE"/> <result column="MODIFY_TIME" property="modifyTime" />
<result column="ou_id" property="ouId" jdbcType="VARCHAR"/> <result column="OU_ID" property="ouId" />
<result column="ou_name" property="ouName" jdbcType="VARCHAR"/> <result column="OU_NAME" property="ouName" />
<result column="station_name" property="stationName" jdbcType="VARCHAR"/> <result column="STATION_NAME" property="stationName" />
<result column="total_power" property="totalPower" jdbcType="DECIMAL"/> <result column="TOTAL_POWER" property="totalPower" />
<result column="diameter" property="diameter" jdbcType="DECIMAL"/> <result column="DIAMETER" property="diameter" />
<result column="vane_length" property="vaneLength" jdbcType="DECIMAL"/> <result column="VANE_LENGTH" property="vaneLength" />
<result column="hub_height" property="hubHeight" jdbcType="DECIMAL"/> <result column="HUB_HEIGHT" property="hubHeight" />
<result column="longitude" property="longitude" jdbcType="DECIMAL"/> <result column="LONGITUDE" property="longitude" />
<result column="latitude" property="latitude" jdbcType="DECIMAL"/> <result column="LATITUDE" property="latitude" />
<result column="elevation" property="elevation" jdbcType="DECIMAL"/> <result column="ELEVATION" property="elevation" />
<result column="area_code" property="areaCode" jdbcType="INTEGER"/> <result column="AREA_CODE" property="areaCode" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id ID
, ,
is_deleted, IS_DELETED,
create_by_id, CREATE_BY_ID,
create_by_name, CREATE_BY_NAME,
create_time, CREATE_TIME,
modify_by_id, MODIFY_BY_ID,
modify_by_name, MODIFY_BY_NAME,
modify_time, MODIFY_TIME,
ou_id, OU_ID,
ou_name, OU_NAME,
station_name, STATION_NAME,
total_power, TOTAL_POWER,
diameter, DIAMETER,
vane_length, VANE_LENGTH,
hub_height, HUB_HEIGHT,
longitude, LONGITUDE,
latitude, LATITUDE,
elevation, ELEVATION,
area_code AREA_CODE
</sql> </sql>
<select id="selectList" parameterType="pps.core.base.entity.BaseWindTurbineView" resultMap="BaseResultMap"> <select id="selectList" parameterType="pps.core.base.entity.BaseWindTurbineView" resultMap="BaseResultMap">
select SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from BASE_WIND_TURBINE FROM BASE_WIND_TURBINE
where WHERE
is_deleted = 1 IS_DELETED = 1
AND ou_id in AND OU_ID IN
<foreach collection="ouList" open="(" close=")" separator="," item="item"> <foreach collection="ouList" open="(" close=")" separator="," item="item">
#{item} #{item}
</foreach> </foreach>
<if test="stationName != null and stationName != ''"> <if test="stationName != null and stationName != ''">
AND station_name LIKE CONCAT( '%', #{stationName}, '%' ) AND STATION_NAME LIKE CONCAT( '%', #{stationName}, '%' )
</if> </if>
ORDER BY ORDER BY
station_name ASC STATION_NAME ASC
</select> </select>
<resultMap id="ExtResultMap" type="pps.core.base.entity.BaseWindTurbineView" extends="BaseResultMap"> <resultMap id="ExtResultMap" type="pps.core.base.entity.BaseWindTurbineView" extends="BaseResultMap">
<result column="city_code" property="cityCode" jdbcType="VARCHAR"/> <result column="CITY_CODE" property="cityCode" />
<result column="city_name" property="cityName" jdbcType="VARCHAR"/> <result column="CITY_NAME" property="cityName" />
</resultMap> </resultMap>
<select id="selectOne" parameterType="pps.core.base.entity.BaseWindTurbineView" resultMap="ExtResultMap"> <select id="selectOne" parameterType="pps.core.base.entity.BaseWindTurbineView" resultMap="ExtResultMap">
SELECT t.id, SELECT T.ID,
t.ou_id, T.OU_ID,
t.station_name, T.STATION_NAME,
t.total_power, T.TOTAL_POWER,
t.diameter, T.DIAMETER,
t.vane_length, T.VANE_LENGTH,
t.hub_height, T.HUB_HEIGHT,
t.longitude, T.LONGITUDE,
t.latitude, T.LATITUDE,
t.elevation, T.ELEVATION,
t.area_code, T.AREA_CODE,
a.city_code, A.CITY_CODE,
a.`name` AS city_name A.`NAME` AS CITY_NAME
FROM BASE_WIND_TURBINE t FROM BASE_WIND_TURBINE T
LEFT JOIN SYS_AREA a ON t.area_code = a.id LEFT JOIN SYS_AREA A ON T.AREA_CODE = A.ID
WHERE t.is_deleted = 1 WHERE T.IS_DELETED = 1
AND t.id = #{id} LIMIT 1 AND T.ID = #{id} LIMIT 1
</select> </select>
<select id="selectWindTurbineList" resultMap="ExtResultMap"> <select id="selectWindTurbineList" resultMap="ExtResultMap">
SELECT p.id, SELECT P.ID,
p.is_deleted, P.IS_DELETED,
p.create_by_id, P.CREATE_BY_ID,
p.create_by_name, P.CREATE_BY_NAME,
p.create_time, P.CREATE_TIME,
p.modify_by_id, P.MODIFY_BY_ID,
p.modify_by_name, P.MODIFY_BY_NAME,
p.modify_time, P.MODIFY_TIME,
p.ou_id, P.OU_ID,
p.ou_name, P.OU_NAME,
p.station_name, P.STATION_NAME,
p.total_power, P.TOTAL_POWER,
p.diameter, P.DIAMETER,
p.vane_length, P.VANE_LENGTH,
p.hub_height, P.HUB_HEIGHT,
p.longitude, P.LONGITUDE,
p.latitude, P.LATITUDE,
p.elevation, P.ELEVATION,
p.area_code, P.AREA_CODE,
a.city_code A.CITY_CODE
FROM BASE_WIND_TURBINE p FROM BASE_WIND_TURBINE P
JOIN SYS_AREA a ON a.id = p.area_code JOIN SYS_AREA A ON A.ID = P.AREA_CODE
WHERE p.is_deleted = 1 WHERE P.IS_DELETED = 1
AND p.area_code IS NOT NULL AND P.AREA_CODE IS NOT NULL
<if test="ouId != null and ouId != ''"> <if test="ouId != null and ouId != ''">
AND p.ou_id = #{ouId} AND P.OU_ID = #{ouId}
</if> </if>
ORDER BY modify_time DESC ORDER BY MODIFY_TIME DESC
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -2,46 +2,49 @@ ...@@ -2,46 +2,49 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pps.core.base.mapper.ConfigOilFieldViewMapper"> <mapper namespace="pps.core.base.mapper.ConfigOilFieldViewMapper">
<resultMap id="BaseResultMap" type="pps.core.base.entity.ConfigOilFieldView"> <resultMap id="BaseResultMap" type="pps.core.base.entity.ConfigOilFieldView">
<id column="id" property="id" jdbcType="BIGINT"/> <id column="ID" property="id"/>
<result column="is_enable" property="isEnable" jdbcType="TINYINT"/> <result column="IS_ENABLE" property="isEnable"/>
<result column="oil_field_name" property="oilFieldName" jdbcType="VARCHAR"/> <result column="OIL_FIELD_NAME" property="oilFieldName"/>
<result column="oil_field_code" property="oilFieldCode" jdbcType="VARCHAR"/> <result column="OIL_FIELD_CODE" property="oilFieldCode"/>
<result column="province_list" property="provinceList" jdbcType="VARCHAR"/> <result column="PROVINCE_LIST" property="provinceList"/>
<result column="home_page_path" property="homePagePath" jdbcType="VARCHAR"/> <result column="HOME_PAGE_PATH" property="homePagePath"/>
<result column="auth_key" property="authKey" jdbcType="VARCHAR"/> <result column="AUTH_KEY" property="authKey"/>
<result column="simulate_user" property="simulateUser" jdbcType="VARCHAR"/> <result column="SIMULATE_USER" property="simulateUser"/>
<result column="is_demo" property="isDemo" jdbcType="TINYINT"/> <result column="IS_DEMO" property="isDemo"/>
<result column="demo_date" property="demoDate" jdbcType="VARCHAR"/> <result column="DEMO_DATE" property="demoDate"/>
<result column="third_party_auth_config" property="thirdPartyAuthConfig" jdbcType="VARCHAR"/> <result column="THIRD_PARTY_AUTH_CONFIG" property="thirdPartyAuthConfig"/>
<result column="project_title" property="projectTitle" jdbcType="VARCHAR"/> <result column="PROJECT_TITLE" property="projectTitle"/>
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id ID
, ,
is_enable, IS_ENABLE,
oil_field_name, OIL_FIELD_NAME,
oil_field_code, OIL_FIELD_CODE,
province_list, PROVINCE_LIST,
home_page_path, HOME_PAGE_PATH,
auth_key, AUTH_KEY,
simulate_user, SIMULATE_USER,
is_demo, IS_DEMO,
demo_date, DEMO_DATE,
third_party_auth_config, THIRD_PARTY_AUTH_CONFIG,
project_title PROJECT_TITLE
</sql> </sql>
<select id="selectOne" parameterType="pps.core.base.entity.ConfigOilFieldView" resultMap="BaseResultMap"> <select id="selectOne" parameterType="pps.core.base.entity.ConfigOilFieldView" resultMap="BaseResultMap">
select SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from CONFIG_OIL_FIELD FROM CONFIG_OIL_FIELD
where WHERE
id=#{id} ID=#{id}
</select> </select>
<select id="selectList" parameterType="pps.core.base.entity.ConfigOilFieldView" resultMap="BaseResultMap"> <select id="selectList" parameterType="pps.core.base.entity.ConfigOilFieldView" resultMap="BaseResultMap">
select SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from CONFIG_OIL_FIELD FROM CONFIG_OIL_FIELD
where WHERE
id=#{id} ID=#{id}
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -3,26 +3,26 @@ ...@@ -3,26 +3,26 @@
<mapper namespace="pps.core.base.mapper.PlantPredictedPowerDataViewMapper"> <mapper namespace="pps.core.base.mapper.PlantPredictedPowerDataViewMapper">
<insert id="insertBatch" parameterType="java.util.List"> <insert id="insertBatch" parameterType="java.util.List">
INSERT INTO PLANT_PREDICTED_POWER_DATA INSERT INTO PLANT_PREDICTED_POWER_DATA
(plant_id, (PLANT_ID,
data_date, DATA_DATE,
year_time, YEAR_TIME,
month_time, MONTH_TIME,
day_time, DAY_TIME,
hour_time, HOUR_TIME,
min_time, MIN_TIME,
temperature, TEMPERATURE,
humidity, HUMIDITY,
wind_speed, WIND_SPEED,
wind_direction, WIND_DIRECTION,
pressure, PRESSURE,
plane_irradiance, PLANE_IRRADIANCE,
horizontal_irradiance, HORIZONTAL_IRRADIANCE,
power, POWER,
create_time, CREATE_TIME,
plant_name, PLANT_NAME,
weather_type, WEATHER_TYPE,
precipitation, PRECIPITATION,
area_code AREA_CODE
) VALUES ) VALUES
<foreach collection="list" separator="," item="item"> <foreach collection="list" separator="," item="item">
(#{item.plantId}, (#{item.plantId},
......
...@@ -2,80 +2,83 @@ ...@@ -2,80 +2,83 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pps.core.base.mapper.ThirdWeatherDataViewMapper"> <mapper namespace="pps.core.base.mapper.ThirdWeatherDataViewMapper">
<resultMap id="BaseResultMap" type="pps.core.base.entity.ThirdWeatherDataView"> <resultMap id="BaseResultMap" type="pps.core.base.entity.ThirdWeatherDataView">
<id column="id" property="id" jdbcType="BIGINT"/> <id column="ID" property="id"/>
<result column="dni" property="dni" jdbcType="DECIMAL"/> <result column="DNI" property="dni"/>
<result column="ghi" property="ghi" jdbcType="DECIMAL"/> <result column="GHI" property="ghi"/>
<result column="dhi" property="dhi" jdbcType="DECIMAL"/> <result column="DHI" property="dhi"/>
<result column="forecast_time" property="forecastTime" jdbcType="VARCHAR"/> <result column="FORECAST_TIME" property="forecastTime"/>
<result column="tem" property="tem" jdbcType="DECIMAL"/> <result column="TEM" property="tem"/>
<result column="rhu" property="rhu" jdbcType="DECIMAL"/> <result column="RHU" property="rhu"/>
<result column="wns" property="wns" jdbcType="DECIMAL"/> <result column="WNS" property="wns"/>
<result column="wnd" property="wnd" jdbcType="INTEGER"/> <result column="WND" property="wnd"/>
<result column="wns_grd" property="wnsGrd" jdbcType="INTEGER"/> <result column="WNS_GRD" property="wnsGrd"/>
<result column="gust" property="gust" jdbcType="DECIMAL"/> <result column="GUST" property="gust"/>
<result column="pre" property="pre" jdbcType="DECIMAL"/> <result column="PRE" property="pre"/>
<result column="prs_qfe" property="prsQfe" jdbcType="DECIMAL"/> <result column="PRS_QFE" property="prsQfe"/>
<result column="vis" property="vis" jdbcType="DECIMAL"/> <result column="VIS" property="vis"/>
<result column="clo" property="clo" jdbcType="DECIMAL"/> <result column="CLO" property="clo"/>
<result column="uvb" property="uvb" jdbcType="DECIMAL"/> <result column="UVB" property="uvb"/>
<result column="uvi" property="uvi" jdbcType="INTEGER"/> <result column="UVI" property="uvi"/>
<result column="phs" property="phs" jdbcType="INTEGER"/> <result column="PHS" property="phs"/>
<result column="wep" property="wep" jdbcType="INTEGER"/> <result column="WEP" property="wep"/>
<result column="wnd_100m" property="wnd100m" jdbcType="DECIMAL"/> <result column="WND_100M" property="wnd100m"/>
<result column="wns_100m" property="wns100m" jdbcType="DECIMAL"/> <result column="WNS_100M" property="wns100m"/>
<result column="wns_grd_100m" property="wnsGrd100m" jdbcType="INTEGER"/> <result column="WNS_GRD_100M" property="wnsGrd100m"/>
<result column="update_time" property="updateTime" jdbcType="VARCHAR"/> <result column="UPDATE_TIME" property="updateTime"/>
<result column="create_time" property="createTime" jdbcType="VARCHAR"/> <result column="CREATE_TIME" property="createTime"/>
<result column="longitude" property="longitude" jdbcType="DECIMAL"/> <result column="LONGITUDE" property="longitude"/>
<result column="latitude" property="latitude" jdbcType="DECIMAL"/> <result column="LATITUDE" property="latitude"/>
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id ID
, ,
dni, DNI,
ghi, GHI,
dhi, DHI,
forecast_time, FORECAST_TIME,
tem, TEM,
rhu, RHU,
wns, WNS,
wnd, WND,
wns_grd, WNS_GRD,
gust, GUST,
pre, PRE,
prs_qfe, PRS_QFE,
vis, VIS,
clo, CLO,
uvb, UVB,
uvi, UVI,
phs, PHS,
wep, WEP,
wnd_100m, WND_100M,
wns_100m, WNS_100M,
wns_grd_100m, WNS_GRD_100M,
update_time, UPDATE_TIME,
create_time, CREATE_TIME,
longitude, LONGITUDE,
latitude LATITUDE
</sql> </sql>
<select id="selectOne" parameterType="pps.core.base.entity.ThirdWeatherDataView" resultMap="BaseResultMap"> <select id="selectOne" parameterType="pps.core.base.entity.ThirdWeatherDataView" resultMap="BaseResultMap">
select SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from THIRD_WEATHER_DATA FROM THIRD_WEATHER_DATA
where WHERE
id=#{id} ID=#{id}
</select> </select>
<select id="selectList" parameterType="pps.core.base.entity.ThirdWeatherDataView" resultMap="BaseResultMap"> <select id="selectList" parameterType="pps.core.base.entity.ThirdWeatherDataView" resultMap="BaseResultMap">
select SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from THIRD_WEATHER_DATA FROM THIRD_WEATHER_DATA
order by forecast_time ORDER BY FORECAST_TIME
</select> </select>
<insert id="insertBatch" parameterType="java.util.List"> <insert id="insertBatch" parameterType="java.util.List">
INSERT INTO THIRD_WEATHER_DATA ( dni, ghi, dhi, forecast_time, tem, rhu, wns, wnd, wns_grd, gust, pre, INSERT INTO THIRD_WEATHER_DATA ( DNI, GHI, DHI, FORECAST_TIME, TEM, RHU, WNS, WND, WNS_GRD, GUST, PRE,
prs_qfe, vis, clo, uvb, uvi, phs, wep, wnd_100m, wns_100m, wns_grd_100m, update_time, create_time, longitude, PRS_QFE, VIS, CLO, UVB, UVI, PHS, WEP, WND_100M, WNS_100M, WNS_GRD_100M, UPDATE_TIME, CREATE_TIME, LONGITUDE,
latitude) VALUES LATITUDE) VALUES
<foreach collection="list" separator="," item="item"> <foreach collection="list" separator="," item="item">
( (
#{item.dni}, #{item.dni},
......
...@@ -2,78 +2,81 @@ ...@@ -2,78 +2,81 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pps.core.base.mapper.ThirdWindPowerGenerationUpdateViewMapper"> <mapper namespace="pps.core.base.mapper.ThirdWindPowerGenerationUpdateViewMapper">
<resultMap id="BaseResultMap" type="pps.core.base.entity.ThirdWindPowerGenerationUpdateView"> <resultMap id="BaseResultMap" type="pps.core.base.entity.ThirdWindPowerGenerationUpdateView">
<id column="id" property="id" jdbcType="BIGINT"/> <id column="ID" property="id" />
<result column="station_name" property="stationName" jdbcType="VARCHAR"/> <result column="STATION_NAME" property="stationName" />
<result column="station_id" property="stationId" jdbcType="VARCHAR"/> <result column="STATION_ID" property="stationId" />
<result column="collect_time" property="collectTime" jdbcType="VARCHAR"/> <result column="COLLECT_TIME" property="collectTime" />
<result column="actual_wind_speed" property="actualWindSpeed" jdbcType="DECIMAL"/> <result column="ACTUAL_WIND_SPEED" property="actualWindSpeed" />
<result column="actual_power" property="actualPower" jdbcType="DECIMAL"/> <result column="ACTUAL_POWER" property="actualPower" />
<result column="actual_generation" property="actualGeneration" jdbcType="DECIMAL"/> <result column="ACTUAL_GENERATION" property="actualGeneration" />
<result column="accurate_wind_direction" property="accurateWindDirection" jdbcType="DECIMAL"/> <result column="ACCURATE_WIND_DIRECTION" property="accurateWindDirection" />
<result column="actual_wind_direction" property="actualWindDirection" jdbcType="INTEGER"/> <result column="ACTUAL_WIND_DIRECTION" property="actualWindDirection" />
<result column="input_time" property="inputTime" jdbcType="VARCHAR"/> <result column="INPUT_TIME" property="inputTime" />
<result column="system_source" property="systemSource" jdbcType="VARCHAR"/> <result column="SYSTEM_SOURCE" property="systemSource" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id ID
, ,
station_name, STATION_NAME,
station_id, STATION_ID,
collect_time, COLLECT_TIME,
actual_wind_speed, ACTUAL_WIND_SPEED,
actual_power, ACTUAL_POWER,
actual_generation, ACTUAL_GENERATION,
accurate_wind_direction, ACCURATE_WIND_DIRECTION,
actual_wind_direction, ACTUAL_WIND_DIRECTION,
input_time, INPUT_TIME,
system_source SYSTEM_SOURCE
</sql> </sql>
<select id="selectOne" parameterType="pps.core.base.entity.ThirdWindPowerGenerationUpdateView" <select id="selectOne" parameterType="pps.core.base.entity.ThirdWindPowerGenerationUpdateView"
resultMap="BaseResultMap"> resultMap="BaseResultMap">
select SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from THIRD_WIND_POWER_GENERATION_UPDATE FROM THIRD_WIND_POWER_GENERATION_UPDATE
where WHERE
id=#{id} ID=#{id}
</select> </select>
<select id="selectList" parameterType="pps.core.base.entity.ThirdWindPowerGenerationUpdateView" <select id="selectList" parameterType="pps.core.base.entity.ThirdWindPowerGenerationUpdateView"
resultMap="BaseResultMap"> resultMap="BaseResultMap">
select SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from THIRD_WIND_POWER_GENERATION_UPDATE FROM THIRD_WIND_POWER_GENERATION_UPDATE
where WHERE
id=#{id} ID=#{id}
</select> </select>
<select id="stationMonthAvgPowerGeneration" resultMap="BaseResultMap"> <select id="stationMonthAvgPowerGeneration" resultMap="BaseResultMap">
SELECT SELECT
ROUND( AVG( actual_generation ), 2 ) AS actual_generation, ROUND( AVG( ACTUAL_GENERATION ), 2 ) AS ACTUAL_GENERATION,
actual_wind_direction ACTUAL_WIND_DIRECTION
FROM FROM
( (
SELECT SELECT
station_id, STATION_ID,
IFNULL( SUM( actual_generation ), 0 ) AS actual_generation, IFNULL( SUM( ACTUAL_GENERATION ), 0 ) AS ACTUAL_GENERATION,
MONTH ( collect_time ) AS actual_wind_direction MONTH ( COLLECT_TIME ) AS ACTUAL_WIND_DIRECTION
FROM FROM
THIRD_WIND_POWER_GENERATION_UPDATE THIRD_WIND_POWER_GENERATION_UPDATE
WHERE WHERE
station_id IN STATION_ID IN
<foreach collection="list" item="item" open="(" separator="," close=")"> <foreach collection="list" item="item" open="(" separator="," close=")">
#{item} #{item}
</foreach> </foreach>
AND collect_time BETWEEN #{beginOfYear} AND #{endOfYear} AND COLLECT_TIME BETWEEN #{beginOfYear} AND #{endOfYear}
GROUP BY GROUP BY
station_id, STATION_ID,
MONTH ( collect_time ) MONTH ( COLLECT_TIME )
) z ) Z
GROUP BY GROUP BY
actual_wind_direction ACTUAL_WIND_DIRECTION
</select> </select>
<insert id="batchInsert" parameterType="list"> <insert id="batchInsert" parameterType="list">
INSERT INTO THIRD_WIND_POWER_GENERATION_UPDATE (station_name, station_id, collect_time, actual_wind_speed, INSERT INTO THIRD_WIND_POWER_GENERATION_UPDATE (STATION_NAME, STATION_ID, COLLECT_TIME, ACTUAL_WIND_SPEED,
actual_power, actual_generation, accurate_wind_direction, actual_wind_direction, input_time, system_source) VALUES ACTUAL_POWER, ACTUAL_GENERATION, ACCURATE_WIND_DIRECTION, ACTUAL_WIND_DIRECTION, INPUT_TIME, SYSTEM_SOURCE) VALUES
<foreach collection="list" separator="," item="item"> <foreach collection="list" separator="," item="item">
( (
#{item.stationName}, #{item.stationName},
...@@ -93,72 +96,72 @@ ...@@ -93,72 +96,72 @@
<delete id="deleteBatch" parameterType="list"> <delete id="deleteBatch" parameterType="list">
DELETE FROM THIRD_WIND_POWER_GENERATION_UPDATE DELETE FROM THIRD_WIND_POWER_GENERATION_UPDATE
WHERE WHERE
station_id IN STATION_ID IN
<foreach collection="list" item="item" open="(" separator="," close=")"> <foreach collection="list" item="item" open="(" separator="," close=")">
#{item} #{item}
</foreach> </foreach>
AND collect_time BETWEEN #{create} AND COLLECT_TIME BETWEEN #{create}
AND #{end} AND #{end}
</delete> </delete>
<resultMap id="ExtResultMap" type="pps.core.base.entity.ThirdWindPowerGenerationUpdateView" extends="BaseResultMap"> <resultMap id="ExtResultMap" type="pps.core.base.entity.ThirdWindPowerGenerationUpdateView" extends="BaseResultMap">
<result column="today_power" property="todayPower" jdbcType="DECIMAL"/> <result column="TODAY_POWER" property="todayPower" />
<result column="month_power" property="monthPower" jdbcType="DECIMAL"/> <result column="MONTH_POWER" property="monthPower" />
<result column="last_month_power" property="lastMonthPower" jdbcType="DECIMAL"/> <result column="LAST_MONTH_POWER" property="lastMonthPower" />
<result column="season_power" property="seasonPower" jdbcType="DECIMAL"/> <result column="SEASON_POWER" property="seasonPower" />
<result column="last_season_power" property="lastSeasonPower" jdbcType="DECIMAL"/> <result column="LAST_SEASON_POWER" property="lastSeasonPower" />
<result column="year_power" property="yearPower" jdbcType="DECIMAL"/> <result column="YEAR_POWER" property="yearPower" />
<result column="last_year_power" property="lastYearPower" jdbcType="DECIMAL"/> <result column="LAST_YEAR_POWER" property="lastYearPower" />
</resultMap> </resultMap>
<select id="stationPowerGeneration" resultMap="ExtResultMap"> <select id="stationPowerGeneration" resultMap="ExtResultMap">
SELECT IFNULL(SUM(actual_generation), 0) AS today_power, SELECT IFNULL(SUM(ACTUAL_GENERATION), 0) AS TODAY_POWER,
(SELECT IFNULL(SUM(actual_generation), 0) (SELECT IFNULL(SUM(ACTUAL_GENERATION), 0)
FROM THIRD_WIND_POWER_GENERATION_UPDATE FROM THIRD_WIND_POWER_GENERATION_UPDATE
WHERE collect_time BETWEEN #{dateList[2]} AND #{dateList[3]} AND station_id IN WHERE COLLECT_TIME BETWEEN #{dateList[2]} AND #{dateList[3]} AND STATION_ID IN
<foreach collection="list" item="item" open="(" separator="," close=")"> <foreach collection="list" item="item" open="(" separator="," close=")">
#{item} #{item}
</foreach> </foreach>
) AS month_power, ) AS MONTH_POWER,
(SELECT IFNULL(SUM(actual_generation), 0) (SELECT IFNULL(SUM(ACTUAL_GENERATION), 0)
FROM THIRD_WIND_POWER_GENERATION_UPDATE FROM THIRD_WIND_POWER_GENERATION_UPDATE
WHERE collect_time BETWEEN #{dateList[4]} AND #{dateList[5]} AND station_id IN WHERE COLLECT_TIME BETWEEN #{dateList[4]} AND #{dateList[5]} AND STATION_ID IN
<foreach collection="list" item="item" open="(" separator="," close=")"> <foreach collection="list" item="item" open="(" separator="," close=")">
#{item} #{item}
</foreach> </foreach>
) AS last_month_power, ) AS LAST_MONTH_POWER,
(SELECT IFNULL(SUM(actual_generation), 0) (SELECT IFNULL(SUM(ACTUAL_GENERATION), 0)
FROM THIRD_WIND_POWER_GENERATION_UPDATE FROM THIRD_WIND_POWER_GENERATION_UPDATE
WHERE collect_time BETWEEN #{dateList[6]} AND #{dateList[7]} AND station_id IN WHERE COLLECT_TIME BETWEEN #{dateList[6]} AND #{dateList[7]} AND STATION_ID IN
<foreach collection="list" item="item" open="(" separator="," close=")"> <foreach collection="list" item="item" open="(" separator="," close=")">
#{item} #{item}
</foreach> </foreach>
) AS season_power, ) AS SEASON_POWER,
(SELECT IFNULL(SUM(actual_generation), 0) (SELECT IFNULL(SUM(ACTUAL_GENERATION), 0)
FROM THIRD_WIND_POWER_GENERATION_UPDATE FROM THIRD_WIND_POWER_GENERATION_UPDATE
WHERE collect_time BETWEEN #{dateList[8]} AND #{dateList[9]} AND station_id IN WHERE COLLECT_TIME BETWEEN #{dateList[8]} AND #{dateList[9]} AND STATION_ID IN
<foreach collection="list" item="item" open="(" separator="," close=")"> <foreach collection="list" item="item" open="(" separator="," close=")">
#{item} #{item}
</foreach> </foreach>
) AS last_season_power, ) AS LAST_SEASON_POWER,
(SELECT IFNULL(SUM(actual_generation), 0) (SELECT IFNULL(SUM(ACTUAL_GENERATION), 0)
FROM THIRD_WIND_POWER_GENERATION_UPDATE FROM THIRD_WIND_POWER_GENERATION_UPDATE
WHERE collect_time BETWEEN #{dateList[10]} AND #{dateList[11]} AND station_id IN WHERE COLLECT_TIME BETWEEN #{dateList[10]} AND #{dateList[11]} AND STATION_ID IN
<foreach collection="list" item="item" open="(" separator="," close=")"> <foreach collection="list" item="item" open="(" separator="," close=")">
#{item} #{item}
</foreach> </foreach>
) AS year_power, ) AS YEAR_POWER,
(SELECT IFNULL(SUM(actual_generation), 0) (SELECT IFNULL(SUM(ACTUAL_GENERATION), 0)
FROM THIRD_WIND_POWER_GENERATION_UPDATE FROM THIRD_WIND_POWER_GENERATION_UPDATE
WHERE collect_time BETWEEN #{dateList[12]} AND #{dateList[13]} AND station_id IN WHERE COLLECT_TIME BETWEEN #{dateList[12]} AND #{dateList[13]} AND STATION_ID IN
<foreach collection="list" item="item" open="(" separator="," close=")"> <foreach collection="list" item="item" open="(" separator="," close=")">
#{item} #{item}
</foreach> </foreach>
) AS last_year_power ) AS LAST_YEAR_POWER
FROM THIRD_WIND_POWER_GENERATION_UPDATE FROM THIRD_WIND_POWER_GENERATION_UPDATE
WHERE collect_time BETWEEN #{dateList[0]} WHERE COLLECT_TIME BETWEEN #{dateList[0]}
AND #{dateList[1]} AND #{dateList[1]}
AND station_id IN AND STATION_ID IN
<foreach collection="list" item="item" open="(" separator="," close=")"> <foreach collection="list" item="item" open="(" separator="," close=")">
#{item} #{item}
</foreach> </foreach>
......
...@@ -2,76 +2,79 @@ ...@@ -2,76 +2,79 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pps.core.base.mapper.ThirdWindPowerGenerationViewMapper"> <mapper namespace="pps.core.base.mapper.ThirdWindPowerGenerationViewMapper">
<resultMap id="BaseResultMap" type="pps.core.base.entity.ThirdWindPowerGenerationView"> <resultMap id="BaseResultMap" type="pps.core.base.entity.ThirdWindPowerGenerationView">
<id column="id" property="id" jdbcType="BIGINT"/> <id column="ID" property="id" />
<result column="station_name" property="stationName" jdbcType="VARCHAR"/> <result column="STATION_NAME" property="stationName" />
<result column="station_id" property="stationId" jdbcType="VARCHAR"/> <result column="STATION_ID" property="stationId" />
<result column="collect_time" property="collectTime" jdbcType="VARCHAR"/> <result column="COLLECT_TIME" property="collectTime" />
<result column="actual_wind_speed" property="actualWindSpeed" jdbcType="DECIMAL"/> <result column="ACTUAL_WIND_SPEED" property="actualWindSpeed" />
<result column="actual_power" property="actualPower" jdbcType="DECIMAL"/> <result column="ACTUAL_POWER" property="actualPower" />
<result column="actual_generation" property="actualGeneration" jdbcType="DECIMAL"/> <result column="ACTUAL_GENERATION" property="actualGeneration" />
<result column="accurate_wind_direction" property="accurateWindDirection" jdbcType="DECIMAL"/> <result column="ACCURATE_WIND_DIRECTION" property="accurateWindDirection" />
<result column="actual_wind_direction" property="actualWindDirection" jdbcType="INTEGER"/> <result column="ACTUAL_WIND_DIRECTION" property="actualWindDirection" />
<result column="input_time" property="inputTime" jdbcType="VARCHAR"/> <result column="INPUT_TIME" property="inputTime" />
<result column="system_source" property="systemSource" jdbcType="VARCHAR"/> <result column="SYSTEM_SOURCE" property="systemSource" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id ID
, ,
station_name, STATION_NAME,
station_id, STATION_ID,
collect_time, COLLECT_TIME,
actual_wind_speed, ACTUAL_WIND_SPEED,
actual_power, ACTUAL_POWER,
actual_generation, ACTUAL_GENERATION,
actual_wind_direction, ACTUAL_WIND_DIRECTION,
input_time, INPUT_TIME,
system_source SYSTEM_SOURCE
</sql> </sql>
<select id="selectOne" parameterType="pps.core.base.entity.ThirdWindPowerGenerationView" resultMap="BaseResultMap"> <select id="selectOne" parameterType="pps.core.base.entity.ThirdWindPowerGenerationView" resultMap="BaseResultMap">
select SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from THIRD_WIND_POWER_GENERATION FROM THIRD_WIND_POWER_GENERATION
where WHERE
id=#{id} ID=#{id}
</select> </select>
<select id="selectList" parameterType="pps.core.base.entity.ThirdWindPowerGenerationView" resultMap="BaseResultMap"> <select id="selectList" parameterType="pps.core.base.entity.ThirdWindPowerGenerationView" resultMap="BaseResultMap">
select SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from THIRD_WIND_POWER_GENERATION FROM THIRD_WIND_POWER_GENERATION
where WHERE
id=#{id} ID=#{id}
</select> </select>
<select id="generateSimulatedData" parameterType="pps.core.base.entity.ThirdWindPowerGenerationView" <select id="generateSimulatedData" parameterType="pps.core.base.entity.ThirdWindPowerGenerationView"
resultMap="BaseResultMap"> resultMap="BaseResultMap">
WITH wind_prediction AS (SELECT t.station_name AS station_name, WITH WIND_PREDICTION AS (SELECT T.STATION_NAME AS STATION_NAME,
f.station_id AS station_id, F.STATION_ID AS STATION_ID,
f.data_time AS collect_time, F.DATA_TIME AS COLLECT_TIME,
ROUND(f.wind_speed * 0.9, 2) AS actual_wind_speed, ROUND(F.WIND_SPEED * 0.9, 2) AS ACTUAL_WIND_SPEED,
f.predicted_power AS actual_power, F.PREDICTED_POWER AS ACTUAL_POWER,
f.wind_direction AS actual_wind_direction, F.WIND_DIRECTION AS ACTUAL_WIND_DIRECTION,
f.wind_direction AS accurate_wind_direction, F.WIND_DIRECTION AS ACCURATE_WIND_DIRECTION,
ROW_NUMBER() OVER ( PARTITION BY f.station_id ORDER BY f.data_time DESC ) AS rn ROW_NUMBER() OVER ( PARTITION BY F.STATION_ID ORDER BY F.DATA_TIME DESC ) AS RN
FROM BASE_WIND_TURBINE t FROM BASE_WIND_TURBINE T
LEFT JOIN WIND_PREDICTION_FUTURE f ON t.id = f.station_id LEFT JOIN WIND_PREDICTION_FUTURE F ON T.ID = F.STATION_ID
WHERE t.is_deleted = 1 WHERE T.IS_DELETED = 1
AND f.data_time BETWEEN #{startTime} AND F.DATA_TIME BETWEEN #{startTime}
AND #{endTime}) AND #{endTime})
SELECT station_name, SELECT STATION_NAME,
station_id, STATION_ID,
collect_time, COLLECT_TIME,
actual_wind_speed, ACTUAL_WIND_SPEED,
ROUND(actual_wind_speed * 0.85 * 250, 2) AS actual_power, ROUND(ACTUAL_WIND_SPEED * 0.85 * 250, 2) AS ACTUAL_POWER,
ROUND(actual_wind_speed * 0.85 * 500, 2) AS actual_generation, ROUND(ACTUAL_WIND_SPEED * 0.85 * 500, 2) AS ACTUAL_GENERATION,
actual_wind_direction, ACTUAL_WIND_DIRECTION,
accurate_wind_direction ACCURATE_WIND_DIRECTION
FROM wind_prediction FROM WIND_PREDICTION
WHERE rn = 1 WHERE RN = 1
</select> </select>
<insert id="batchInsert" parameterType="list"> <insert id="batchInsert" parameterType="list">
INSERT INTO THIRD_WIND_POWER_GENERATION (station_name, station_id, collect_time, actual_wind_speed, INSERT INTO THIRD_WIND_POWER_GENERATION (STATION_NAME, STATION_ID, COLLECT_TIME, ACTUAL_WIND_SPEED,
actual_power, actual_generation, accurate_wind_direction, actual_wind_direction, input_time, system_source) ACTUAL_POWER, ACTUAL_GENERATION, ACCURATE_WIND_DIRECTION, ACTUAL_WIND_DIRECTION, INPUT_TIME, SYSTEM_SOURCE)
VALUES VALUES
<foreach collection="list" separator="," item="item"> <foreach collection="list" separator="," item="item">
( (
......
...@@ -2,70 +2,72 @@ ...@@ -2,70 +2,72 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pps.core.base.mapper.WeatherBureauDataViewMapper"> <mapper namespace="pps.core.base.mapper.WeatherBureauDataViewMapper">
<resultMap id="BaseResultMap" type="pps.core.base.entity.WeatherBureauDataView"> <resultMap id="BaseResultMap" type="pps.core.base.entity.WeatherBureauDataView">
<id column="id" property="id" jdbcType="BIGINT"/> <id column="ID" property="id" />
<result column="data_time" property="dataTime" jdbcType="VARCHAR"/> <result column="DATA_TIME" property="dataTime" />
<result column="weather_icon" property="weatherIcon" jdbcType="VARCHAR"/> <result column="WEATHER_ICON" property="weatherIcon" />
<result column="air_temperature" property="airTemperature" jdbcType="DECIMAL"/> <result column="AIR_TEMPERATURE" property="airTemperature" />
<result column="precipitation" property="precipitation" jdbcType="VARCHAR"/> <result column="PRECIPITATION" property="precipitation" />
<result column="wind_speed" property="windSpeed" jdbcType="DECIMAL"/> <result column="WIND_SPEED" property="windSpeed" />
<result column="wind_direction" property="windDirection" jdbcType="INTEGER"/> <result column="WIND_DIRECTION" property="windDirection" />
<result column="pressure" property="pressure" jdbcType="DECIMAL"/> <result column="PRESSURE" property="pressure" />
<result column="humidity" property="humidity" jdbcType="DECIMAL"/> <result column="HUMIDITY" property="humidity" />
<result column="cloud_cover" property="cloudCover" jdbcType="DECIMAL"/> <result column="CLOUD_COVER" property="cloudCover" />
<result column="area_code" property="areaCode" jdbcType="VARCHAR"/> <result column="AREA_CODE" property="areaCode" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id ID
, ,
data_time, DATA_TIME,
weather_icon, WEATHER_ICON,
air_temperature, AIR_TEMPERATURE,
precipitation, PRECIPITATION,
wind_speed, WIND_SPEED,
wind_direction, WIND_DIRECTION,
pressure, PRESSURE,
humidity, HUMIDITY,
cloud_cover, CLOUD_COVER,
area_code AREA_CODE
</sql> </sql>
<select id="selectOne" parameterType="pps.core.base.entity.WeatherBureauDataView" resultMap="BaseResultMap"> <select id="selectOne" parameterType="pps.core.base.entity.WeatherBureauDataView" resultMap="BaseResultMap">
select SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from WEATHER_BUREAU_DATA FROM WEATHER_BUREAU_DATA
where WHERE
id=#{id} ID=#{id}
</select> </select>
<select id="selectList" parameterType="pps.core.base.entity.WeatherBureauDataView" resultMap="BaseResultMap"> <select id="selectList" parameterType="pps.core.base.entity.WeatherBureauDataView" resultMap="BaseResultMap">
select SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from WEATHER_BUREAU_DATA FROM WEATHER_BUREAU_DATA
where WHERE
id=#{id} ID=#{id}
</select> </select>
<delete id="deleteBatch" parameterType="list"> <delete id="deleteBatch" parameterType="list">
DELETE FROM WEATHER_BUREAU_DATA DELETE FROM WEATHER_BUREAU_DATA
WHERE WHERE
area_code IN AREA_CODE IN
<foreach collection="list" item="item" open="(" separator="," close=")"> <foreach collection="list" item="item" open="(" separator="," close=")">
#{item} #{item}
</foreach> </foreach>
AND data_time BETWEEN #{create} AND DATA_TIME BETWEEN #{create}
AND #{end} AND #{end}
</delete> </delete>
<insert id="insertBatch" parameterType="java.util.List"> <insert id="insertBatch" parameterType="java.util.List">
INSERT INTO WEATHER_BUREAU_DATA ( INSERT INTO WEATHER_BUREAU_DATA (
data_time, DATA_TIME,
weather_icon, WEATHER_ICON,
air_temperature, AIR_TEMPERATURE,
precipitation, PRECIPITATION,
wind_speed, WIND_SPEED,
wind_direction, WIND_DIRECTION,
pressure, PRESSURE,
humidity, HUMIDITY,
cloud_cover, CLOUD_COVER,
area_code AREA_CODE
) VALUES ) VALUES
<foreach collection="list" separator="," item="item"> <foreach collection="list" separator="," item="item">
( (
......
...@@ -2,61 +2,64 @@ ...@@ -2,61 +2,64 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pps.core.base.mapper.WindPredictionFutureViewMapper"> <mapper namespace="pps.core.base.mapper.WindPredictionFutureViewMapper">
<resultMap id="BaseResultMap" type="pps.core.base.entity.WindPredictionFutureView"> <resultMap id="BaseResultMap" type="pps.core.base.entity.WindPredictionFutureView">
<id column="id" property="id" jdbcType="BIGINT"/> <id column="ID" property="id" />
<result column="station_id" property="stationId" jdbcType="VARCHAR"/> <result column="STATION_ID" property="stationId" />
<result column="data_time" property="dataTime" jdbcType="VARCHAR"/> <result column="DATA_TIME" property="dataTime" />
<result column="wind_direction" property="windDirection" jdbcType="INTEGER"/> <result column="WIND_DIRECTION" property="windDirection" />
<result column="wind_speed" property="windSpeed" jdbcType="DECIMAL"/> <result column="WIND_SPEED" property="windSpeed" />
<result column="air_temperature" property="airTemperature" jdbcType="DECIMAL"/> <result column="AIR_TEMPERATURE" property="airTemperature" />
<result column="humidity" property="humidity" jdbcType="DECIMAL"/> <result column="HUMIDITY" property="humidity" />
<result column="pressure" property="pressure" jdbcType="DECIMAL"/> <result column="PRESSURE" property="pressure" />
<result column="actual_wind_speed" property="actualWindSpeed" jdbcType="DECIMAL"/> <result column="ACTUAL_WIND_SPEED" property="actualWindSpeed" />
<result column="actual_power" property="actualPower" jdbcType="DECIMAL"/> <result column="ACTUAL_POWER" property="actualPower" />
<result column="predicted_power" property="predictedPower" jdbcType="DECIMAL"/> <result column="PREDICTED_POWER" property="predictedPower" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id ID
, ,
station_id, STATION_ID,
data_time, DATA_TIME,
wind_direction, WIND_DIRECTION,
wind_speed, WIND_SPEED,
air_temperature, AIR_TEMPERATURE,
humidity, HUMIDITY,
pressure, PRESSURE,
actual_wind_speed, ACTUAL_WIND_SPEED,
actual_power, ACTUAL_POWER,
predicted_power PREDICTED_POWER
</sql> </sql>
<select id="selectOne" parameterType="pps.core.base.entity.WindPredictionFutureView" resultMap="BaseResultMap"> <select id="selectOne" parameterType="pps.core.base.entity.WindPredictionFutureView" resultMap="BaseResultMap">
select SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from WIND_PREDICTION_FUTURE FROM WIND_PREDICTION_FUTURE
where WHERE
id=#{id} ID=#{id}
</select> </select>
<select id="selectList" parameterType="pps.core.base.entity.WindPredictionFutureView" resultMap="BaseResultMap"> <select id="selectList" parameterType="pps.core.base.entity.WindPredictionFutureView" resultMap="BaseResultMap">
select SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from WIND_PREDICTION_FUTURE FROM WIND_PREDICTION_FUTURE
where WHERE
id=#{id} ID=#{id}
</select> </select>
<delete id="deleteBatch" parameterType="list"> <delete id="deleteBatch" parameterType="list">
DELETE FROM WIND_PREDICTION_FUTURE DELETE FROM WIND_PREDICTION_FUTURE
WHERE WHERE
station_id IN STATION_ID IN
<foreach collection="list" item="item" open="(" separator="," close=")"> <foreach collection="list" item="item" open="(" separator="," close=")">
#{item} #{item}
</foreach> </foreach>
AND data_time BETWEEN #{create} AND DATA_TIME BETWEEN #{create}
AND #{end} AND #{end}
</delete> </delete>
<insert id="insertBatch" parameterType="java.util.List"> <insert id="insertBatch" parameterType="java.util.List">
INSERT INTO WIND_PREDICTION_FUTURE (station_id, data_time, wind_direction, wind_speed, air_temperature, INSERT INTO WIND_PREDICTION_FUTURE (STATION_ID, DATA_TIME, WIND_DIRECTION, WIND_SPEED, AIR_TEMPERATURE,
humidity, pressure ,actual_wind_speed ,actual_power ,predicted_power) VALUES HUMIDITY, PRESSURE ,ACTUAL_WIND_SPEED ,ACTUAL_POWER ,PREDICTED_POWER) VALUES
<foreach collection="list" separator="," item="item"> <foreach collection="list" separator="," item="item">
( (
#{item.stationId}, #{item.stationId},
......
...@@ -2,66 +2,69 @@ ...@@ -2,66 +2,69 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pps.core.base.mapper.WindPredictionHistoryViewMapper"> <mapper namespace="pps.core.base.mapper.WindPredictionHistoryViewMapper">
<resultMap id="BaseResultMap" type="pps.core.base.entity.WindPredictionHistoryView"> <resultMap id="BaseResultMap" type="pps.core.base.entity.WindPredictionHistoryView">
<id column="id" property="id" jdbcType="BIGINT"/> <id column="ID" property="id"/>
<result column="station_id" property="stationId" jdbcType="VARCHAR"/> <result column="STATION_ID" property="stationId"/>
<result column="data_time" property="dataTime" jdbcType="VARCHAR"/> <result column="DATA_TIME" property="dataTime"/>
<result column="wind_direction" property="windDirection" jdbcType="INTEGER"/> <result column="WIND_DIRECTION" property="windDirection"/>
<result column="wind_speed" property="windSpeed" jdbcType="DECIMAL"/> <result column="WIND_SPEED" property="windSpeed"/>
<result column="air_temperature" property="airTemperature" jdbcType="DECIMAL"/> <result column="AIR_TEMPERATURE" property="airTemperature"/>
<result column="humidity" property="humidity" jdbcType="DECIMAL"/> <result column="HUMIDITY" property="humidity"/>
<result column="pressure" property="pressure" jdbcType="DECIMAL"/> <result column="PRESSURE" property="pressure"/>
<result column="actual_wind_direction" property="actualWindDirection" jdbcType="INTEGER"/> <result column="ACTUAL_WIND_DIRECTION" property="actualWindDirection"/>
<result column="actual_wind_speed" property="actualWindSpeed" jdbcType="DECIMAL"/> <result column="ACTUAL_WIND_SPEED" property="actualWindSpeed"/>
<result column="actual_power" property="actualPower" jdbcType="DECIMAL"/> <result column="ACTUAL_POWER" property="actualPower"/>
<result column="predicted_power" property="predictedPower" jdbcType="DECIMAL"/> <result column="PREDICTED_POWER" property="predictedPower"/>
<result column="wnd_100m" property="wnd100m" jdbcType="DECIMAL"/> <result column="WND_100M" property="wnd100m"/>
<result column="wns_100m" property="wns100m" jdbcType="DECIMAL"/> <result column="WNS_100M" property="wns100m"/>
<result column="wns_grd_100m" property="wnsGrd100m" jdbcType="INTEGER"/> <result column="WNS_GRD_100M" property="wnsGrd100m"/>
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id ID
, ,
station_id, STATION_ID,
data_time, DATA_TIME,
wind_direction, WIND_DIRECTION,
wind_speed, WIND_SPEED,
air_temperature, AIR_TEMPERATURE,
humidity, HUMIDITY,
pressure, PRESSURE,
actual_wind_direction, ACTUAL_WIND_DIRECTION,
actual_wind_speed, ACTUAL_WIND_SPEED,
actual_power, ACTUAL_POWER,
predicted_power, PREDICTED_POWER,
wnd_100m, WND_100M,
wns_100m, WNS_100M,
wns_grd_100m WNS_GRD_100M
</sql> </sql>
<select id="selectOne" parameterType="pps.core.base.entity.WindPredictionHistoryView" resultMap="BaseResultMap"> <select id="selectOne" parameterType="pps.core.base.entity.WindPredictionHistoryView" resultMap="BaseResultMap">
select SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from WIND_PREDICTION_HISTORY FROM WIND_PREDICTION_HISTORY
where WHERE
id=#{id} ID=#{id}
</select> </select>
<select id="selectList" parameterType="pps.core.base.entity.WindPredictionHistoryView" resultMap="BaseResultMap"> <select id="selectList" parameterType="pps.core.base.entity.WindPredictionHistoryView" resultMap="BaseResultMap">
select SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from WIND_PREDICTION_HISTORY FROM WIND_PREDICTION_HISTORY
where WHERE
id=#{id} ID=#{id}
</select> </select>
<delete id="deleteByTimeRange"> <delete id="deleteByTimeRange">
DELETE DELETE
FROM WIND_PREDICTION_HISTORY FROM WIND_PREDICTION_HISTORY
WHERE data_time BETWEEN #{startTime} WHERE DATA_TIME BETWEEN #{startTime}
AND #{endTime} AND #{endTime}
</delete> </delete>
<insert id="batchInsert" parameterType="list"> <insert id="batchInsert" parameterType="list">
INSERT INTO WIND_PREDICTION_HISTORY (station_id, data_time, wind_direction, wind_speed, air_temperature, INSERT INTO WIND_PREDICTION_HISTORY (STATION_ID, DATA_TIME, WIND_DIRECTION, WIND_SPEED, AIR_TEMPERATURE,
humidity, pressure, actual_wind_direction, actual_wind_speed, actual_power, predicted_power, wnd_100m, HUMIDITY, PRESSURE, ACTUAL_WIND_DIRECTION, ACTUAL_WIND_SPEED, ACTUAL_POWER, PREDICTED_POWER, WND_100M,
wns_100m, wns_grd_100m) VALUES WNS_100M, WNS_GRD_100M) VALUES
<foreach collection="list" separator="," item="item"> <foreach collection="list" separator="," item="item">
( (
#{item.stationId}, #{item.stationId},
......
...@@ -2,14 +2,14 @@ ...@@ -2,14 +2,14 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pps.core.task.mapper.ConfigTimeTaskViewMapper"> <mapper namespace="pps.core.task.mapper.ConfigTimeTaskViewMapper">
<resultMap id="BaseResultMap" type="pps.core.task.entity.ConfigTimeTaskView"> <resultMap id="BaseResultMap" type="pps.core.task.entity.ConfigTimeTaskView">
<id column="id" property="id" jdbcType="BIGINT"/> <id column="ID" property="id" />
<result column="class_path" property="classPath" jdbcType="VARCHAR"/> <result column="class_path" property="classPath" />
<result column="method_name" property="methodName" jdbcType="VARCHAR"/> <result column="method_name" property="methodName" />
<result column="other_param" property="otherParam" jdbcType="VARCHAR"/> <result column="other_param" property="otherParam" />
<result column="scheduling_pattern" property="schedulingPattern" jdbcType="VARCHAR"/> <result column="scheduling_pattern" property="schedulingPattern" />
<result column="task_describe" property="taskDescribe" jdbcType="VARCHAR"/> <result column="task_describe" property="taskDescribe" />
<result column="is_enable" property="isEnable" jdbcType="TINYINT"/> <result column="IS_ENABLE" property="isEnable" />
<result column="system_source" property="systemSource" jdbcType="VARCHAR"/> <result column="SYSTEM_SOURCE" property="systemSource" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id id
...@@ -19,8 +19,8 @@ ...@@ -19,8 +19,8 @@
other_param, other_param,
scheduling_pattern, scheduling_pattern,
task_describe, task_describe,
is_enable, IS_ENABLE,
system_source SYSTEM_SOURCE
</sql> </sql>
<select id="selectOne" parameterType="pps.core.task.entity.ConfigTimeTaskView" resultMap="BaseResultMap"> <select id="selectOne" parameterType="pps.core.task.entity.ConfigTimeTaskView" resultMap="BaseResultMap">
select select
......
...@@ -2,28 +2,28 @@ ...@@ -2,28 +2,28 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pps.core.space.mapper.LineDailyElectricityTrendViewMapper"> <mapper namespace="pps.core.space.mapper.LineDailyElectricityTrendViewMapper">
<resultMap id="BaseResultMap" type="pps.core.space.entity.LineDailyElectricityTrendView"> <resultMap id="BaseResultMap" type="pps.core.space.entity.LineDailyElectricityTrendView">
<id column="id" property="id" jdbcType="BIGINT"/> <id column="ID" property="id" />
<result column="station_name" property="stationName" jdbcType="VARCHAR"/> <result column="STATION_NAME" property="stationName" />
<result column="total_power" property="totalPower" jdbcType="DECIMAL"/> <result column="TOTAL_POWER" property="totalPower" />
<result column="photovoltaic_power" property="photovoltaicPower" jdbcType="DECIMAL"/> <result column="photovoltaic_power" property="photovoltaicPower" />
<result column="municipal_power" property="municipalPower" jdbcType="DECIMAL"/> <result column="municipal_power" property="municipalPower" />
<result column="last_total_power" property="lastTotalPower" jdbcType="DECIMAL"/> <result column="last_total_power" property="lastTotalPower" />
<result column="last_photovoltaic_power" property="lastPhotovoltaicPower" jdbcType="DECIMAL"/> <result column="last_photovoltaic_power" property="lastPhotovoltaicPower" />
<result column="last_municipal_power" property="lastMunicipalPower" jdbcType="DECIMAL"/> <result column="last_municipal_power" property="lastMunicipalPower" />
<result column="total_ratio" property="totalRatio" jdbcType="DECIMAL"/> <result column="total_ratio" property="totalRatio" />
<result column="photovoltaic_ratio" property="photovoltaicRatio" jdbcType="DECIMAL"/> <result column="photovoltaic_ratio" property="photovoltaicRatio" />
<result column="municipal_ratio" property="municipalRatio" jdbcType="DECIMAL"/> <result column="municipal_ratio" property="municipalRatio" />
<result column="valley_electric_open_hour" property="valleyElectricOpenHour" jdbcType="DECIMAL"/> <result column="valley_electric_open_hour" property="valleyElectricOpenHour" />
<result column="valley_electric_rate" property="valleyElectricRate" jdbcType="DECIMAL"/> <result column="valley_electric_rate" property="valleyElectricRate" />
<result column="sum_run_duration" property="sumRunDuration" jdbcType="DECIMAL"/> <result column="sum_run_duration" property="sumRunDuration" />
<result column="create_date" property="createDate" jdbcType="DATE"/> <result column="create_date" property="createDate" />
<result column="system_source" property="systemSource" jdbcType="VARCHAR"/> <result column="SYSTEM_SOURCE" property="systemSource" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id id
, ,
station_name, STATION_NAME,
total_power, TOTAL_POWER,
photovoltaic_power, photovoltaic_power,
municipal_power, municipal_power,
last_total_power, last_total_power,
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
valley_electric_rate, valley_electric_rate,
sum_run_duration, sum_run_duration,
create_date, create_date,
system_source SYSTEM_SOURCE
</sql> </sql>
<select id="selectOne" parameterType="pps.core.space.entity.LineDailyElectricityTrendView" <select id="selectOne" parameterType="pps.core.space.entity.LineDailyElectricityTrendView"
resultMap="BaseResultMap"> resultMap="BaseResultMap">
...@@ -56,9 +56,9 @@ ...@@ -56,9 +56,9 @@
</select> </select>
<insert id="batchInsert" parameterType="list"> <insert id="batchInsert" parameterType="list">
INSERT INTO LINE_DAILY_ELECTRICITY_TREND (station_name, total_power, photovoltaic_power, municipal_power, INSERT INTO LINE_DAILY_ELECTRICITY_TREND (STATION_NAME, TOTAL_POWER, photovoltaic_power, municipal_power,
last_total_power, last_photovoltaic_power, last_municipal_power, total_ratio, photovoltaic_ratio, last_total_power, last_photovoltaic_power, last_municipal_power, total_ratio, photovoltaic_ratio,
municipal_ratio, valley_electric_open_hour, valley_electric_rate, sum_run_duration, create_date, system_source) municipal_ratio, valley_electric_open_hour, valley_electric_rate, sum_run_duration, create_date, SYSTEM_SOURCE)
VALUES VALUES
<foreach collection="list" item="item" separator=","> <foreach collection="list" item="item" separator=",">
( (
...@@ -92,12 +92,12 @@ ...@@ -92,12 +92,12 @@
FROM FROM
LINE_DAILY_ELECTRICITY_TREND LINE_DAILY_ELECTRICITY_TREND
WHERE WHERE
station_name IN STATION_NAME IN
<foreach collection="stationNameList" open="(" close=")" separator="," item="item"> <foreach collection="stationNameList" open="(" close=")" separator="," item="item">
#{item} #{item}
</foreach> </foreach>
<if test="systemSource != null"> <if test="systemSource != null">
AND system_source = #{systemSource} AND SYSTEM_SOURCE = #{systemSource}
</if> </if>
AND create_date BETWEEN #{startTime} AND create_date BETWEEN #{startTime}
AND #{endTime} AND #{endTime}
...@@ -108,7 +108,7 @@ ...@@ -108,7 +108,7 @@
</select> </select>
<resultMap id="ExtResultMap" type="pps.core.space.entity.LineDailyElectricityTrendView" extends="BaseResultMap"> <resultMap id="ExtResultMap" type="pps.core.space.entity.LineDailyElectricityTrendView" extends="BaseResultMap">
<result column="day_flag" property="dayFlag" jdbcType="INTEGER"/> <result column="day_flag" property="dayFlag" />
</resultMap> </resultMap>
<select id="selectValleyElectricRate" parameterType="pps.core.space.entity.LineDailyElectricityTrendView" <select id="selectValleyElectricRate" parameterType="pps.core.space.entity.LineDailyElectricityTrendView"
...@@ -126,8 +126,8 @@ ...@@ -126,8 +126,8 @@
LINE_DAILY_ELECTRICITY_TREND LINE_DAILY_ELECTRICITY_TREND
WHERE WHERE
DATE ( create_date ) = #{createDate} DATE ( create_date ) = #{createDate}
AND system_source = #{systemSource} AND SYSTEM_SOURCE = #{systemSource}
AND station_name IN AND STATION_NAME IN
<foreach collection="stationNameList" open="(" close=")" separator="," item="item"> <foreach collection="stationNameList" open="(" close=")" separator="," item="item">
#{item} #{item}
</foreach> </foreach>
...@@ -140,8 +140,8 @@ ...@@ -140,8 +140,8 @@
LINE_DAILY_ELECTRICITY_TREND LINE_DAILY_ELECTRICITY_TREND
WHERE WHERE
DATE ( create_date ) = #{startTime} DATE ( create_date ) = #{startTime}
AND system_source = #{systemSource} AND SYSTEM_SOURCE = #{systemSource}
AND station_name IN AND STATION_NAME IN
<foreach collection="stationNameList" open="(" close=")" separator="," item="item"> <foreach collection="stationNameList" open="(" close=")" separator="," item="item">
#{item} #{item}
</foreach> </foreach>
...@@ -154,8 +154,8 @@ ...@@ -154,8 +154,8 @@
LINE_DAILY_ELECTRICITY_TREND LINE_DAILY_ELECTRICITY_TREND
WHERE WHERE
DATE ( create_date ) = #{endTime} DATE ( create_date ) = #{endTime}
AND system_source = #{systemSource} AND SYSTEM_SOURCE = #{systemSource}
AND station_name IN AND STATION_NAME IN
<foreach collection="stationNameList" open="(" close=")" separator="," item="item"> <foreach collection="stationNameList" open="(" close=")" separator="," item="item">
#{item} #{item}
</foreach> </foreach>
......
...@@ -2,18 +2,18 @@ ...@@ -2,18 +2,18 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pps.core.space.mapper.SpaceCalibrationHistoryViewMapper"> <mapper namespace="pps.core.space.mapper.SpaceCalibrationHistoryViewMapper">
<resultMap id="BaseResultMap" type="pps.core.space.entity.SpaceCalibrationHistoryView"> <resultMap id="BaseResultMap" type="pps.core.space.entity.SpaceCalibrationHistoryView">
<id column="id" property="id" jdbcType="VARCHAR"/> <id column="ID" property="id" />
<result column="is_deleted" property="isDeleted" jdbcType="INTEGER"/> <result column="IS_DELETED" property="isDeleted" />
<result column="create_by_id" property="createById" jdbcType="VARCHAR"/> <result column="CREATE_BY_ID" property="createById" />
<result column="create_by_name" property="createByName" jdbcType="VARCHAR"/> <result column="CREATE_BY_NAME" property="createByName" />
<result column="create_time" property="createTime" jdbcType="DATE"/> <result column="CREATE_TIME" property="createTime" />
<result column="modify_by_id" property="modifyById" jdbcType="VARCHAR"/> <result column="MODIFY_BY_ID" property="modifyById" />
<result column="modify_by_name" property="modifyByName" jdbcType="VARCHAR"/> <result column="MODIFY_BY_NAME" property="modifyByName" />
<result column="modify_time" property="modifyTime" jdbcType="DATE"/> <result column="MODIFY_TIME" property="modifyTime" />
<result column="line_id" property="lineId" jdbcType="VARCHAR"/> <result column="LINE_ID" property="lineId" />
<result column="institution_id" property="institutionId" jdbcType="VARCHAR"/> <result column="institution_id" property="institutionId" />
<result column="execution_cycle" property="executionCycle" jdbcType="VARCHAR"/> <result column="execution_cycle" property="executionCycle" />
<result column="calibration_date" property="calibrationDate" jdbcType="DATE"/> <result column="calibration_date" property="calibrationDate" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id id
...@@ -40,9 +40,9 @@ ...@@ -40,9 +40,9 @@
</select> </select>
<resultMap id="ExtendResultMap" type="pps.core.space.entity.SpaceCalibrationHistoryView" extends="BaseResultMap"> <resultMap id="ExtendResultMap" type="pps.core.space.entity.SpaceCalibrationHistoryView" extends="BaseResultMap">
<result column="ou_id" property="ouId" jdbcType="VARCHAR"/> <result column="OU_ID" property="ouId" />
<result column="grid_type_key" property="gridTypeKey" jdbcType="VARCHAR"/> <result column="GRID_TYPE_KEY" property="gridTypeKey" />
<result column="institution_name" property="institutionName" jdbcType="VARCHAR"/> <result column="institution_name" property="institutionName" />
</resultMap> </resultMap>
<select id="selectList" parameterType="pps.core.space.entity.SpaceCalibrationHistoryView" resultMap="BaseResultMap"> <select id="selectList" parameterType="pps.core.space.entity.SpaceCalibrationHistoryView" resultMap="BaseResultMap">
......
...@@ -2,17 +2,17 @@ ...@@ -2,17 +2,17 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pps.core.space.mapper.SpaceCalibrationPeriodViewMapper"> <mapper namespace="pps.core.space.mapper.SpaceCalibrationPeriodViewMapper">
<resultMap id="BaseResultMap" type="pps.core.space.entity.SpaceCalibrationPeriodView"> <resultMap id="BaseResultMap" type="pps.core.space.entity.SpaceCalibrationPeriodView">
<id column="id" property="id" jdbcType="VARCHAR"/> <id column="ID" property="id" />
<result column="is_deleted" property="isDeleted" jdbcType="INTEGER"/> <result column="IS_DELETED" property="isDeleted" />
<result column="create_by_id" property="createById" jdbcType="VARCHAR"/> <result column="CREATE_BY_ID" property="createById" />
<result column="create_by_name" property="createByName" jdbcType="VARCHAR"/> <result column="CREATE_BY_NAME" property="createByName" />
<result column="create_time" property="createTime" jdbcType="DATE"/> <result column="CREATE_TIME" property="createTime" />
<result column="modify_by_id" property="modifyById" jdbcType="VARCHAR"/> <result column="MODIFY_BY_ID" property="modifyById" />
<result column="modify_by_name" property="modifyByName" jdbcType="VARCHAR"/> <result column="MODIFY_BY_NAME" property="modifyByName" />
<result column="modify_time" property="modifyTime" jdbcType="DATE"/> <result column="MODIFY_TIME" property="modifyTime" />
<result column="ou_id" property="ouId" jdbcType="VARCHAR"/> <result column="OU_ID" property="ouId" />
<result column="line_id" property="lineId" jdbcType="VARCHAR"/> <result column="LINE_ID" property="lineId" />
<result column="day_number" property="dayNumber" jdbcType="VARCHAR"/> <result column="day_number" property="dayNumber" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id id
......
...@@ -2,26 +2,26 @@ ...@@ -2,26 +2,26 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pps.core.space.mapper.SpaceInstitutionDetailViewMapper"> <mapper namespace="pps.core.space.mapper.SpaceInstitutionDetailViewMapper">
<resultMap id="BaseResultMap" type="pps.core.space.entity.SpaceInstitutionDetailView"> <resultMap id="BaseResultMap" type="pps.core.space.entity.SpaceInstitutionDetailView">
<id column="id" property="id" jdbcType="VARCHAR"/> <id column="ID" property="id" />
<result column="is_deleted" property="isDeleted" jdbcType="INTEGER"/> <result column="IS_DELETED" property="isDeleted" />
<result column="create_by_id" property="createById" jdbcType="VARCHAR"/> <result column="CREATE_BY_ID" property="createById" />
<result column="create_by_name" property="createByName" jdbcType="VARCHAR"/> <result column="CREATE_BY_NAME" property="createByName" />
<result column="create_time" property="createTime" jdbcType="DATE"/> <result column="CREATE_TIME" property="createTime" />
<result column="modify_by_id" property="modifyById" jdbcType="VARCHAR"/> <result column="MODIFY_BY_ID" property="modifyById" />
<result column="modify_by_name" property="modifyByName" jdbcType="VARCHAR"/> <result column="MODIFY_BY_NAME" property="modifyByName" />
<result column="modify_time" property="modifyTime" jdbcType="DATE"/> <result column="MODIFY_TIME" property="modifyTime" />
<result column="ou_id" property="ouId" jdbcType="VARCHAR"/> <result column="OU_ID" property="ouId" />
<result column="line_id" property="lineId" jdbcType="VARCHAR"/> <result column="LINE_ID" property="lineId" />
<result column="grid_type_key" property="gridTypeKey" jdbcType="VARCHAR"/> <result column="GRID_TYPE_KEY" property="gridTypeKey" />
<result column="institution_name" property="institutionName" jdbcType="VARCHAR"/> <result column="institution_name" property="institutionName" />
<result column="institution_start_date" property="institutionStartDate" jdbcType="DATE"/> <result column="institution_start_date" property="institutionStartDate" />
<result column="institution_end_date" property="institutionEndDate" jdbcType="DATE"/> <result column="institution_end_date" property="institutionEndDate" />
<result column="optimize_deadline" property="optimizeDeadline" jdbcType="DATE"/> <result column="optimize_deadline" property="optimizeDeadline" />
<result column="optimize_state" property="optimizeState" jdbcType="INTEGER"/> <result column="optimize_state" property="optimizeState" />
<result column="is_current_basic" property="isCurrentBasic" jdbcType="INTEGER"/> <result column="is_current_basic" property="isCurrentBasic" />
<result column="start_interval" property="startInterval" jdbcType="INTEGER"/> <result column="START_INTERVAL" property="startInterval" />
<result column="tundra_strategy" property="tundraStrategy" jdbcType="INTEGER"/> <result column="tundra_strategy" property="tundraStrategy" />
<result column="optimize_type" property="optimizeType" jdbcType="INTEGER"/> <result column="optimize_type" property="optimizeType" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id id
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
optimize_deadline, optimize_deadline,
optimize_state, optimize_state,
is_current_basic, is_current_basic,
start_interval, START_INTERVAL,
tundra_strategy, tundra_strategy,
optimize_type optimize_type
</sql> </sql>
...@@ -64,12 +64,12 @@ ...@@ -64,12 +64,12 @@
</select> </select>
<resultMap id="ExtendResultMap" type="pps.core.space.entity.SpaceInstitutionDetailView" extends="BaseResultMap"> <resultMap id="ExtendResultMap" type="pps.core.space.entity.SpaceInstitutionDetailView" extends="BaseResultMap">
<result column="long_period_id" property="longPeriodId" jdbcType="VARCHAR"/> <result column="long_period_id" property="longPeriodId" />
<result column="long_execution_cycle" property="longExecutionCycle" jdbcType="VARCHAR"/> <result column="long_execution_cycle" property="longExecutionCycle" />
<result column="long_optimize_deadline" property="longOptimizeDeadline" jdbcType="VARCHAR"/> <result column="long_optimize_deadline" property="longOptimizeDeadline" />
<result column="mid_period_id" property="midPeriodId" jdbcType="VARCHAR"/> <result column="mid_period_id" property="midPeriodId" />
<result column="mid_execution_cycle" property="midExecutionCycle" jdbcType="VARCHAR"/> <result column="mid_execution_cycle" property="midExecutionCycle" />
<result column="mid_optimize_deadline" property="midOptimizeDeadline" jdbcType="VARCHAR"/> <result column="mid_optimize_deadline" property="midOptimizeDeadline" />
</resultMap> </resultMap>
<select id="selectOptimizeHistoryList" parameterType="pps.core.space.entity.SpaceInstitutionDetailView" <select id="selectOptimizeHistoryList" parameterType="pps.core.space.entity.SpaceInstitutionDetailView"
...@@ -84,7 +84,7 @@ ...@@ -84,7 +84,7 @@
optimize_deadline, optimize_deadline,
optimize_state, optimize_state,
is_current_basic, is_current_basic,
start_interval START_INTERVAL
FROM SPACE_INSTITUTION_DETAIL FROM SPACE_INSTITUTION_DETAIL
WHERE is_current_basic = 0 WHERE is_current_basic = 0
AND is_deleted = 1 AND is_deleted = 1
......
...@@ -2,20 +2,20 @@ ...@@ -2,20 +2,20 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pps.core.space.mapper.SpaceInstitutionDurationViewMapper"> <mapper namespace="pps.core.space.mapper.SpaceInstitutionDurationViewMapper">
<resultMap id="BaseResultMap" type="pps.core.space.entity.SpaceInstitutionDurationView"> <resultMap id="BaseResultMap" type="pps.core.space.entity.SpaceInstitutionDurationView">
<id column="id" property="id" jdbcType="VARCHAR"/> <id column="ID" property="id" />
<result column="is_deleted" property="isDeleted" jdbcType="INTEGER"/> <result column="IS_DELETED" property="isDeleted" />
<result column="create_by_id" property="createById" jdbcType="VARCHAR"/> <result column="CREATE_BY_ID" property="createById" />
<result column="create_by_name" property="createByName" jdbcType="VARCHAR"/> <result column="CREATE_BY_NAME" property="createByName" />
<result column="create_time" property="createTime" jdbcType="DATE"/> <result column="CREATE_TIME" property="createTime" />
<result column="modify_by_id" property="modifyById" jdbcType="VARCHAR"/> <result column="MODIFY_BY_ID" property="modifyById" />
<result column="modify_by_name" property="modifyByName" jdbcType="VARCHAR"/> <result column="MODIFY_BY_NAME" property="modifyByName" />
<result column="modify_time" property="modifyTime" jdbcType="DATE"/> <result column="MODIFY_TIME" property="modifyTime" />
<result column="institution_id" property="institutionId" jdbcType="VARCHAR"/> <result column="institution_id" property="institutionId" />
<result column="config_id" property="configId" jdbcType="VARCHAR"/> <result column="config_id" property="configId" />
<result column="wellhead_id" property="wellheadId" jdbcType="VARCHAR"/> <result column="WELLHEAD_ID" property="wellheadId" />
<result column="generation_type_key" property="generationTypeKey" jdbcType="VARCHAR"/> <result column="generation_type_key" property="generationTypeKey" />
<result column="open_well_time" property="openWellTime" jdbcType="VARCHAR"/> <result column="open_well_time" property="openWellTime" />
<result column="close_well_time" property="closeWellTime" jdbcType="VARCHAR"/> <result column="close_well_time" property="closeWellTime" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id id
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
modify_time, modify_time,
institution_id, institution_id,
config_id, config_id,
wellhead_id, WELLHEAD_ID,
generation_type_key, generation_type_key,
open_well_time, open_well_time,
close_well_time close_well_time
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
modify_time, modify_time,
institution_id, institution_id,
config_id, config_id,
wellhead_id, WELLHEAD_ID,
generation_type_key, generation_type_key,
open_well_time, open_well_time,
close_well_time close_well_time
......
...@@ -2,28 +2,28 @@ ...@@ -2,28 +2,28 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pps.core.space.mapper.SpaceInstitutionWellheadViewMapper"> <mapper namespace="pps.core.space.mapper.SpaceInstitutionWellheadViewMapper">
<resultMap id="BaseResultMap" type="pps.core.space.entity.SpaceInstitutionWellheadView"> <resultMap id="BaseResultMap" type="pps.core.space.entity.SpaceInstitutionWellheadView">
<id column="id" property="id" jdbcType="VARCHAR"/> <id column="ID" property="id" />
<result column="is_deleted" property="isDeleted" jdbcType="INTEGER"/> <result column="IS_DELETED" property="isDeleted" />
<result column="create_by_id" property="createById" jdbcType="VARCHAR"/> <result column="CREATE_BY_ID" property="createById" />
<result column="create_by_name" property="createByName" jdbcType="VARCHAR"/> <result column="CREATE_BY_NAME" property="createByName" />
<result column="create_time" property="createTime" jdbcType="DATE"/> <result column="CREATE_TIME" property="createTime" />
<result column="modify_by_id" property="modifyById" jdbcType="VARCHAR"/> <result column="MODIFY_BY_ID" property="modifyById" />
<result column="modify_by_name" property="modifyByName" jdbcType="VARCHAR"/> <result column="MODIFY_BY_NAME" property="modifyByName" />
<result column="modify_time" property="modifyTime" jdbcType="DATE"/> <result column="MODIFY_TIME" property="modifyTime" />
<result column="institution_id" property="institutionId" jdbcType="VARCHAR"/> <result column="institution_id" property="institutionId" />
<result column="wellhead_id" property="wellheadId" jdbcType="VARCHAR"/> <result column="WELLHEAD_ID" property="wellheadId" />
<result column="well_number" property="wellNumber" jdbcType="VARCHAR"/> <result column="WELL_NUMBER" property="wellNumber" />
<result column="run_type_key" property="runTypeKey" jdbcType="VARCHAR"/> <result column="RUN_TYPE_KEY" property="runTypeKey" />
<result column="interval_type_key" property="intervalTypeKey" jdbcType="VARCHAR"/> <result column="interval_type_key" property="intervalTypeKey" />
<result column="interval_describe" property="intervalDescribe" jdbcType="VARCHAR"/> <result column="interval_describe" property="intervalDescribe" />
<result column="start_seq" property="startSeq" jdbcType="INTEGER"/> <result column="START_SEQ" property="startSeq" />
<result column="open_well_day" property="openWellDay" jdbcType="INTEGER"/> <result column="open_well_day" property="openWellDay" />
<result column="close_well_day" property="closeWellDay" jdbcType="INTEGER"/> <result column="close_well_day" property="closeWellDay" />
<result column="run_duration" property="runDuration" jdbcType="DECIMAL"/> <result column="run_duration" property="runDuration" />
<result column="max_open" property="maxOpen" jdbcType="DECIMAL"/> <result column="max_open" property="maxOpen" />
<result column="min_open" property="minOpen" jdbcType="DECIMAL"/> <result column="min_open" property="minOpen" />
<result column="max_close" property="maxClose" jdbcType="DECIMAL"/> <result column="max_close" property="maxClose" />
<result column="min_close" property="minClose" jdbcType="DECIMAL"/> <result column="min_close" property="minClose" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id id
...@@ -36,12 +36,12 @@ ...@@ -36,12 +36,12 @@
modify_by_name, modify_by_name,
modify_time, modify_time,
institution_id, institution_id,
wellhead_id, WELLHEAD_ID,
well_number, WELL_NUMBER,
run_type_key, RUN_TYPE_KEY,
interval_type_key, interval_type_key,
interval_describe, interval_describe,
start_seq, START_SEQ,
open_well_day, open_well_day,
close_well_day, close_well_day,
run_duration, run_duration,
...@@ -76,12 +76,12 @@ ...@@ -76,12 +76,12 @@
modify_by_name, modify_by_name,
modify_time, modify_time,
institution_id, institution_id,
wellhead_id, WELLHEAD_ID,
well_number, WELL_NUMBER,
run_type_key, RUN_TYPE_KEY,
interval_type_key, interval_type_key,
interval_describe, interval_describe,
start_seq, START_SEQ,
open_well_day, open_well_day,
close_well_day, close_well_day,
run_duration, run_duration,
...@@ -123,12 +123,12 @@ ...@@ -123,12 +123,12 @@
SELECT SELECT
DISTINCT DISTINCT
institution_id, institution_id,
wellhead_id, WELLHEAD_ID,
well_number, WELL_NUMBER,
run_type_key, RUN_TYPE_KEY,
IFNULL( interval_type_key, '999' ) AS interval_type_key, IFNULL( interval_type_key, '999' ) AS interval_type_key,
interval_describe, interval_describe,
IFNULL( start_seq, 0 ) AS start_seq, IFNULL( START_SEQ, 0 ) AS START_SEQ,
open_well_day, open_well_day,
close_well_day, close_well_day,
run_duration run_duration
...@@ -143,19 +143,19 @@ ...@@ -143,19 +143,19 @@
</select> </select>
<resultMap id="ExtResultMap" type="pps.core.space.entity.SpaceInstitutionWellheadView" extends="BaseResultMap"> <resultMap id="ExtResultMap" type="pps.core.space.entity.SpaceInstitutionWellheadView" extends="BaseResultMap">
<result column="service_rating" property="serviceRating" jdbcType="DECIMAL"/> <result column="SERVICE_RATING" property="serviceRating" />
</resultMap> </resultMap>
<select id="selectWellheadsByInstitutionIds" parameterType="pps.core.space.entity.SpaceInstitutionWellheadView" <select id="selectWellheadsByInstitutionIds" parameterType="pps.core.space.entity.SpaceInstitutionWellheadView"
resultMap="ExtResultMap"> resultMap="ExtResultMap">
SELECT SELECT
w.institution_id, w.institution_id,
w.wellhead_id, w.WELLHEAD_ID,
w.well_number, w.WELL_NUMBER,
w.run_type_key, w.RUN_TYPE_KEY,
IFNULL( w.interval_type_key, '999' ) AS interval_type_key, IFNULL( w.interval_type_key, '999' ) AS interval_type_key,
w.interval_describe, w.interval_describe,
IFNULL( w.start_seq, 0 ) AS start_seq, IFNULL( w.START_SEQ, 0 ) AS START_SEQ,
w.open_well_day, w.open_well_day,
w.close_well_day, w.close_well_day,
w.run_duration, w.run_duration,
...@@ -163,10 +163,10 @@ ...@@ -163,10 +163,10 @@
w.min_open, w.min_open,
w.max_close, w.max_close,
w.min_close, w.min_close,
b.service_rating b.SERVICE_RATING
FROM FROM
SPACE_INSTITUTION_WELLHEAD w SPACE_INSTITUTION_WELLHEAD w
JOIN BASE_WELLHEAD b ON w.wellhead_id = b.id JOIN BASE_WELLHEAD b ON w.WELLHEAD_ID = b.id
WHERE WHERE
w.is_deleted = 1 w.is_deleted = 1
AND b.is_deleted = 1 AND b.is_deleted = 1
...@@ -180,13 +180,13 @@ ...@@ -180,13 +180,13 @@
<select id="selectInstitutionWellheadList" parameterType="pps.core.space.entity.SpaceInstitutionWellheadView" <select id="selectInstitutionWellheadList" parameterType="pps.core.space.entity.SpaceInstitutionWellheadView"
resultMap="BaseResultMap"> resultMap="BaseResultMap">
SELECT w.wellhead_id, SELECT w.WELLHEAD_ID,
w.well_number, w.WELL_NUMBER,
w.run_type_key, w.RUN_TYPE_KEY,
w.interval_type_key, w.interval_type_key,
w.start_seq, w.START_SEQ,
CASE CASE
w.run_type_key w.RUN_TYPE_KEY
WHEN 'CONTINUOUS' THEN WHEN 'CONTINUOUS' THEN
24 24
ELSE IFNULL(w.run_duration, 0) ELSE IFNULL(w.run_duration, 0)
......
...@@ -2,48 +2,48 @@ ...@@ -2,48 +2,48 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pps.core.space.mapper.SpaceOptimizeEffectViewMapper"> <mapper namespace="pps.core.space.mapper.SpaceOptimizeEffectViewMapper">
<resultMap id="BaseResultMap" type="pps.core.space.entity.SpaceOptimizeEffectView"> <resultMap id="BaseResultMap" type="pps.core.space.entity.SpaceOptimizeEffectView">
<id column="id" property="id" jdbcType="VARCHAR"/> <id column="ID" property="id" />
<result column="is_deleted" property="isDeleted" jdbcType="INTEGER"/> <result column="IS_DELETED" property="isDeleted" />
<result column="create_by_id" property="createById" jdbcType="VARCHAR"/> <result column="CREATE_BY_ID" property="createById" />
<result column="create_by_name" property="createByName" jdbcType="VARCHAR"/> <result column="CREATE_BY_NAME" property="createByName" />
<result column="create_time" property="createTime" jdbcType="DATE"/> <result column="CREATE_TIME" property="createTime" />
<result column="modify_by_id" property="modifyById" jdbcType="VARCHAR"/> <result column="MODIFY_BY_ID" property="modifyById" />
<result column="modify_by_name" property="modifyByName" jdbcType="VARCHAR"/> <result column="MODIFY_BY_NAME" property="modifyByName" />
<result column="modify_time" property="modifyTime" jdbcType="DATE"/> <result column="MODIFY_TIME" property="modifyTime" />
<result column="period_id" property="periodId" jdbcType="VARCHAR"/> <result column="period_id" property="periodId" />
<result column="wellhead_id" property="wellheadId" jdbcType="VARCHAR"/> <result column="WELLHEAD_ID" property="wellheadId" />
<result column="well_number" property="wellNumber" jdbcType="VARCHAR"/> <result column="WELL_NUMBER" property="wellNumber" />
<result column="optimize_date" property="optimizeDate" jdbcType="DATE"/> <result column="optimize_date" property="optimizeDate" />
<result column="institution_result" property="institutionResult" jdbcType="VARCHAR"/> <result column="institution_result" property="institutionResult" />
<result column="optimal_result" property="optimalResult" jdbcType="VARCHAR"/> <result column="optimal_result" property="optimalResult" />
<result column="total_duration" property="totalDuration" jdbcType="DECIMAL"/> <result column="total_duration" property="totalDuration" />
<result column="green_power_duration" property="greenPowerDuration" jdbcType="DECIMAL"/> <result column="green_power_duration" property="greenPowerDuration" />
<result column="low_power_duration" property="lowPowerDuration" jdbcType="DECIMAL"/> <result column="low_power_duration" property="lowPowerDuration" />
<result column="mid_power_duration" property="midPowerDuration" jdbcType="DECIMAL"/> <result column="mid_power_duration" property="midPowerDuration" />
<result column="high_power_duration" property="highPowerDuration" jdbcType="DECIMAL"/> <result column="high_power_duration" property="highPowerDuration" />
<result column="peak_power_duration" property="peakPowerDuration" jdbcType="DECIMAL"/> <result column="peak_power_duration" property="peakPowerDuration" />
<result column="green_power_rate" property="greenPowerRate" jdbcType="DECIMAL"/> <result column="green_power_rate" property="greenPowerRate" />
<result column="green_power_cost" property="greenPowerCost" jdbcType="DECIMAL"/> <result column="green_power_cost" property="greenPowerCost" />
<result column="low_power_cost" property="lowPowerCost" jdbcType="DECIMAL"/> <result column="low_power_cost" property="lowPowerCost" />
<result column="mid_power_cost" property="midPowerCost" jdbcType="DECIMAL"/> <result column="mid_power_cost" property="midPowerCost" />
<result column="high_power_cost" property="highPowerCost" jdbcType="DECIMAL"/> <result column="high_power_cost" property="highPowerCost" />
<result column="peak_power_cost" property="peakPowerCost" jdbcType="DECIMAL"/> <result column="peak_power_cost" property="peakPowerCost" />
<result column="power_cost" property="powerCost" jdbcType="DECIMAL"/> <result column="power_cost" property="powerCost" />
<result column="optimal_total_duration" property="optimalTotalDuration" jdbcType="DECIMAL"/> <result column="optimal_total_duration" property="optimalTotalDuration" />
<result column="optimal_green_power_duration" property="optimalGreenPowerDuration" jdbcType="DECIMAL"/> <result column="optimal_green_power_duration" property="optimalGreenPowerDuration" />
<result column="optimal_low_power_duration" property="optimalLowPowerDuration" jdbcType="DECIMAL"/> <result column="optimal_low_power_duration" property="optimalLowPowerDuration" />
<result column="optimal_mid_power_duration" property="optimalMidPowerDuration" jdbcType="DECIMAL"/> <result column="optimal_mid_power_duration" property="optimalMidPowerDuration" />
<result column="optimal_high_power_duration" property="optimalHighPowerDuration" jdbcType="DECIMAL"/> <result column="optimal_high_power_duration" property="optimalHighPowerDuration" />
<result column="optimal_peak_power_duration" property="optimalPeakPowerDuration" jdbcType="DECIMAL"/> <result column="optimal_peak_power_duration" property="optimalPeakPowerDuration" />
<result column="optimal_green_power_rate" property="optimalGreenPowerRate" jdbcType="DECIMAL"/> <result column="optimal_green_power_rate" property="optimalGreenPowerRate" />
<result column="optimal_green_power_cost" property="optimalGreenPowerCost" jdbcType="DECIMAL"/> <result column="optimal_green_power_cost" property="optimalGreenPowerCost" />
<result column="optimal_low_power_cost" property="optimalLowPowerCost" jdbcType="DECIMAL"/> <result column="optimal_low_power_cost" property="optimalLowPowerCost" />
<result column="optimal_mid_power_cost" property="optimalMidPowerCost" jdbcType="DECIMAL"/> <result column="optimal_mid_power_cost" property="optimalMidPowerCost" />
<result column="optimal_high_power_cost" property="optimalHighPowerCost" jdbcType="DECIMAL"/> <result column="optimal_high_power_cost" property="optimalHighPowerCost" />
<result column="optimal_peak_power_cost" property="optimalPeakPowerCost" jdbcType="DECIMAL"/> <result column="optimal_peak_power_cost" property="optimalPeakPowerCost" />
<result column="optimal_power_cost" property="optimalPowerCost" jdbcType="DECIMAL"/> <result column="optimal_power_cost" property="optimalPowerCost" />
<result column="green_power_upgrade" property="greenPowerUpgrade" jdbcType="DECIMAL"/> <result column="green_power_upgrade" property="greenPowerUpgrade" />
<result column="cost_down" property="costDown" jdbcType="DECIMAL"/> <result column="cost_down" property="costDown" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id id
...@@ -56,8 +56,8 @@ ...@@ -56,8 +56,8 @@
modify_by_name, modify_by_name,
modify_time, modify_time,
period_id, period_id,
wellhead_id, WELLHEAD_ID,
well_number, WELL_NUMBER,
optimize_date, optimize_date,
optimal_result, optimal_result,
total_duration, total_duration,
...@@ -115,8 +115,8 @@ ...@@ -115,8 +115,8 @@
modify_by_name, modify_by_name,
modify_time, modify_time,
period_id, period_id,
wellhead_id, WELLHEAD_ID,
well_number, WELL_NUMBER,
optimize_date, optimize_date,
optimal_result, optimal_result,
total_duration, total_duration,
......
...@@ -2,22 +2,22 @@ ...@@ -2,22 +2,22 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pps.core.space.mapper.SpaceOptimizeLongDurationViewMapper"> <mapper namespace="pps.core.space.mapper.SpaceOptimizeLongDurationViewMapper">
<resultMap id="BaseResultMap" type="pps.core.space.entity.SpaceOptimizeLongDurationView"> <resultMap id="BaseResultMap" type="pps.core.space.entity.SpaceOptimizeLongDurationView">
<id column="id" property="id" jdbcType="VARCHAR"/> <id column="ID" property="id" />
<result column="is_deleted" property="isDeleted" jdbcType="INTEGER"/> <result column="IS_DELETED" property="isDeleted" />
<result column="create_by_id" property="createById" jdbcType="VARCHAR"/> <result column="CREATE_BY_ID" property="createById" />
<result column="create_by_name" property="createByName" jdbcType="VARCHAR"/> <result column="CREATE_BY_NAME" property="createByName" />
<result column="create_time" property="createTime" jdbcType="DATE"/> <result column="CREATE_TIME" property="createTime" />
<result column="modify_by_id" property="modifyById" jdbcType="VARCHAR"/> <result column="MODIFY_BY_ID" property="modifyById" />
<result column="modify_by_name" property="modifyByName" jdbcType="VARCHAR"/> <result column="MODIFY_BY_NAME" property="modifyByName" />
<result column="modify_time" property="modifyTime" jdbcType="DATE"/> <result column="MODIFY_TIME" property="modifyTime" />
<result column="record_id" property="recordId" jdbcType="VARCHAR"/> <result column="record_id" property="recordId" />
<result column="long_period_id" property="longPeriodId" jdbcType="VARCHAR"/> <result column="long_period_id" property="longPeriodId" />
<result column="wellhead_id" property="wellheadId" jdbcType="VARCHAR"/> <result column="WELLHEAD_ID" property="wellheadId" />
<result column="is_optimize" property="isOptimize" jdbcType="INTEGER"/> <result column="is_optimize" property="isOptimize" />
<result column="generation_type_key" property="generationTypeKey" jdbcType="VARCHAR"/> <result column="generation_type_key" property="generationTypeKey" />
<result column="open_well_time" property="openWellTime" jdbcType="VARCHAR"/> <result column="open_well_time" property="openWellTime" />
<result column="close_well_time" property="closeWellTime" jdbcType="VARCHAR"/> <result column="close_well_time" property="closeWellTime" />
<result column="first_start" property="firstStart" jdbcType="INTEGER"/> <result column="first_start" property="firstStart" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id id
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
modify_time, modify_time,
record_id, record_id,
long_period_id, long_period_id,
wellhead_id, WELLHEAD_ID,
is_optimize, is_optimize,
generation_type_key, generation_type_key,
open_well_time, open_well_time,
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
modify_time, modify_time,
record_id, record_id,
long_period_id, long_period_id,
wellhead_id, WELLHEAD_ID,
is_optimize, is_optimize,
generation_type_key, generation_type_key,
open_well_time, open_well_time,
......
...@@ -2,19 +2,19 @@ ...@@ -2,19 +2,19 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pps.core.space.mapper.SpaceOptimizeLongPeriodViewMapper"> <mapper namespace="pps.core.space.mapper.SpaceOptimizeLongPeriodViewMapper">
<resultMap id="BaseResultMap" type="pps.core.space.entity.SpaceOptimizeLongPeriodView"> <resultMap id="BaseResultMap" type="pps.core.space.entity.SpaceOptimizeLongPeriodView">
<id column="id" property="id" jdbcType="VARCHAR"/> <id column="ID" property="id" />
<result column="is_deleted" property="isDeleted" jdbcType="INTEGER"/> <result column="IS_DELETED" property="isDeleted" />
<result column="create_by_id" property="createById" jdbcType="VARCHAR"/> <result column="CREATE_BY_ID" property="createById" />
<result column="create_by_name" property="createByName" jdbcType="VARCHAR"/> <result column="CREATE_BY_NAME" property="createByName" />
<result column="create_time" property="createTime" jdbcType="DATE"/> <result column="CREATE_TIME" property="createTime" />
<result column="modify_by_id" property="modifyById" jdbcType="VARCHAR"/> <result column="MODIFY_BY_ID" property="modifyById" />
<result column="modify_by_name" property="modifyByName" jdbcType="VARCHAR"/> <result column="MODIFY_BY_NAME" property="modifyByName" />
<result column="modify_time" property="modifyTime" jdbcType="DATE"/> <result column="MODIFY_TIME" property="modifyTime" />
<result column="line_id" property="lineId" jdbcType="VARCHAR"/> <result column="LINE_ID" property="lineId" />
<result column="institution_id" property="institutionId" jdbcType="VARCHAR"/> <result column="institution_id" property="institutionId" />
<result column="execution_cycle" property="executionCycle" jdbcType="VARCHAR"/> <result column="execution_cycle" property="executionCycle" />
<result column="optimize_state" property="optimizeState" jdbcType="INTEGER"/> <result column="optimize_state" property="optimizeState" />
<result column="optimize_deadline" property="optimizeDeadline" jdbcType="TIMESTAMP"/> <result column="optimize_deadline" property="optimizeDeadline" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id id
...@@ -41,9 +41,9 @@ ...@@ -41,9 +41,9 @@
</select> </select>
<resultMap id="ExtendResultMap" type="pps.core.space.entity.SpaceOptimizeLongPeriodView" extends="BaseResultMap"> <resultMap id="ExtendResultMap" type="pps.core.space.entity.SpaceOptimizeLongPeriodView" extends="BaseResultMap">
<result column="ou_id" property="ouId" jdbcType="VARCHAR"/> <result column="OU_ID" property="ouId" />
<result column="grid_type_key" property="gridTypeKey" jdbcType="VARCHAR"/> <result column="GRID_TYPE_KEY" property="gridTypeKey" />
<result column="institution_name" property="institutionName" jdbcType="VARCHAR"/> <result column="institution_name" property="institutionName" />
</resultMap> </resultMap>
<select id="selectList" parameterType="pps.core.space.entity.SpaceOptimizeLongPeriodView" resultMap="BaseResultMap"> <select id="selectList" parameterType="pps.core.space.entity.SpaceOptimizeLongPeriodView" resultMap="BaseResultMap">
......
...@@ -2,18 +2,18 @@ ...@@ -2,18 +2,18 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pps.core.space.mapper.SpaceOptimizeLongWellheadViewMapper"> <mapper namespace="pps.core.space.mapper.SpaceOptimizeLongWellheadViewMapper">
<resultMap id="BaseResultMap" type="pps.core.space.entity.SpaceOptimizeLongWellheadView"> <resultMap id="BaseResultMap" type="pps.core.space.entity.SpaceOptimizeLongWellheadView">
<id column="id" property="id" jdbcType="VARCHAR"/> <id column="ID" property="id" />
<result column="is_deleted" property="isDeleted" jdbcType="INTEGER"/> <result column="IS_DELETED" property="isDeleted" />
<result column="create_by_id" property="createById" jdbcType="VARCHAR"/> <result column="CREATE_BY_ID" property="createById" />
<result column="create_by_name" property="createByName" jdbcType="VARCHAR"/> <result column="CREATE_BY_NAME" property="createByName" />
<result column="create_time" property="createTime" jdbcType="DATE"/> <result column="CREATE_TIME" property="createTime" />
<result column="modify_by_id" property="modifyById" jdbcType="VARCHAR"/> <result column="MODIFY_BY_ID" property="modifyById" />
<result column="modify_by_name" property="modifyByName" jdbcType="VARCHAR"/> <result column="MODIFY_BY_NAME" property="modifyByName" />
<result column="modify_time" property="modifyTime" jdbcType="DATE"/> <result column="MODIFY_TIME" property="modifyTime" />
<result column="long_period_id" property="longPeriodId" jdbcType="VARCHAR"/> <result column="long_period_id" property="longPeriodId" />
<result column="wellhead_id" property="wellheadId" jdbcType="VARCHAR"/> <result column="WELLHEAD_ID" property="wellheadId" />
<result column="well_number" property="wellNumber" jdbcType="VARCHAR"/> <result column="WELL_NUMBER" property="wellNumber" />
<result column="start_seq" property="startSeq" jdbcType="INTEGER"/> <result column="START_SEQ" property="startSeq" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id id
...@@ -26,9 +26,9 @@ ...@@ -26,9 +26,9 @@
modify_by_name, modify_by_name,
modify_time, modify_time,
long_period_id, long_period_id,
wellhead_id, WELLHEAD_ID,
well_number, WELL_NUMBER,
start_seq START_SEQ
</sql> </sql>
<select id="selectOne" parameterType="pps.core.space.entity.SpaceOptimizeLongWellheadView" <select id="selectOne" parameterType="pps.core.space.entity.SpaceOptimizeLongWellheadView"
resultMap="BaseResultMap"> resultMap="BaseResultMap">
...@@ -48,33 +48,33 @@ ...@@ -48,33 +48,33 @@
</select> </select>
<resultMap id="ExtResultMap" type="pps.core.space.entity.SpaceOptimizeLongWellheadView" extends="BaseResultMap"> <resultMap id="ExtResultMap" type="pps.core.space.entity.SpaceOptimizeLongWellheadView" extends="BaseResultMap">
<result column="run_duration" property="runDuration" jdbcType="DECIMAL"/> <result column="run_duration" property="runDuration" />
</resultMap> </resultMap>
<select id="selectListJoin" parameterType="pps.core.space.entity.SpaceOptimizeLongWellheadView" <select id="selectListJoin" parameterType="pps.core.space.entity.SpaceOptimizeLongWellheadView"
resultMap="BaseResultMap"> resultMap="BaseResultMap">
SELECT s.wellhead_id, SELECT s.WELLHEAD_ID,
s.well_number, s.WELL_NUMBER,
s.start_seq, s.START_SEQ,
s.optimize_date, s.optimize_date,
CASE CASE
w.run_type_key w.RUN_TYPE_KEY
WHEN 'CONTINUOUS' THEN WHEN 'CONTINUOUS' THEN
24 24
ELSE w.run_duration ELSE w.run_duration
END run_duration END run_duration
FROM SPACE_OPTIMIZE_LONG_WELLHEAD s FROM SPACE_OPTIMIZE_LONG_WELLHEAD s
LEFT JOIN SPACE_INSTITUTION_WELLHEAD w ON s.wellhead_id = w.wellhead_id LEFT JOIN SPACE_INSTITUTION_WELLHEAD w ON s.WELLHEAD_ID = w.WELLHEAD_ID
WHERE s.is_deleted = 1 WHERE s.is_deleted = 1
AND w.is_deleted = 1 AND w.is_deleted = 1
AND s.long_period_id = #{longPeriodId} AND s.long_period_id = #{longPeriodId}
AND s.optimize_date = #{optimizeDate} AND s.optimize_date = #{optimizeDate}
ORDER BY s.start_seq ASC ORDER BY s.START_SEQ ASC
</select> </select>
<insert id="batchInsertList" parameterType="list"> <insert id="batchInsertList" parameterType="list">
INSERT INTO SPACE_OPTIMIZE_LONG_WELLHEAD ( id, create_by_id, create_by_name, create_time, INSERT INTO SPACE_OPTIMIZE_LONG_WELLHEAD ( id, create_by_id, create_by_name, create_time,
modify_by_id, modify_by_name, modify_time, long_period_id, wellhead_id, well_number ) modify_by_id, modify_by_name, modify_time, long_period_id, WELLHEAD_ID, WELL_NUMBER )
VALUES VALUES
<foreach collection="list" item="item" separator=","> <foreach collection="list" item="item" separator=",">
( (
......
...@@ -2,22 +2,22 @@ ...@@ -2,22 +2,22 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pps.core.space.mapper.SpaceOptimizeMidDurationViewMapper"> <mapper namespace="pps.core.space.mapper.SpaceOptimizeMidDurationViewMapper">
<resultMap id="BaseResultMap" type="pps.core.space.entity.SpaceOptimizeMidDurationView"> <resultMap id="BaseResultMap" type="pps.core.space.entity.SpaceOptimizeMidDurationView">
<id column="id" property="id" jdbcType="VARCHAR"/> <id column="ID" property="id" />
<result column="is_deleted" property="isDeleted" jdbcType="INTEGER"/> <result column="IS_DELETED" property="isDeleted" />
<result column="create_by_id" property="createById" jdbcType="VARCHAR"/> <result column="CREATE_BY_ID" property="createById" />
<result column="create_by_name" property="createByName" jdbcType="VARCHAR"/> <result column="CREATE_BY_NAME" property="createByName" />
<result column="create_time" property="createTime" jdbcType="DATE"/> <result column="CREATE_TIME" property="createTime" />
<result column="modify_by_id" property="modifyById" jdbcType="VARCHAR"/> <result column="MODIFY_BY_ID" property="modifyById" />
<result column="modify_by_name" property="modifyByName" jdbcType="VARCHAR"/> <result column="MODIFY_BY_NAME" property="modifyByName" />
<result column="modify_time" property="modifyTime" jdbcType="DATE"/> <result column="MODIFY_TIME" property="modifyTime" />
<result column="record_id" property="recordId" jdbcType="VARCHAR"/> <result column="record_id" property="recordId" />
<result column="mid_period_id" property="midPeriodId" jdbcType="VARCHAR"/> <result column="mid_period_id" property="midPeriodId" />
<result column="wellhead_id" property="wellheadId" jdbcType="VARCHAR"/> <result column="WELLHEAD_ID" property="wellheadId" />
<result column="is_optimize" property="isOptimize" jdbcType="INTEGER"/> <result column="is_optimize" property="isOptimize" />
<result column="generation_type_key" property="generationTypeKey" jdbcType="VARCHAR"/> <result column="generation_type_key" property="generationTypeKey" />
<result column="open_well_time" property="openWellTime" jdbcType="VARCHAR"/> <result column="open_well_time" property="openWellTime" />
<result column="close_well_time" property="closeWellTime" jdbcType="VARCHAR"/> <result column="close_well_time" property="closeWellTime" />
<result column="first_start" property="firstStart" jdbcType="INTEGER"/> <result column="first_start" property="firstStart" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id id
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
modify_time, modify_time,
record_id, record_id,
mid_period_id, mid_period_id,
wellhead_id, WELLHEAD_ID,
is_optimize, is_optimize,
generation_type_key, generation_type_key,
open_well_time, open_well_time,
......
...@@ -2,19 +2,19 @@ ...@@ -2,19 +2,19 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pps.core.space.mapper.SpaceOptimizeMidPeriodViewMapper"> <mapper namespace="pps.core.space.mapper.SpaceOptimizeMidPeriodViewMapper">
<resultMap id="BaseResultMap" type="pps.core.space.entity.SpaceOptimizeMidPeriodView"> <resultMap id="BaseResultMap" type="pps.core.space.entity.SpaceOptimizeMidPeriodView">
<id column="id" property="id" jdbcType="VARCHAR"/> <id column="ID" property="id" />
<result column="is_deleted" property="isDeleted" jdbcType="INTEGER"/> <result column="IS_DELETED" property="isDeleted" />
<result column="create_by_id" property="createById" jdbcType="VARCHAR"/> <result column="CREATE_BY_ID" property="createById" />
<result column="create_by_name" property="createByName" jdbcType="VARCHAR"/> <result column="CREATE_BY_NAME" property="createByName" />
<result column="create_time" property="createTime" jdbcType="DATE"/> <result column="CREATE_TIME" property="createTime" />
<result column="modify_by_id" property="modifyById" jdbcType="VARCHAR"/> <result column="MODIFY_BY_ID" property="modifyById" />
<result column="modify_by_name" property="modifyByName" jdbcType="VARCHAR"/> <result column="MODIFY_BY_NAME" property="modifyByName" />
<result column="modify_time" property="modifyTime" jdbcType="DATE"/> <result column="MODIFY_TIME" property="modifyTime" />
<result column="line_id" property="lineId" jdbcType="VARCHAR"/> <result column="LINE_ID" property="lineId" />
<result column="institution_id" property="institutionId" jdbcType="VARCHAR"/> <result column="institution_id" property="institutionId" />
<result column="execution_cycle" property="executionCycle" jdbcType="VARCHAR"/> <result column="execution_cycle" property="executionCycle" />
<result column="optimize_state" property="optimizeState" jdbcType="INTEGER"/> <result column="optimize_state" property="optimizeState" />
<result column="optimize_deadline" property="optimizeDeadline" jdbcType="TIMESTAMP"/> <result column="optimize_deadline" property="optimizeDeadline" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id id
...@@ -41,9 +41,9 @@ ...@@ -41,9 +41,9 @@
</select> </select>
<resultMap id="ExtendResultMap" type="pps.core.space.entity.SpaceOptimizeMidPeriodView" extends="BaseResultMap"> <resultMap id="ExtendResultMap" type="pps.core.space.entity.SpaceOptimizeMidPeriodView" extends="BaseResultMap">
<result column="ou_id" property="ouId" jdbcType="VARCHAR"/> <result column="OU_ID" property="ouId" />
<result column="grid_type_key" property="gridTypeKey" jdbcType="VARCHAR"/> <result column="GRID_TYPE_KEY" property="gridTypeKey" />
<result column="institution_name" property="institutionName" jdbcType="VARCHAR"/> <result column="institution_name" property="institutionName" />
</resultMap> </resultMap>
<select id="selectList" parameterType="pps.core.space.entity.SpaceOptimizeMidPeriodView" resultMap="BaseResultMap"> <select id="selectList" parameterType="pps.core.space.entity.SpaceOptimizeMidPeriodView" resultMap="BaseResultMap">
......
...@@ -2,18 +2,18 @@ ...@@ -2,18 +2,18 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pps.core.space.mapper.SpaceOptimizeMidWellheadViewMapper"> <mapper namespace="pps.core.space.mapper.SpaceOptimizeMidWellheadViewMapper">
<resultMap id="BaseResultMap" type="pps.core.space.entity.SpaceOptimizeMidWellheadView"> <resultMap id="BaseResultMap" type="pps.core.space.entity.SpaceOptimizeMidWellheadView">
<id column="id" property="id" jdbcType="VARCHAR"/> <id column="ID" property="id" />
<result column="is_deleted" property="isDeleted" jdbcType="INTEGER"/> <result column="IS_DELETED" property="isDeleted" />
<result column="create_by_id" property="createById" jdbcType="VARCHAR"/> <result column="CREATE_BY_ID" property="createById" />
<result column="create_by_name" property="createByName" jdbcType="VARCHAR"/> <result column="CREATE_BY_NAME" property="createByName" />
<result column="create_time" property="createTime" jdbcType="DATE"/> <result column="CREATE_TIME" property="createTime" />
<result column="modify_by_id" property="modifyById" jdbcType="VARCHAR"/> <result column="MODIFY_BY_ID" property="modifyById" />
<result column="modify_by_name" property="modifyByName" jdbcType="VARCHAR"/> <result column="MODIFY_BY_NAME" property="modifyByName" />
<result column="modify_time" property="modifyTime" jdbcType="DATE"/> <result column="MODIFY_TIME" property="modifyTime" />
<result column="mid_period_id" property="midPeriodId" jdbcType="VARCHAR"/> <result column="mid_period_id" property="midPeriodId" />
<result column="wellhead_id" property="wellheadId" jdbcType="VARCHAR"/> <result column="WELLHEAD_ID" property="wellheadId" />
<result column="well_number" property="wellNumber" jdbcType="VARCHAR"/> <result column="WELL_NUMBER" property="wellNumber" />
<result column="start_seq" property="startSeq" jdbcType="INTEGER"/> <result column="START_SEQ" property="startSeq" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id id
...@@ -26,9 +26,9 @@ ...@@ -26,9 +26,9 @@
modify_by_name, modify_by_name,
modify_time, modify_time,
mid_period_id, mid_period_id,
wellhead_id, WELLHEAD_ID,
well_number, WELL_NUMBER,
start_seq START_SEQ
</sql> </sql>
<select id="selectOne" parameterType="pps.core.space.entity.SpaceOptimizeMidWellheadView" resultMap="BaseResultMap"> <select id="selectOne" parameterType="pps.core.space.entity.SpaceOptimizeMidWellheadView" resultMap="BaseResultMap">
select select
...@@ -47,27 +47,27 @@ ...@@ -47,27 +47,27 @@
</select> </select>
<resultMap id="ExtResultMap" type="pps.core.space.entity.SpaceOptimizeMidWellheadView" extends="BaseResultMap"> <resultMap id="ExtResultMap" type="pps.core.space.entity.SpaceOptimizeMidWellheadView" extends="BaseResultMap">
<result column="run_duration" property="runDuration" jdbcType="DECIMAL"/> <result column="run_duration" property="runDuration" />
</resultMap> </resultMap>
<select id="selectListJoin" parameterType="pps.core.space.entity.SpaceOptimizeMidWellheadView" <select id="selectListJoin" parameterType="pps.core.space.entity.SpaceOptimizeMidWellheadView"
resultMap="BaseResultMap"> resultMap="BaseResultMap">
SELECT s.wellhead_id, SELECT s.WELLHEAD_ID,
s.well_number, s.WELL_NUMBER,
s.start_seq, s.START_SEQ,
s.optimize_date, s.optimize_date,
CASE CASE
w.run_type_key w.RUN_TYPE_KEY
WHEN 'CONTINUOUS' THEN WHEN 'CONTINUOUS' THEN
24 24
ELSE w.run_duration ELSE w.run_duration
END run_duration END run_duration
FROM SPACE_OPTIMIZE_MID_WELLHEAD s FROM SPACE_OPTIMIZE_MID_WELLHEAD s
LEFT JOIN SPACE_INSTITUTION_WELLHEAD w ON s.wellhead_id = w.wellhead_id LEFT JOIN SPACE_INSTITUTION_WELLHEAD w ON s.WELLHEAD_ID = w.WELLHEAD_ID
WHERE s.is_deleted = 1 WHERE s.is_deleted = 1
AND w.is_deleted = 1 AND w.is_deleted = 1
AND s.mid_period_id = #{midPeriodId} AND s.mid_period_id = #{midPeriodId}
AND s.optimize_date = #{optimizeDate} AND s.optimize_date = #{optimizeDate}
ORDER BY s.start_seq ASC ORDER BY s.START_SEQ ASC
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -2,22 +2,22 @@ ...@@ -2,22 +2,22 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pps.core.space.mapper.SpaceOptimizeShortDurationViewMapper"> <mapper namespace="pps.core.space.mapper.SpaceOptimizeShortDurationViewMapper">
<resultMap id="BaseResultMap" type="pps.core.space.entity.SpaceOptimizeShortDurationView"> <resultMap id="BaseResultMap" type="pps.core.space.entity.SpaceOptimizeShortDurationView">
<id column="id" property="id" jdbcType="VARCHAR"/> <id column="ID" property="id" />
<result column="is_deleted" property="isDeleted" jdbcType="INTEGER"/> <result column="IS_DELETED" property="isDeleted" />
<result column="create_by_id" property="createById" jdbcType="VARCHAR"/> <result column="CREATE_BY_ID" property="createById" />
<result column="create_by_name" property="createByName" jdbcType="VARCHAR"/> <result column="CREATE_BY_NAME" property="createByName" />
<result column="create_time" property="createTime" jdbcType="DATE"/> <result column="CREATE_TIME" property="createTime" />
<result column="modify_by_id" property="modifyById" jdbcType="VARCHAR"/> <result column="MODIFY_BY_ID" property="modifyById" />
<result column="modify_by_name" property="modifyByName" jdbcType="VARCHAR"/> <result column="MODIFY_BY_NAME" property="modifyByName" />
<result column="modify_time" property="modifyTime" jdbcType="DATE"/> <result column="MODIFY_TIME" property="modifyTime" />
<result column="record_id" property="recordId" jdbcType="VARCHAR"/> <result column="record_id" property="recordId" />
<result column="short_period_id" property="shortPeriodId" jdbcType="VARCHAR"/> <result column="short_period_id" property="shortPeriodId" />
<result column="wellhead_id" property="wellheadId" jdbcType="VARCHAR"/> <result column="WELLHEAD_ID" property="wellheadId" />
<result column="is_optimize" property="isOptimize" jdbcType="INTEGER"/> <result column="is_optimize" property="isOptimize" />
<result column="generation_type_key" property="generationTypeKey" jdbcType="VARCHAR"/> <result column="generation_type_key" property="generationTypeKey" />
<result column="open_well_time" property="openWellTime" jdbcType="VARCHAR"/> <result column="open_well_time" property="openWellTime" />
<result column="close_well_time" property="closeWellTime" jdbcType="VARCHAR"/> <result column="close_well_time" property="closeWellTime" />
<result column="first_start" property="firstStart" jdbcType="INTEGER"/> <result column="first_start" property="firstStart" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id id
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
modify_time, modify_time,
record_id, record_id,
short_period_id, short_period_id,
wellhead_id, WELLHEAD_ID,
is_optimize, is_optimize,
generation_type_key, generation_type_key,
open_well_time, open_well_time,
...@@ -49,16 +49,16 @@ ...@@ -49,16 +49,16 @@
<select id="selectList" parameterType="pps.core.space.entity.SpaceOptimizeShortDurationView" <select id="selectList" parameterType="pps.core.space.entity.SpaceOptimizeShortDurationView"
resultMap="BaseResultMap"> resultMap="BaseResultMap">
WITH opt_short AS (SELECT wellhead_id, is_optimize, open_well_time, close_well_time, generation_type_key WITH opt_short AS (SELECT WELLHEAD_ID, is_optimize, open_well_time, close_well_time, generation_type_key
FROM SPACE_OPTIMIZE_SHORT_DURATION FROM SPACE_OPTIMIZE_SHORT_DURATION
WHERE is_optimize = 0 WHERE is_optimize = 0
AND short_period_id = #{shortPeriodId}) AND short_period_id = #{shortPeriodId})
SELECT wellhead_id, SELECT WELLHEAD_ID,
is_optimize, is_optimize,
open_well_time, open_well_time,
close_well_time, close_well_time,
IFNULL(generation_type_key, 'gf') AS generation_type_key IFNULL(generation_type_key, 'gf') AS generation_type_key
FROM (SELECT wellhead_id, FROM (SELECT WELLHEAD_ID,
is_optimize, is_optimize,
open_well_time, open_well_time,
close_well_time, close_well_time,
...@@ -66,24 +66,24 @@ ...@@ -66,24 +66,24 @@
FROM SPACE_OPTIMIZE_SHORT_DURATION FROM SPACE_OPTIMIZE_SHORT_DURATION
WHERE is_optimize = 1 WHERE is_optimize = 1
AND short_period_id = #{shortPeriodId} AND short_period_id = #{shortPeriodId}
AND wellhead_id NOT IN (SELECT wellhead_id FROM opt_short) AND WELLHEAD_ID NOT IN (SELECT WELLHEAD_ID FROM opt_short)
UNION ALL UNION ALL
SELECT * SELECT *
FROM opt_short) d FROM opt_short) d
ORDER BY d.wellhead_id, ORDER BY d.WELLHEAD_ID,
d.open_well_time d.open_well_time
</select> </select>
<resultMap id="ExtendsResultMap" type="pps.core.space.entity.SpaceOptimizeShortDurationView" <resultMap id="ExtendsResultMap" type="pps.core.space.entity.SpaceOptimizeShortDurationView"
extends="BaseResultMap"> extends="BaseResultMap">
<result column="ou_id" property="ouId" jdbcType="VARCHAR"/> <result column="OU_ID" property="ouId" />
<result column="ou_name" property="ouName" jdbcType="VARCHAR"/> <result column="OU_NAME" property="ouName" />
<result column="well_number" property="wellNumber" jdbcType="VARCHAR"/> <result column="WELL_NUMBER" property="wellNumber" />
<result column="interval_describe" property="intervalDescribe" jdbcType="VARCHAR"/> <result column="interval_describe" property="intervalDescribe" />
<result column="line_name" property="lineName" jdbcType="VARCHAR"/> <result column="LINE_NAME" property="lineName" />
<result column="service_rating" property="serviceRating" jdbcType="DECIMAL"/> <result column="SERVICE_RATING" property="serviceRating" />
<result column="start_seq" property="startSeq" jdbcType="INTEGER"/> <result column="START_SEQ" property="startSeq" />
<result column="run_duration" property="runDuration" jdbcType="DECIMAL"/> <result column="run_duration" property="runDuration" />
</resultMap> </resultMap>
<select id="selectDailySystemDisplay" resultMap="ExtendsResultMap" <select id="selectDailySystemDisplay" resultMap="ExtendsResultMap"
...@@ -92,15 +92,15 @@ ...@@ -92,15 +92,15 @@
SELECT SELECT
w.ou_id, w.ou_id,
w.ou_name, w.ou_name,
w.well_number, w.WELL_NUMBER,
w.id AS wellhead_id, w.id AS WELLHEAD_ID,
d.open_well_time, d.open_well_time,
i.interval_describe, i.interval_describe,
ROW_NUMBER() OVER ( PARTITION BY w.well_number ORDER BY d.open_well_time ASC ) AS rn ROW_NUMBER() OVER ( PARTITION BY w.WELL_NUMBER ORDER BY d.open_well_time ASC ) AS rn
FROM FROM
BASE_WELLHEAD w BASE_WELLHEAD w
JOIN SPACE_INSTITUTION_WELLHEAD i ON w.id = i.wellhead_id JOIN SPACE_INSTITUTION_WELLHEAD i ON w.id = i.WELLHEAD_ID
JOIN SPACE_OPTIMIZE_SHORT_DURATION d ON d.wellhead_id = i.wellhead_id JOIN SPACE_OPTIMIZE_SHORT_DURATION d ON d.WELLHEAD_ID = i.WELLHEAD_ID
WHERE WHERE
w.is_deleted = 1 w.is_deleted = 1
AND i.is_deleted = 1 AND i.is_deleted = 1
...@@ -124,27 +124,27 @@ ...@@ -124,27 +124,27 @@
rn = 1 rn = 1
ORDER BY ORDER BY
ou_name, ou_name,
well_number WELL_NUMBER
</select> </select>
<select id="selectOptimizationResultList" resultMap="ExtendsResultMap" <select id="selectOptimizationResultList" resultMap="ExtendsResultMap"
parameterType="pps.core.space.entity.SpaceOptimizeShortDurationView"> parameterType="pps.core.space.entity.SpaceOptimizeShortDurationView">
SELECT p.line_id, SELECT p.line_id,
l.line_name, l.LINE_NAME,
s.well_number, s.WELL_NUMBER,
s.wellhead_id, s.WELLHEAD_ID,
w.service_rating, w.SERVICE_RATING,
s.start_seq, s.START_SEQ,
d.open_well_time, d.open_well_time,
d.close_well_time, d.close_well_time,
IFNULL(CASE i.run_type_key WHEN 'CONTINUOUS' THEN 24 ELSE i.run_duration END, 0) AS run_duration IFNULL(CASE i.RUN_TYPE_KEY WHEN 'CONTINUOUS' THEN 24 ELSE i.run_duration END, 0) AS run_duration
FROM SPACE_OPTIMIZE_SHORT_PERIOD p FROM SPACE_OPTIMIZE_SHORT_PERIOD p
JOIN SPACE_OPTIMIZE_SHORT_WELLHEAD s ON p.id = s.short_period_id JOIN SPACE_OPTIMIZE_SHORT_WELLHEAD s ON p.id = s.short_period_id
JOIN SPACE_OPTIMIZE_SHORT_DURATION d ON s.wellhead_id = d.wellhead_id JOIN SPACE_OPTIMIZE_SHORT_DURATION d ON s.WELLHEAD_ID = d.WELLHEAD_ID
AND s.optimize_date = d.optimize_date AND s.optimize_date = d.optimize_date
LEFT JOIN BASE_WELLHEAD w ON s.wellhead_id = w.id LEFT JOIN BASE_WELLHEAD w ON s.WELLHEAD_ID = w.id
LEFT JOIN BASE_POWER_LINE l ON p.line_id = l.id LEFT JOIN BASE_POWER_LINE l ON p.line_id = l.id
LEFT JOIN SPACE_INSTITUTION_WELLHEAD i ON s.wellhead_id = i.wellhead_id LEFT JOIN SPACE_INSTITUTION_WELLHEAD i ON s.WELLHEAD_ID = i.WELLHEAD_ID
WHERE p.optimize_date = #{optimizeDate} WHERE p.optimize_date = #{optimizeDate}
AND d.is_optimize = 0 AND d.is_optimize = 0
AND p.is_deleted = 1 AND p.is_deleted = 1
...@@ -154,7 +154,7 @@ ...@@ -154,7 +154,7 @@
AND l.is_deleted = 1 AND l.is_deleted = 1
AND i.is_deleted = 1 AND i.is_deleted = 1
ORDER BY p.line_id, ORDER BY p.line_id,
s.start_seq, s.START_SEQ,
d.open_well_time d.open_well_time
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -2,18 +2,18 @@ ...@@ -2,18 +2,18 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pps.core.space.mapper.SpaceOptimizeShortPeriodViewMapper"> <mapper namespace="pps.core.space.mapper.SpaceOptimizeShortPeriodViewMapper">
<resultMap id="BaseResultMap" type="pps.core.space.entity.SpaceOptimizeShortPeriodView"> <resultMap id="BaseResultMap" type="pps.core.space.entity.SpaceOptimizeShortPeriodView">
<id column="id" property="id" jdbcType="VARCHAR"/> <id column="ID" property="id" />
<result column="is_deleted" property="isDeleted" jdbcType="INTEGER"/> <result column="IS_DELETED" property="isDeleted" />
<result column="create_by_id" property="createById" jdbcType="VARCHAR"/> <result column="CREATE_BY_ID" property="createById" />
<result column="create_by_name" property="createByName" jdbcType="VARCHAR"/> <result column="CREATE_BY_NAME" property="createByName" />
<result column="create_time" property="createTime" jdbcType="DATE"/> <result column="CREATE_TIME" property="createTime" />
<result column="modify_by_id" property="modifyById" jdbcType="VARCHAR"/> <result column="MODIFY_BY_ID" property="modifyById" />
<result column="modify_by_name" property="modifyByName" jdbcType="VARCHAR"/> <result column="MODIFY_BY_NAME" property="modifyByName" />
<result column="modify_time" property="modifyTime" jdbcType="DATE"/> <result column="MODIFY_TIME" property="modifyTime" />
<result column="line_id" property="lineId" jdbcType="VARCHAR"/> <result column="LINE_ID" property="lineId" />
<result column="institution_id" property="institutionId" jdbcType="VARCHAR"/> <result column="institution_id" property="institutionId" />
<result column="optimize_state" property="optimizeState" jdbcType="INTEGER"/> <result column="optimize_state" property="optimizeState" />
<result column="optimize_date" property="optimizeDate" jdbcType="TIMESTAMP"/> <result column="optimize_date" property="optimizeDate" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id id
...@@ -39,9 +39,9 @@ ...@@ -39,9 +39,9 @@
</select> </select>
<resultMap id="ExtendResultMap" type="pps.core.space.entity.SpaceOptimizeShortPeriodView" extends="BaseResultMap"> <resultMap id="ExtendResultMap" type="pps.core.space.entity.SpaceOptimizeShortPeriodView" extends="BaseResultMap">
<result column="ou_id" property="ouId" jdbcType="VARCHAR"/> <result column="OU_ID" property="ouId" />
<result column="grid_type_key" property="gridTypeKey" jdbcType="VARCHAR"/> <result column="GRID_TYPE_KEY" property="gridTypeKey" />
<result column="institution_name" property="institutionName" jdbcType="VARCHAR"/> <result column="institution_name" property="institutionName" />
</resultMap> </resultMap>
<select id="selectList" parameterType="pps.core.space.entity.SpaceOptimizeShortPeriodView" <select id="selectList" parameterType="pps.core.space.entity.SpaceOptimizeShortPeriodView"
......
...@@ -2,19 +2,19 @@ ...@@ -2,19 +2,19 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pps.core.space.mapper.SpaceOptimizeShortWellheadViewMapper"> <mapper namespace="pps.core.space.mapper.SpaceOptimizeShortWellheadViewMapper">
<resultMap id="BaseResultMap" type="pps.core.space.entity.SpaceOptimizeShortWellheadView"> <resultMap id="BaseResultMap" type="pps.core.space.entity.SpaceOptimizeShortWellheadView">
<id column="id" property="id" jdbcType="VARCHAR"/> <id column="ID" property="id" />
<result column="is_deleted" property="isDeleted" jdbcType="INTEGER"/> <result column="IS_DELETED" property="isDeleted" />
<result column="create_by_id" property="createById" jdbcType="VARCHAR"/> <result column="CREATE_BY_ID" property="createById" />
<result column="create_by_name" property="createByName" jdbcType="VARCHAR"/> <result column="CREATE_BY_NAME" property="createByName" />
<result column="create_time" property="createTime" jdbcType="DATE"/> <result column="CREATE_TIME" property="createTime" />
<result column="modify_by_id" property="modifyById" jdbcType="VARCHAR"/> <result column="MODIFY_BY_ID" property="modifyById" />
<result column="modify_by_name" property="modifyByName" jdbcType="VARCHAR"/> <result column="MODIFY_BY_NAME" property="modifyByName" />
<result column="modify_time" property="modifyTime" jdbcType="DATE"/> <result column="MODIFY_TIME" property="modifyTime" />
<result column="short_period_id" property="shortPeriodId" jdbcType="VARCHAR"/> <result column="short_period_id" property="shortPeriodId" />
<result column="wellhead_id" property="wellheadId" jdbcType="VARCHAR"/> <result column="WELLHEAD_ID" property="wellheadId" />
<result column="well_number" property="wellNumber" jdbcType="VARCHAR"/> <result column="WELL_NUMBER" property="wellNumber" />
<result column="start_seq" property="startSeq" jdbcType="INTEGER"/> <result column="START_SEQ" property="startSeq" />
<result column="frostproof_well" property="frostproofWell" jdbcType="INTEGER"/> <result column="frostproof_well" property="frostproofWell" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id id
...@@ -27,9 +27,9 @@ ...@@ -27,9 +27,9 @@
modify_by_name, modify_by_name,
modify_time, modify_time,
short_period_id, short_period_id,
wellhead_id, WELLHEAD_ID,
well_number, WELL_NUMBER,
start_seq, START_SEQ,
frostproof_well frostproof_well
</sql> </sql>
<select id="selectOne" parameterType="pps.core.space.entity.SpaceOptimizeShortWellheadView" <select id="selectOne" parameterType="pps.core.space.entity.SpaceOptimizeShortWellheadView"
...@@ -50,27 +50,27 @@ ...@@ -50,27 +50,27 @@
</select> </select>
<resultMap id="ExtResultMap" type="pps.core.space.entity.SpaceOptimizeShortWellheadView" extends="BaseResultMap"> <resultMap id="ExtResultMap" type="pps.core.space.entity.SpaceOptimizeShortWellheadView" extends="BaseResultMap">
<result column="run_duration" property="runDuration" jdbcType="DECIMAL"/> <result column="run_duration" property="runDuration" />
</resultMap> </resultMap>
<select id="selectListJoin" parameterType="pps.core.space.entity.SpaceOptimizeShortWellheadView" <select id="selectListJoin" parameterType="pps.core.space.entity.SpaceOptimizeShortWellheadView"
resultMap="BaseResultMap"> resultMap="BaseResultMap">
SELECT s.wellhead_id, SELECT s.WELLHEAD_ID,
s.well_number, s.WELL_NUMBER,
s.start_seq, s.START_SEQ,
s.optimize_date, s.optimize_date,
CASE CASE
w.run_type_key w.RUN_TYPE_KEY
WHEN 'CONTINUOUS' THEN WHEN 'CONTINUOUS' THEN
24 24
ELSE w.run_duration ELSE w.run_duration
END run_duration END run_duration
FROM SPACE_OPTIMIZE_SHORT_WELLHEAD s FROM SPACE_OPTIMIZE_SHORT_WELLHEAD s
LEFT JOIN SPACE_INSTITUTION_WELLHEAD w ON s.wellhead_id = w.wellhead_id LEFT JOIN SPACE_INSTITUTION_WELLHEAD w ON s.WELLHEAD_ID = w.WELLHEAD_ID
WHERE s.is_deleted = 1 WHERE s.is_deleted = 1
AND w.is_deleted = 1 AND w.is_deleted = 1
AND s.short_period_id = #{shortPeriodId} AND s.short_period_id = #{shortPeriodId}
AND s.optimize_date = #{optimizeDate} AND s.optimize_date = #{optimizeDate}
ORDER BY s.start_seq ASC ORDER BY s.START_SEQ ASC
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -2,22 +2,22 @@ ...@@ -2,22 +2,22 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pps.core.space.mapper.SpaceOptimizeUltraDurationViewMapper"> <mapper namespace="pps.core.space.mapper.SpaceOptimizeUltraDurationViewMapper">
<resultMap id="BaseResultMap" type="pps.core.space.entity.SpaceOptimizeUltraDurationView"> <resultMap id="BaseResultMap" type="pps.core.space.entity.SpaceOptimizeUltraDurationView">
<id column="id" property="id" jdbcType="VARCHAR"/> <id column="ID" property="id" />
<result column="is_deleted" property="isDeleted" jdbcType="INTEGER"/> <result column="IS_DELETED" property="isDeleted" />
<result column="create_by_id" property="createById" jdbcType="VARCHAR"/> <result column="CREATE_BY_ID" property="createById" />
<result column="create_by_name" property="createByName" jdbcType="VARCHAR"/> <result column="CREATE_BY_NAME" property="createByName" />
<result column="create_time" property="createTime" jdbcType="DATE"/> <result column="CREATE_TIME" property="createTime" />
<result column="modify_by_id" property="modifyById" jdbcType="VARCHAR"/> <result column="MODIFY_BY_ID" property="modifyById" />
<result column="modify_by_name" property="modifyByName" jdbcType="VARCHAR"/> <result column="MODIFY_BY_NAME" property="modifyByName" />
<result column="modify_time" property="modifyTime" jdbcType="DATE"/> <result column="MODIFY_TIME" property="modifyTime" />
<result column="record_id" property="recordId" jdbcType="VARCHAR"/> <result column="record_id" property="recordId" />
<result column="ultra_period_id" property="ultraPeriodId" jdbcType="VARCHAR"/> <result column="ultra_period_id" property="ultraPeriodId" />
<result column="wellhead_id" property="wellheadId" jdbcType="VARCHAR"/> <result column="WELLHEAD_ID" property="wellheadId" />
<result column="is_optimize" property="isOptimize" jdbcType="INTEGER"/> <result column="is_optimize" property="isOptimize" />
<result column="generation_type_key" property="generationTypeKey" jdbcType="VARCHAR"/> <result column="generation_type_key" property="generationTypeKey" />
<result column="open_well_time" property="openWellTime" jdbcType="VARCHAR"/> <result column="open_well_time" property="openWellTime" />
<result column="close_well_time" property="closeWellTime" jdbcType="VARCHAR"/> <result column="close_well_time" property="closeWellTime" />
<result column="first_start" property="firstStart" jdbcType="INTEGER"/> <result column="first_start" property="firstStart" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id id
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
modify_time, modify_time,
record_id, record_id,
ultra_period_id, ultra_period_id,
wellhead_id, WELLHEAD_ID,
is_optimize, is_optimize,
generation_type_key, generation_type_key,
open_well_time, open_well_time,
......
...@@ -2,19 +2,19 @@ ...@@ -2,19 +2,19 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pps.core.space.mapper.SpaceOptimizeUltraPeriodViewMapper"> <mapper namespace="pps.core.space.mapper.SpaceOptimizeUltraPeriodViewMapper">
<resultMap id="BaseResultMap" type="pps.core.space.entity.SpaceOptimizeUltraPeriodView"> <resultMap id="BaseResultMap" type="pps.core.space.entity.SpaceOptimizeUltraPeriodView">
<id column="id" property="id" jdbcType="VARCHAR"/> <id column="ID" property="id" />
<result column="is_deleted" property="isDeleted" jdbcType="INTEGER"/> <result column="IS_DELETED" property="isDeleted" />
<result column="create_by_id" property="createById" jdbcType="VARCHAR"/> <result column="CREATE_BY_ID" property="createById" />
<result column="create_by_name" property="createByName" jdbcType="VARCHAR"/> <result column="CREATE_BY_NAME" property="createByName" />
<result column="create_time" property="createTime" jdbcType="DATE"/> <result column="CREATE_TIME" property="createTime" />
<result column="modify_by_id" property="modifyById" jdbcType="VARCHAR"/> <result column="MODIFY_BY_ID" property="modifyById" />
<result column="modify_by_name" property="modifyByName" jdbcType="VARCHAR"/> <result column="MODIFY_BY_NAME" property="modifyByName" />
<result column="modify_time" property="modifyTime" jdbcType="DATE"/> <result column="MODIFY_TIME" property="modifyTime" />
<result column="line_id" property="lineId" jdbcType="VARCHAR"/> <result column="LINE_ID" property="lineId" />
<result column="institution_id" property="institutionId" jdbcType="VARCHAR"/> <result column="institution_id" property="institutionId" />
<result column="execution_cycle" property="executionCycle" jdbcType="VARCHAR"/> <result column="execution_cycle" property="executionCycle" />
<result column="optimize_state" property="optimizeState" jdbcType="INTEGER"/> <result column="optimize_state" property="optimizeState" />
<result column="optimize_deadline" property="optimizeDeadline" jdbcType="DATE"/> <result column="optimize_deadline" property="optimizeDeadline" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id id
...@@ -41,9 +41,9 @@ ...@@ -41,9 +41,9 @@
</select> </select>
<resultMap id="ExtendResultMap" type="pps.core.space.entity.SpaceOptimizeUltraPeriodView" extends="BaseResultMap"> <resultMap id="ExtendResultMap" type="pps.core.space.entity.SpaceOptimizeUltraPeriodView" extends="BaseResultMap">
<result column="ou_id" property="ouId" jdbcType="VARCHAR"/> <result column="OU_ID" property="ouId" />
<result column="grid_type_key" property="gridTypeKey" jdbcType="VARCHAR"/> <result column="GRID_TYPE_KEY" property="gridTypeKey" />
<result column="institution_name" property="institutionName" jdbcType="VARCHAR"/> <result column="institution_name" property="institutionName" />
</resultMap> </resultMap>
<select id="selectList" parameterType="pps.core.space.entity.SpaceOptimizeUltraPeriodView" <select id="selectList" parameterType="pps.core.space.entity.SpaceOptimizeUltraPeriodView"
......
...@@ -2,18 +2,18 @@ ...@@ -2,18 +2,18 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pps.core.space.mapper.SpaceOptimizeUltraWellheadViewMapper"> <mapper namespace="pps.core.space.mapper.SpaceOptimizeUltraWellheadViewMapper">
<resultMap id="BaseResultMap" type="pps.core.space.entity.SpaceOptimizeUltraWellheadView"> <resultMap id="BaseResultMap" type="pps.core.space.entity.SpaceOptimizeUltraWellheadView">
<id column="id" property="id" jdbcType="VARCHAR"/> <id column="ID" property="id" />
<result column="is_deleted" property="isDeleted" jdbcType="INTEGER"/> <result column="IS_DELETED" property="isDeleted" />
<result column="create_by_id" property="createById" jdbcType="VARCHAR"/> <result column="CREATE_BY_ID" property="createById" />
<result column="create_by_name" property="createByName" jdbcType="VARCHAR"/> <result column="CREATE_BY_NAME" property="createByName" />
<result column="create_time" property="createTime" jdbcType="DATE"/> <result column="CREATE_TIME" property="createTime" />
<result column="modify_by_id" property="modifyById" jdbcType="VARCHAR"/> <result column="MODIFY_BY_ID" property="modifyById" />
<result column="modify_by_name" property="modifyByName" jdbcType="VARCHAR"/> <result column="MODIFY_BY_NAME" property="modifyByName" />
<result column="modify_time" property="modifyTime" jdbcType="DATE"/> <result column="MODIFY_TIME" property="modifyTime" />
<result column="ultra_period_id" property="ultraPeriodId" jdbcType="VARCHAR"/> <result column="ultra_period_id" property="ultraPeriodId" />
<result column="wellhead_id" property="wellheadId" jdbcType="VARCHAR"/> <result column="WELLHEAD_ID" property="wellheadId" />
<result column="well_number" property="wellNumber" jdbcType="VARCHAR"/> <result column="WELL_NUMBER" property="wellNumber" />
<result column="start_seq" property="startSeq" jdbcType="INTEGER"/> <result column="START_SEQ" property="startSeq" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id id
...@@ -26,9 +26,9 @@ ...@@ -26,9 +26,9 @@
modify_by_name, modify_by_name,
modify_time, modify_time,
ultra_period_id, ultra_period_id,
wellhead_id, WELLHEAD_ID,
well_number, WELL_NUMBER,
start_seq START_SEQ
</sql> </sql>
<select id="selectOne" parameterType="pps.core.space.entity.SpaceOptimizeUltraWellheadView" <select id="selectOne" parameterType="pps.core.space.entity.SpaceOptimizeUltraWellheadView"
resultMap="BaseResultMap"> resultMap="BaseResultMap">
...@@ -48,27 +48,27 @@ ...@@ -48,27 +48,27 @@
</select> </select>
<resultMap id="ExtResultMap" type="pps.core.space.entity.SpaceOptimizeUltraWellheadView" extends="BaseResultMap"> <resultMap id="ExtResultMap" type="pps.core.space.entity.SpaceOptimizeUltraWellheadView" extends="BaseResultMap">
<result column="run_duration" property="runDuration" jdbcType="DECIMAL"/> <result column="run_duration" property="runDuration" />
</resultMap> </resultMap>
<select id="selectListJoin" parameterType="pps.core.space.entity.SpaceOptimizeUltraWellheadView" <select id="selectListJoin" parameterType="pps.core.space.entity.SpaceOptimizeUltraWellheadView"
resultMap="BaseResultMap"> resultMap="BaseResultMap">
SELECT s.wellhead_id, SELECT s.WELLHEAD_ID,
s.well_number, s.WELL_NUMBER,
s.start_seq, s.START_SEQ,
s.optimize_date, s.optimize_date,
CASE CASE
w.run_type_key w.RUN_TYPE_KEY
WHEN 'CONTINUOUS' THEN WHEN 'CONTINUOUS' THEN
24 24
ELSE w.run_duration ELSE w.run_duration
END run_duration END run_duration
FROM SPACE_OPTIMIZE_ULTRA_WELLHEAD s FROM SPACE_OPTIMIZE_ULTRA_WELLHEAD s
LEFT JOIN SPACE_INSTITUTION_WELLHEAD w ON s.wellhead_id = w.wellhead_id LEFT JOIN SPACE_INSTITUTION_WELLHEAD w ON s.WELLHEAD_ID = w.WELLHEAD_ID
WHERE s.is_deleted = 1 WHERE s.is_deleted = 1
AND w.is_deleted = 1 AND w.is_deleted = 1
AND s.ultra_period_id = #{ultraPeriodId} AND s.ultra_period_id = #{ultraPeriodId}
AND s.optimize_date = #{optimizeDate} AND s.optimize_date = #{optimizeDate}
ORDER BY s.start_seq ASC ORDER BY s.START_SEQ ASC
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
<insert id="longWellheadBatchInsertList" parameterType="list"> <insert id="longWellheadBatchInsertList" parameterType="list">
INSERT INTO SPACE_OPTIMIZE_LONG_WELLHEAD ( id, create_by_id, create_by_name, create_time, INSERT INTO SPACE_OPTIMIZE_LONG_WELLHEAD ( id, create_by_id, create_by_name, create_time,
modify_by_id, modify_by_name, modify_time, long_period_id, wellhead_id, well_number, start_seq, optimize_date) modify_by_id, modify_by_name, modify_time, long_period_id, WELLHEAD_ID, WELL_NUMBER, START_SEQ, optimize_date)
VALUES VALUES
<foreach collection="list" item="item" separator=","> <foreach collection="list" item="item" separator=",">
( (
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
modify_time, modify_time,
record_id, record_id,
long_period_id, long_period_id,
wellhead_id, WELLHEAD_ID,
is_optimize, is_optimize,
generation_type_key, generation_type_key,
open_well_time, open_well_time,
...@@ -120,7 +120,7 @@ ...@@ -120,7 +120,7 @@
<insert id="midWellheadBatchInsertList" parameterType="list"> <insert id="midWellheadBatchInsertList" parameterType="list">
INSERT INTO SPACE_OPTIMIZE_MID_WELLHEAD ( id, create_by_id, create_by_name, create_time, INSERT INTO SPACE_OPTIMIZE_MID_WELLHEAD ( id, create_by_id, create_by_name, create_time,
modify_by_id, modify_by_name, modify_time, mid_period_id, wellhead_id, well_number, start_seq, optimize_date) modify_by_id, modify_by_name, modify_time, mid_period_id, WELLHEAD_ID, WELL_NUMBER, START_SEQ, optimize_date)
VALUES VALUES
<foreach collection="list" item="item" separator=","> <foreach collection="list" item="item" separator=",">
( (
...@@ -151,7 +151,7 @@ ...@@ -151,7 +151,7 @@
modify_time, modify_time,
record_id, record_id,
mid_period_id, mid_period_id,
wellhead_id, WELLHEAD_ID,
is_optimize, is_optimize,
generation_type_key, generation_type_key,
open_well_time, open_well_time,
...@@ -211,7 +211,7 @@ ...@@ -211,7 +211,7 @@
<insert id="shortWellheadBatchInsertList" parameterType="list"> <insert id="shortWellheadBatchInsertList" parameterType="list">
INSERT INTO SPACE_OPTIMIZE_SHORT_WELLHEAD (id, create_by_id, create_by_name, create_time, modify_by_id, INSERT INTO SPACE_OPTIMIZE_SHORT_WELLHEAD (id, create_by_id, create_by_name, create_time, modify_by_id,
modify_by_name, modify_time, short_period_id, wellhead_id, well_number, start_seq, modify_by_name, modify_time, short_period_id, WELLHEAD_ID, WELL_NUMBER, START_SEQ,
optimize_date,frostproof_well) optimize_date,frostproof_well)
VALUES VALUES
<foreach collection="list" item="item" separator=","> <foreach collection="list" item="item" separator=",">
...@@ -235,7 +235,7 @@ ...@@ -235,7 +235,7 @@
<insert id="shortDurationBatchInsertList" parameterType="list"> <insert id="shortDurationBatchInsertList" parameterType="list">
INSERT INTO SPACE_OPTIMIZE_SHORT_DURATION (id, create_by_id, create_by_name, create_time, INSERT INTO SPACE_OPTIMIZE_SHORT_DURATION (id, create_by_id, create_by_name, create_time,
modify_by_id, modify_by_name, modify_time, record_id, short_period_id, wellhead_id, is_optimize, modify_by_id, modify_by_name, modify_time, record_id, short_period_id, WELLHEAD_ID, is_optimize,
generation_type_key, open_well_time, close_well_time, first_start, optimize_date) generation_type_key, open_well_time, close_well_time, first_start, optimize_date)
VALUES VALUES
<foreach collection="list" item="item" separator=","> <foreach collection="list" item="item" separator=",">
...@@ -292,7 +292,7 @@ ...@@ -292,7 +292,7 @@
<insert id="ultraWellheadBatchInsertList" parameterType="list"> <insert id="ultraWellheadBatchInsertList" parameterType="list">
INSERT INTO SPACE_OPTIMIZE_ULTRA_WELLHEAD ( id, create_by_id, create_by_name, create_time, INSERT INTO SPACE_OPTIMIZE_ULTRA_WELLHEAD ( id, create_by_id, create_by_name, create_time,
modify_by_id, modify_by_name, modify_time, ultra_period_id, wellhead_id, well_number, start_seq, optimize_date) modify_by_id, modify_by_name, modify_time, ultra_period_id, WELLHEAD_ID, WELL_NUMBER, START_SEQ, optimize_date)
VALUES VALUES
<foreach collection="list" item="item" separator=","> <foreach collection="list" item="item" separator=",">
( (
...@@ -323,7 +323,7 @@ ...@@ -323,7 +323,7 @@
modify_time, modify_time,
record_id, record_id,
ultra_period_id, ultra_period_id,
wellhead_id, WELLHEAD_ID,
is_optimize, is_optimize,
generation_type_key, generation_type_key,
open_well_time, open_well_time,
......
...@@ -2,25 +2,25 @@ ...@@ -2,25 +2,25 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pps.core.space.mapper.WellDailyElectricityTrendViewMapper"> <mapper namespace="pps.core.space.mapper.WellDailyElectricityTrendViewMapper">
<resultMap id="BaseResultMap" type="pps.core.space.entity.WellDailyElectricityTrendView"> <resultMap id="BaseResultMap" type="pps.core.space.entity.WellDailyElectricityTrendView">
<id column="id" property="id" jdbcType="BIGINT"/> <id column="ID" property="id" />
<result column="well_number" property="wellNumber" jdbcType="VARCHAR"/> <result column="WELL_NUMBER" property="wellNumber" />
<result column="space_run_duration" property="spaceRunDuration" jdbcType="DECIMAL"/> <result column="space_run_duration" property="spaceRunDuration" />
<result column="daily_open_hour" property="dailyOpenHour" jdbcType="DECIMAL"/> <result column="daily_open_hour" property="dailyOpenHour" />
<result column="daily_green_open_hour" property="dailyGreenOpenHour" jdbcType="DECIMAL"/> <result column="daily_green_open_hour" property="dailyGreenOpenHour" />
<result column="daily_green_consumption" property="dailyGreenConsumption" jdbcType="DECIMAL"/> <result column="daily_green_consumption" property="dailyGreenConsumption" />
<result column="daily_electricity_consumption" property="dailyElectricityConsumption" jdbcType="DECIMAL"/> <result column="daily_electricity_consumption" property="dailyElectricityConsumption" />
<result column="daily_liquid_production" property="dailyLiquidProduction" jdbcType="DECIMAL"/> <result column="daily_liquid_production" property="dailyLiquidProduction" />
<result column="daily_carbon_reduction" property="dailyCarbonReduction" jdbcType="DECIMAL"/> <result column="daily_carbon_reduction" property="dailyCarbonReduction" />
<result column="green_electricity_rate" property="greenElectricityRate" jdbcType="DECIMAL"/> <result column="green_electricity_rate" property="greenElectricityRate" />
<result column="valley_electric_open_hour" property="valleyElectricOpenHour" jdbcType="DECIMAL"/> <result column="valley_electric_open_hour" property="valleyElectricOpenHour" />
<result column="valley_electric_rate" property="valleyElectricRate" jdbcType="DECIMAL"/> <result column="valley_electric_rate" property="valleyElectricRate" />
<result column="create_date" property="createDate" jdbcType="DATE"/> <result column="create_date" property="createDate" />
<result column="system_source" property="systemSource" jdbcType="VARCHAR"/> <result column="SYSTEM_SOURCE" property="systemSource" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id id
, ,
well_number, WELL_NUMBER,
space_run_duration, space_run_duration,
daily_open_hour, daily_open_hour,
daily_green_open_hour, daily_green_open_hour,
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
valley_electric_open_hour, valley_electric_open_hour,
valley_electric_rate, valley_electric_rate,
create_date, create_date,
system_source SYSTEM_SOURCE
</sql> </sql>
<select id="selectOne" parameterType="pps.core.space.entity.WellDailyElectricityTrendView" <select id="selectOne" parameterType="pps.core.space.entity.WellDailyElectricityTrendView"
resultMap="BaseResultMap"> resultMap="BaseResultMap">
...@@ -52,10 +52,10 @@ ...@@ -52,10 +52,10 @@
</select> </select>
<insert id="batchInsert" parameterType="list"> <insert id="batchInsert" parameterType="list">
INSERT INTO WELL_DAILY_ELECTRICITY_TREND (well_number, space_run_duration, daily_open_hour, INSERT INTO WELL_DAILY_ELECTRICITY_TREND (WELL_NUMBER, space_run_duration, daily_open_hour,
daily_green_open_hour, daily_green_consumption, daily_electricity_consumption, daily_liquid_production, daily_green_open_hour, daily_green_consumption, daily_electricity_consumption, daily_liquid_production,
daily_carbon_reduction, green_electricity_rate, valley_electric_open_hour, valley_electric_rate, create_date, daily_carbon_reduction, green_electricity_rate, valley_electric_open_hour, valley_electric_rate, create_date,
system_source) VALUES SYSTEM_SOURCE) VALUES
<foreach collection="list" item="item" separator=","> <foreach collection="list" item="item" separator=",">
( (
#{item.wellNumber}, #{item.wellNumber},
...@@ -76,14 +76,14 @@ ...@@ -76,14 +76,14 @@
</insert> </insert>
<resultMap id="ExtResultMap" type="pps.core.space.entity.WellDailyElectricityTrendView" extends="BaseResultMap"> <resultMap id="ExtResultMap" type="pps.core.space.entity.WellDailyElectricityTrendView" extends="BaseResultMap">
<result column="month_daily_green_open_hour" property="monthDailyGreenOpenHour" jdbcType="DECIMAL"/> <result column="month_daily_green_open_hour" property="monthDailyGreenOpenHour" />
<result column="month_space_run_duration" property="monthSpaceRunDuration" jdbcType="DECIMAL"/> <result column="month_space_run_duration" property="monthSpaceRunDuration" />
<result column="month_daily_green_consumption" property="monthDailyGreenConsumption" jdbcType="DECIMAL"/> <result column="month_daily_green_consumption" property="monthDailyGreenConsumption" />
<result column="month_valley_electric_open_hour" property="monthValleyElectricOpenHour" jdbcType="DECIMAL"/> <result column="month_valley_electric_open_hour" property="monthValleyElectricOpenHour" />
<result column="year_daily_green_open_hour" property="yearDailyGreenOpenHour" jdbcType="DECIMAL"/> <result column="year_daily_green_open_hour" property="yearDailyGreenOpenHour" />
<result column="year_space_run_duration" property="yearSpaceRunDuration" jdbcType="DECIMAL"/> <result column="year_space_run_duration" property="yearSpaceRunDuration" />
<result column="year_daily_green_consumption" property="yearDailyGreenConsumption" jdbcType="DECIMAL"/> <result column="year_daily_green_consumption" property="yearDailyGreenConsumption" />
<result column="year_valley_electric_open_hour" property="yearValleyElectricOpenHour" jdbcType="DECIMAL"/> <result column="year_valley_electric_open_hour" property="yearValleyElectricOpenHour" />
</resultMap> </resultMap>
<select id="selectWellheadAnalysisPage" parameterType="pps.core.space.entity.WellDailyElectricityTrendView" <select id="selectWellheadAnalysisPage" parameterType="pps.core.space.entity.WellDailyElectricityTrendView"
...@@ -92,7 +92,7 @@ ...@@ -92,7 +92,7 @@
z.* z.*
FROM FROM
( (
SELECT t.well_number, SELECT t.WELL_NUMBER,
t.space_run_duration, t.space_run_duration,
t.daily_liquid_production, t.daily_liquid_production,
t.green_electricity_rate, t.green_electricity_rate,
...@@ -107,7 +107,7 @@ ...@@ -107,7 +107,7 @@
y.year_daily_green_consumption, y.year_daily_green_consumption,
y.year_valley_electric_open_hour y.year_valley_electric_open_hour
FROM WELL_DAILY_ELECTRICITY_TREND t FROM WELL_DAILY_ELECTRICITY_TREND t
LEFT JOIN (SELECT well_number, LEFT JOIN (SELECT WELL_NUMBER,
SUM(daily_green_open_hour) AS month_daily_green_open_hour, SUM(daily_green_open_hour) AS month_daily_green_open_hour,
SUM(space_run_duration) AS month_space_run_duration, SUM(space_run_duration) AS month_space_run_duration,
SUM(daily_green_consumption) AS month_daily_green_consumption, SUM(daily_green_consumption) AS month_daily_green_consumption,
...@@ -115,13 +115,13 @@ ...@@ -115,13 +115,13 @@
FROM WELL_DAILY_ELECTRICITY_TREND FROM WELL_DAILY_ELECTRICITY_TREND
WHERE WHERE
MONTH ( create_date ) = #{month} MONTH ( create_date ) = #{month}
AND well_number IN AND WELL_NUMBER IN
<foreach collection="wellNumberList" open="(" close=")" separator="," item="item"> <foreach collection="wellNumberList" open="(" close=")" separator="," item="item">
#{item} #{item}
</foreach> </foreach>
GROUP BY GROUP BY
well_number) m ON t.well_number = m.well_number WELL_NUMBER) m ON t.WELL_NUMBER = m.WELL_NUMBER
LEFT JOIN (SELECT well_number, LEFT JOIN (SELECT WELL_NUMBER,
SUM(daily_green_open_hour) AS year_daily_green_open_hour, SUM(daily_green_open_hour) AS year_daily_green_open_hour,
SUM(space_run_duration) AS year_space_run_duration, SUM(space_run_duration) AS year_space_run_duration,
SUM(daily_green_consumption) AS year_daily_green_consumption, SUM(daily_green_consumption) AS year_daily_green_consumption,
...@@ -129,24 +129,24 @@ ...@@ -129,24 +129,24 @@
FROM WELL_DAILY_ELECTRICITY_TREND FROM WELL_DAILY_ELECTRICITY_TREND
WHERE WHERE
YEAR ( create_date ) = #{year} YEAR ( create_date ) = #{year}
AND well_number IN AND WELL_NUMBER IN
<foreach collection="wellNumberList" open="(" close=")" separator="," item="item"> <foreach collection="wellNumberList" open="(" close=")" separator="," item="item">
#{item} #{item}
</foreach> </foreach>
GROUP BY GROUP BY
well_number) y ON t.well_number = y.well_number WELL_NUMBER) y ON t.WELL_NUMBER = y.WELL_NUMBER
WHERE t.create_date = #{createDate} WHERE t.create_date = #{createDate}
AND t.well_number IN AND t.WELL_NUMBER IN
<foreach collection="wellNumberList" open="(" close=")" separator="," item="item"> <foreach collection="wellNumberList" open="(" close=")" separator="," item="item">
#{item} #{item}
</foreach> </foreach>
) z ) z
<where> <where>
<if test="wellNumber != null and wellNumber != ''"> <if test="wellNumber != null and wellNumber != ''">
AND z.well_number LIKE concat('%',#{wellNumber},'%') AND z.WELL_NUMBER LIKE concat('%',#{wellNumber},'%')
</if> </if>
</where> </where>
ORDER BY ORDER BY
z.well_number z.WELL_NUMBER
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -2,19 +2,19 @@ ...@@ -2,19 +2,19 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pps.core.prediction.mapper.BaseDataViewMapper"> <mapper namespace="pps.core.prediction.mapper.BaseDataViewMapper">
<resultMap id="BaseResultMap" type="pps.core.prediction.entity.BaseDataView"> <resultMap id="BaseResultMap" type="pps.core.prediction.entity.BaseDataView">
<id column="id" property="id" jdbcType="INTEGER"/> <id column="ID" property="id" />
<result column="ou_id" property="ouId" jdbcType="VARCHAR"/> <result column="OU_ID" property="ouId" />
<result column="line_id" property="lineId" jdbcType="INTEGER"/> <result column="LINE_ID" property="lineId" />
<result column="data_date" property="dataDate" jdbcType="DATE"/> <result column="DATA_DATE" property="dataDate" />
<result column="wind_speed" property="windSpeed" jdbcType="DECIMAL"/> <result column="WIND_SPEED" property="windSpeed" />
<result column="wind_direction" property="windDirection" jdbcType="DECIMAL"/> <result column="WIND_DIRECTION" property="windDirection" />
<result column="temperature" property="temperature" jdbcType="DECIMAL"/> <result column="TEMPERATURE" property="temperature" />
<result column="pressure" property="pressure" jdbcType="DECIMAL"/> <result column="PRESSURE" property="pressure" />
<result column="humidity" property="humidity" jdbcType="DECIMAL"/> <result column="HUMIDITY" property="humidity" />
<result column="plane_Irradiance" property="planeIrradiance" jdbcType="DECIMAL"/> <result column="PLANE_IRRADIANCE" property="planeIrradiance" />
<result column="horizontal_Irradiance" property="horizontalIrradiance" jdbcType="DECIMAL"/> <result column="HORIZONTAL_IRRADIANCE" property="horizontalIrradiance" />
<result column="power" property="power" jdbcType="DECIMAL"/> <result column="POWER" property="power" />
<result column="predicted_power" property="predictedPower" jdbcType="DECIMAL"/> <result column="PREDICTED_POWER" property="predictedPower" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id id
......
...@@ -2,23 +2,23 @@ ...@@ -2,23 +2,23 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pps.core.prediction.mapper.EnergyConsumptionAnalysisViewMapper"> <mapper namespace="pps.core.prediction.mapper.EnergyConsumptionAnalysisViewMapper">
<resultMap id="BaseResultMap" type="pps.core.prediction.entity.EnergyConsumptionAnalysisView"> <resultMap id="BaseResultMap" type="pps.core.prediction.entity.EnergyConsumptionAnalysisView">
<id column="id" property="id" jdbcType="BIGINT"/> <id column="ID" property="id" />
<result column="station_name" property="stationName" jdbcType="VARCHAR"/> <result column="STATION_NAME" property="stationName" />
<result column="line_id" property="lineId" jdbcType="VARCHAR"/> <result column="LINE_ID" property="lineId" />
<result column="power_generation" property="powerGeneration" jdbcType="DECIMAL"/> <result column="power_generation" property="powerGeneration" />
<result column="power_consumption" property="powerConsumption" jdbcType="DECIMAL"/> <result column="power_consumption" property="powerConsumption" />
<result column="data_date" property="dataDate" jdbcType="DATE"/> <result column="DATA_DATE" property="dataDate" />
<result column="system_source" property="systemSource" jdbcType="VARCHAR"/> <result column="SYSTEM_SOURCE" property="systemSource" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id id
, ,
station_name, STATION_NAME,
line_id, line_id,
power_generation, power_generation,
power_consumption, power_consumption,
data_date, data_date,
system_source SYSTEM_SOURCE
</sql> </sql>
<select id="selectOne" parameterType="pps.core.prediction.entity.EnergyConsumptionAnalysisView" <select id="selectOne" parameterType="pps.core.prediction.entity.EnergyConsumptionAnalysisView"
resultMap="BaseResultMap"> resultMap="BaseResultMap">
...@@ -38,8 +38,8 @@ ...@@ -38,8 +38,8 @@
</select> </select>
<insert id="batchInsertList" parameterType="list"> <insert id="batchInsertList" parameterType="list">
INSERT INTO ENERGY_CONSUMPTION_ANALYSIS ( line_id, station_name, power_generation, power_consumption, INSERT INTO ENERGY_CONSUMPTION_ANALYSIS ( line_id, STATION_NAME, power_generation, power_consumption,
data_date, system_source ) data_date, SYSTEM_SOURCE )
VALUES VALUES
<foreach collection="list" item="item" separator=","> <foreach collection="list" item="item" separator=",">
( (
......
...@@ -2,15 +2,15 @@ ...@@ -2,15 +2,15 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pps.core.prediction.mapper.PhotovoltaicElectricityConsumptionViewMapper"> <mapper namespace="pps.core.prediction.mapper.PhotovoltaicElectricityConsumptionViewMapper">
<resultMap id="BaseResultMap" type="pps.core.prediction.entity.PhotovoltaicElectricityConsumptionView"> <resultMap id="BaseResultMap" type="pps.core.prediction.entity.PhotovoltaicElectricityConsumptionView">
<id column="id" property="id" jdbcType="BIGINT"/> <id column="ID" property="id" />
<result column="ou_id" property="ouId" jdbcType="VARCHAR"/> <result column="OU_ID" property="ouId" />
<result column="ou_name" property="ouName" jdbcType="VARCHAR"/> <result column="OU_NAME" property="ouName" />
<result column="total_electricity" property="totalElectricity" jdbcType="DECIMAL"/> <result column="total_electricity" property="totalElectricity" />
<result column="city_electricity" property="cityElectricity" jdbcType="DECIMAL"/> <result column="city_electricity" property="cityElectricity" />
<result column="city_electricity_scale" property="cityElectricityScale" jdbcType="DECIMAL"/> <result column="city_electricity_scale" property="cityElectricityScale" />
<result column="green_electricity" property="greenElectricity" jdbcType="DECIMAL"/> <result column="green_electricity" property="greenElectricity" />
<result column="green_electricity_scale" property="greenElectricityScale" jdbcType="DECIMAL"/> <result column="green_electricity_scale" property="greenElectricityScale" />
<result column="data_date" property="dataDate" jdbcType="DATE"/> <result column="DATA_DATE" property="dataDate" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id id
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<mapper namespace="pps.core.prediction.mapper.PlantPowerDataViewMapper"> <mapper namespace="pps.core.prediction.mapper.PlantPowerDataViewMapper">
<insert id="insertBatch" parameterType="java.util.List"> <insert id="insertBatch" parameterType="java.util.List">
INSERT INTO PLANT_POWER_DATA INSERT INTO PLANT_POWER_DATA
(plant_id, (PLANT_ID,
data_date, data_date,
temperature, temperature,
humidity, humidity,
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<mapper namespace="pps.core.prediction.mapper.PlantPredictedPowerLongTermDataViewMapper"> <mapper namespace="pps.core.prediction.mapper.PlantPredictedPowerLongTermDataViewMapper">
<insert id="insertBatch" parameterType="java.util.List"> <insert id="insertBatch" parameterType="java.util.List">
INSERT INTO PLANT_PREDICTED_POWER_LONG_TERM_DATA INSERT INTO PLANT_PREDICTED_POWER_LONG_TERM_DATA
(plant_id, (PLANT_ID,
data_date, data_date,
year_time, year_time,
month_time, month_time,
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pps.core.prediction.mapper.PredictedPowerViewMapper"> <mapper namespace="pps.core.prediction.mapper.PredictedPowerViewMapper">
<resultMap id="BaseResultMap" type="pps.core.prediction.entity.PredictedPowerView"> <resultMap id="BaseResultMap" type="pps.core.prediction.entity.PredictedPowerView">
<result column="power" property="power" jdbcType="DECIMAL"/> <result column="POWER" property="power" />
<result column="create_time" property="createTime" jdbcType="VARCHAR"/> <result column="CREATE_TIME" property="createTime" />
<result column="hour_time" property="hourTime" jdbcType="VARCHAR"/> <result column="hour_time" property="hourTime" />
</resultMap> </resultMap>
<select id="selectMidPowerList" resultMap="BaseResultMap"> <select id="selectMidPowerList" resultMap="BaseResultMap">
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
FROM FROM
PLANT_PREDICTED_POWER_MID_TERM PLANT_PREDICTED_POWER_MID_TERM
WHERE WHERE
plant_id IN PLANT_ID IN
<foreach collection="plantIds" item="item" open="(" separator="," close=")"> <foreach collection="plantIds" item="item" open="(" separator="," close=")">
#{item} #{item}
</foreach> </foreach>
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
FROM FROM
PLANT_PREDICTED_POWER_SHORT_TERM PLANT_PREDICTED_POWER_SHORT_TERM
WHERE WHERE
plant_id IN PLANT_ID IN
<foreach collection="plantIds" item="item" open="(" separator="," close=")"> <foreach collection="plantIds" item="item" open="(" separator="," close=")">
#{item} #{item}
</foreach> </foreach>
...@@ -95,7 +95,7 @@ ...@@ -95,7 +95,7 @@
FROM FROM
PLANT_PREDICTED_POWER_MID_TERM PLANT_PREDICTED_POWER_MID_TERM
WHERE WHERE
plant_id IN PLANT_ID IN
<foreach collection="plantIds" item="item" open="(" separator="," close=")"> <foreach collection="plantIds" item="item" open="(" separator="," close=")">
#{item} #{item}
</foreach> </foreach>
...@@ -125,7 +125,7 @@ ...@@ -125,7 +125,7 @@
PLANT_PREDICTED_POWER_SHORT_TERM PLANT_PREDICTED_POWER_SHORT_TERM
<where> <where>
<if test="plantIds != null and plantIds.size() > 0"> <if test="plantIds != null and plantIds.size() > 0">
AND plant_id IN AND PLANT_ID IN
<foreach collection="plantIds" item="item" open="(" separator="," close=")"> <foreach collection="plantIds" item="item" open="(" separator="," close=")">
#{item} #{item}
</foreach> </foreach>
...@@ -140,7 +140,7 @@ ...@@ -140,7 +140,7 @@
AND DATE( data_date ) = #{createTime} AND DATE( data_date ) = #{createTime}
</if> </if>
<if test="plantId != null"> <if test="plantId != null">
AND plant_id = #{plantId} AND PLANT_ID = #{plantId}
</if> </if>
</where> </where>
) a ) a
...@@ -179,7 +179,7 @@ ...@@ -179,7 +179,7 @@
FROM FROM
PLANT_PREDICTED_POWER_MID_TERM PLANT_PREDICTED_POWER_MID_TERM
WHERE WHERE
plant_id IN PLANT_ID IN
<foreach collection="plantIds" item="item" open="(" separator="," close=")"> <foreach collection="plantIds" item="item" open="(" separator="," close=")">
#{item} #{item}
</foreach> </foreach>
...@@ -223,7 +223,7 @@ ...@@ -223,7 +223,7 @@
FROM FROM
PLANT_PREDICTED_POWER_SHORT_TERM PLANT_PREDICTED_POWER_SHORT_TERM
WHERE WHERE
plant_id IN PLANT_ID IN
<foreach collection="plantIds" item="item" open="(" separator="," close=")"> <foreach collection="plantIds" item="item" open="(" separator="," close=")">
#{item} #{item}
</foreach> </foreach>
......
...@@ -2,33 +2,33 @@ ...@@ -2,33 +2,33 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pps.core.prediction.mapper.StationDailyProductionSituationViewMapper"> <mapper namespace="pps.core.prediction.mapper.StationDailyProductionSituationViewMapper">
<resultMap id="BaseResultMap" type="pps.core.prediction.entity.StationDailyProductionSituationView"> <resultMap id="BaseResultMap" type="pps.core.prediction.entity.StationDailyProductionSituationView">
<id column="id" property="id" jdbcType="BIGINT"/> <id column="ID" property="id" />
<result column="station_name" property="stationName" jdbcType="VARCHAR"/> <result column="STATION_NAME" property="stationName" />
<result column="station_id" property="stationId" jdbcType="VARCHAR"/> <result column="STATION_ID" property="stationId" />
<result column="data_date" property="dataDate" jdbcType="DATE"/> <result column="DATA_DATE" property="dataDate" />
<result column="production_time" property="productionTime" jdbcType="DECIMAL"/> <result column="production_time" property="productionTime" />
<result column="daily_electricity_consumption" property="dailyElectricityConsumption" jdbcType="DECIMAL"/> <result column="daily_electricity_consumption" property="dailyElectricityConsumption" />
<result column="daily_liquid_production" property="dailyLiquidProduction" jdbcType="DECIMAL"/> <result column="daily_liquid_production" property="dailyLiquidProduction" />
<result column="daily_utility_electricity_consumption" property="dailyUtilityElectricityConsumption" <result column="daily_utility_electricity_consumption" property="dailyUtilityElectricityConsumption"
jdbcType="DECIMAL"/> />
<result column="electricity_consumption_ph" property="electricityConsumptionPh" jdbcType="DECIMAL"/> <result column="electricity_consumption_ph" property="electricityConsumptionPh" />
<result column="electricity_consumption_hh" property="electricityConsumptionHh" jdbcType="DECIMAL"/> <result column="electricity_consumption_hh" property="electricityConsumptionHh" />
<result column="electricity_consumption_np" property="electricityConsumptionNp" jdbcType="DECIMAL"/> <result column="electricity_consumption_np" property="electricityConsumptionNp" />
<result column="electricity_consumption_vh" property="electricityConsumptionVh" jdbcType="DECIMAL"/> <result column="electricity_consumption_vh" property="electricityConsumptionVh" />
<result column="electricity_charge_city" property="electricityChargeCity" jdbcType="DECIMAL"/> <result column="electricity_charge_city" property="electricityChargeCity" />
<result column="electricity_charges_ph" property="electricityChargesPh" jdbcType="DECIMAL"/> <result column="electricity_charges_ph" property="electricityChargesPh" />
<result column="peak_hour_tariff" property="peakHourTariff" jdbcType="DECIMAL"/> <result column="peak_hour_tariff" property="peakHourTariff" />
<result column="normal_period_tariff" property="normalPeriodTariff" jdbcType="DECIMAL"/> <result column="normal_period_tariff" property="normalPeriodTariff" />
<result column="alley_hours_tariff" property="alleyHoursTariff" jdbcType="DECIMAL"/> <result column="alley_hours_tariff" property="alleyHoursTariff" />
<result column="photovoltaic_power" property="photovoltaicPower" jdbcType="DECIMAL"/> <result column="photovoltaic_power" property="photovoltaicPower" />
<result column="system_source" property="systemSource" jdbcType="VARCHAR"/> <result column="SYSTEM_SOURCE" property="systemSource" />
<result column="create_date" property="createDate" jdbcType="VARCHAR"/> <result column="create_date" property="createDate" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id id
, ,
station_name, STATION_NAME,
station_id, STATION_ID,
data_date, data_date,
production_time, production_time,
daily_electricity_consumption, daily_electricity_consumption,
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
normal_period_tariff, normal_period_tariff,
alley_hours_tariff, alley_hours_tariff,
photovoltaic_power, photovoltaic_power,
system_source, SYSTEM_SOURCE,
create_date create_date
</sql> </sql>
<select id="selectOne" parameterType="pps.core.prediction.entity.StationDailyProductionSituationView" <select id="selectOne" parameterType="pps.core.prediction.entity.StationDailyProductionSituationView"
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
</select> </select>
<insert id="batchInsert" parameterType="list"> <insert id="batchInsert" parameterType="list">
INSERT INTO STATION_DAILY_PRODUCTION_SITUATION ( INSERT INTO STATION_DAILY_PRODUCTION_SITUATION (
station_name, STATION_NAME,
data_date, data_date,
production_time, production_time,
daily_electricity_consumption, daily_electricity_consumption,
...@@ -81,7 +81,7 @@ ...@@ -81,7 +81,7 @@
normal_period_tariff, normal_period_tariff,
alley_hours_tariff, alley_hours_tariff,
photovoltaic_power, photovoltaic_power,
system_source, SYSTEM_SOURCE,
create_date create_date
) VALUES ) VALUES
<foreach collection="list" item="item" separator=","> <foreach collection="list" item="item" separator=",">
...@@ -110,15 +110,15 @@ ...@@ -110,15 +110,15 @@
<resultMap id="ExtResultMap" type="pps.core.prediction.entity.StationDailyProductionSituationView" <resultMap id="ExtResultMap" type="pps.core.prediction.entity.StationDailyProductionSituationView"
extends="BaseResultMap"> extends="BaseResultMap">
<result column="month_photovoltaic_power" property="monthPhotovoltaicPower" jdbcType="DECIMAL"/> <result column="month_photovoltaic_power" property="monthPhotovoltaicPower" />
<result column="year_photovoltaic_power" property="yearPhotovoltaicPower" jdbcType="DECIMAL"/> <result column="year_photovoltaic_power" property="yearPhotovoltaicPower" />
</resultMap> </resultMap>
<select id="selectStationAnalysisList" <select id="selectStationAnalysisList"
parameterType="pps.core.prediction.entity.StationDailyProductionSituationView" parameterType="pps.core.prediction.entity.StationDailyProductionSituationView"
resultMap="ExtResultMap"> resultMap="ExtResultMap">
SELECT SELECT
d.station_name, d.STATION_NAME,
d.production_time, d.production_time,
d.daily_liquid_production, d.daily_liquid_production,
d.daily_electricity_consumption, d.daily_electricity_consumption,
...@@ -128,7 +128,7 @@ ...@@ -128,7 +128,7 @@
FROM FROM
( (
SELECT SELECT
station_name, STATION_NAME,
IFNULL( ROUND( AVG( production_time ), 2 ), 0 ) AS production_time, IFNULL( ROUND( AVG( production_time ), 2 ), 0 ) AS production_time,
IFNULL( ROUND( AVG( daily_liquid_production ), 2 ), 0 ) AS daily_liquid_production, IFNULL( ROUND( AVG( daily_liquid_production ), 2 ), 0 ) AS daily_liquid_production,
IFNULL( ROUND( AVG( daily_electricity_consumption ), 2 ), 0 ) AS daily_electricity_consumption, IFNULL( ROUND( AVG( daily_electricity_consumption ), 2 ), 0 ) AS daily_electricity_consumption,
...@@ -136,33 +136,33 @@ ...@@ -136,33 +136,33 @@
FROM FROM
STATION_DAILY_PRODUCTION_SITUATION WHERE STATION_DAILY_PRODUCTION_SITUATION WHERE
data_date BETWEEN #{beginTime} AND #{endTime} data_date BETWEEN #{beginTime} AND #{endTime}
AND station_name IN AND STATION_NAME IN
<foreach collection="stationNameList" open="(" close=")" separator="," item="item"> <foreach collection="stationNameList" open="(" close=")" separator="," item="item">
#{item} #{item}
</foreach> </foreach>
GROUP BY GROUP BY
station_name STATION_NAME
) d ) d
LEFT JOIN ( SELECT IFNULL( SUM( photovoltaic_power ), 0 ) AS month_photovoltaic_power, station_name FROM LEFT JOIN ( SELECT IFNULL( SUM( photovoltaic_power ), 0 ) AS month_photovoltaic_power, STATION_NAME FROM
STATION_DAILY_PRODUCTION_SITUATION WHERE MONTH ( data_date ) = #{month} STATION_DAILY_PRODUCTION_SITUATION WHERE MONTH ( data_date ) = #{month}
AND station_name IN AND STATION_NAME IN
<foreach collection="stationNameList" open="(" close=")" separator="," item="item"> <foreach collection="stationNameList" open="(" close=")" separator="," item="item">
#{item} #{item}
</foreach> </foreach>
GROUP BY station_name ) m ON d.station_name = m.station_name GROUP BY STATION_NAME ) m ON d.STATION_NAME = m.STATION_NAME
LEFT JOIN ( SELECT IFNULL( SUM( photovoltaic_power ), 0 ) AS year_photovoltaic_power, station_name FROM LEFT JOIN ( SELECT IFNULL( SUM( photovoltaic_power ), 0 ) AS year_photovoltaic_power, STATION_NAME FROM
STATION_DAILY_PRODUCTION_SITUATION WHERE YEAR ( data_date ) = #{year} STATION_DAILY_PRODUCTION_SITUATION WHERE YEAR ( data_date ) = #{year}
AND station_name IN AND STATION_NAME IN
<foreach collection="stationNameList" open="(" close=")" separator="," item="item"> <foreach collection="stationNameList" open="(" close=")" separator="," item="item">
#{item} #{item}
</foreach> </foreach>
GROUP BY station_name ) y ON GROUP BY STATION_NAME ) y ON
d.station_name = y.station_name d.STATION_NAME = y.STATION_NAME
<where> <where>
<if test="stationName != null and stationName !=''"> <if test="stationName != null and stationName !=''">
AND d.station_name LIKE CONCAT( '%', #{stationName}, '%' ) AND d.STATION_NAME LIKE CONCAT( '%', #{stationName}, '%' )
</if> </if>
</where> </where>
ORDER BY d.station_name ORDER BY d.STATION_NAME
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -2,21 +2,21 @@ ...@@ -2,21 +2,21 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pps.core.prediction.mapper.StoragePredictedPowerDataViewMapper"> <mapper namespace="pps.core.prediction.mapper.StoragePredictedPowerDataViewMapper">
<resultMap id="BaseResultMap" type="pps.core.prediction.entity.StoragePredictedPowerDataView"> <resultMap id="BaseResultMap" type="pps.core.prediction.entity.StoragePredictedPowerDataView">
<id column="id" property="id" jdbcType="INTEGER"/> <id column="ID" property="id" />
<result column="storage_id" property="storageId" jdbcType="VARCHAR"/> <result column="STORAGE_ID" property="storageId" />
<result column="data_date" property="dataDate" jdbcType="VARCHAR"/> <result column="DATA_DATE" property="dataDate" />
<result column="year_time" property="yearTime" jdbcType="VARCHAR"/> <result column="year_time" property="yearTime" />
<result column="month_time" property="monthTime" jdbcType="VARCHAR"/> <result column="month_time" property="monthTime" />
<result column="day_time" property="dayTime" jdbcType="VARCHAR"/> <result column="day_time" property="dayTime" />
<result column="hour_time" property="hourTime" jdbcType="VARCHAR"/> <result column="hour_time" property="hourTime" />
<result column="min_time" property="minTime" jdbcType="VARCHAR"/> <result column="min_time" property="minTime" />
<result column="power" property="power" jdbcType="DECIMAL"/> <result column="POWER" property="power" />
<result column="create_time" property="createTime" jdbcType="DATE"/> <result column="CREATE_TIME" property="createTime" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id id
, ,
storage_id, STORAGE_ID,
data_date, data_date,
year_time, year_time,
month_time, month_time,
......
...@@ -2,25 +2,25 @@ ...@@ -2,25 +2,25 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pps.core.prediction.mapper.ThirdActivePowerDailyUpdateViewMapper"> <mapper namespace="pps.core.prediction.mapper.ThirdActivePowerDailyUpdateViewMapper">
<resultMap id="BaseResultMap" type="pps.core.prediction.entity.ThirdActivePowerDailyUpdateView"> <resultMap id="BaseResultMap" type="pps.core.prediction.entity.ThirdActivePowerDailyUpdateView">
<id column="id" property="id" jdbcType="BIGINT"/> <id column="ID" property="id" />
<result column="station_name" property="stationName" jdbcType="VARCHAR"/> <result column="STATION_NAME" property="stationName" />
<result column="station_id" property="stationId" jdbcType="VARCHAR"/> <result column="STATION_ID" property="stationId" />
<result column="create_date" property="createDate" jdbcType="DATE"/> <result column="create_date" property="createDate" />
<result column="photovoltaic_power" property="photovoltaicPower" jdbcType="DECIMAL"/> <result column="photovoltaic_power" property="photovoltaicPower" />
<result column="meter_power" property="meterPower" jdbcType="DECIMAL"/> <result column="meter_power" property="meterPower" />
<result column="system_source" property="systemSource" jdbcType="VARCHAR"/> <result column="SYSTEM_SOURCE" property="systemSource" />
<result column="save_date" property="saveDate" jdbcType="DATE"/> <result column="save_date" property="saveDate" />
<result column="save_hour" property="saveHour" jdbcType="DATE"/> <result column="save_hour" property="saveHour" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id id
, ,
station_name, STATION_NAME,
station_id, STATION_ID,
create_date, create_date,
photovoltaic_power, photovoltaic_power,
meter_power, meter_power,
system_source, SYSTEM_SOURCE,
save_date, save_date,
save_hour save_hour
</sql> </sql>
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
delete delete
from THIRD_ACTIVE_POWER_DAILY_UPDATE from THIRD_ACTIVE_POWER_DAILY_UPDATE
where save_hour = #{currentDay} where save_hour = #{currentDay}
and station_name IN and STATION_NAME IN
<foreach collection="list" item="item" open="(" separator="," close=")"> <foreach collection="list" item="item" open="(" separator="," close=")">
#{item.stationName} #{item.stationName}
</foreach> </foreach>
...@@ -58,16 +58,16 @@ ...@@ -58,16 +58,16 @@
<foreach collection="currentDayList" item="item" open="(" separator="," close=")"> <foreach collection="currentDayList" item="item" open="(" separator="," close=")">
#{item} #{item}
</foreach> </foreach>
and station_name IN and STATION_NAME IN
<foreach collection="list" item="item" open="(" separator="," close=")"> <foreach collection="list" item="item" open="(" separator="," close=")">
#{item.stationName} #{item.stationName}
</foreach> </foreach>
</delete> </delete>
<insert id="batchInsertList" parameterType="java.util.List"> <insert id="batchInsertList" parameterType="java.util.List">
insert into THIRD_ACTIVE_POWER_DAILY_UPDATE (station_name, station_id, create_date, photovoltaic_power, insert into THIRD_ACTIVE_POWER_DAILY_UPDATE (STATION_NAME, STATION_ID, create_date, photovoltaic_power,
meter_power, meter_power,
system_source, save_date, save_hour) SYSTEM_SOURCE, save_date, save_hour)
values values
<foreach collection="list" item="item" separator=","> <foreach collection="list" item="item" separator=",">
( (
...@@ -85,27 +85,27 @@ ...@@ -85,27 +85,27 @@
<resultMap id="ExtBaseResultMap" type="pps.core.prediction.entity.ThirdActivePowerDailyUpdateView" <resultMap id="ExtBaseResultMap" type="pps.core.prediction.entity.ThirdActivePowerDailyUpdateView"
extends="BaseResultMap"> extends="BaseResultMap">
<result column="hour_number" property="hourNumber" jdbcType="INTEGER"/> <result column="hour_number" property="hourNumber" />
</resultMap> </resultMap>
<select id="selectEnergyUseCurve" resultMap="ExtBaseResultMap"> <select id="selectEnergyUseCurve" resultMap="ExtBaseResultMap">
SELECT hour_str AS hour_number, SELECT hour_str AS hour_number,
IFNULL( ROUND( AVG( photovoltaic_power ), 2 ), 0 ) AS photovoltaic_power, IFNULL( ROUND( AVG( photovoltaic_power ), 2 ), 0 ) AS photovoltaic_power,
IFNULL( ROUND( AVG( meter_power ), 2 ), 0 ) AS meter_power IFNULL( ROUND( AVG( meter_power ), 2 ), 0 ) AS meter_power
FROM (SELECT station_name, HOUR ( create_date ) AS hour_str, photovoltaic_power, meter_power FROM (SELECT STATION_NAME, HOUR ( create_date ) AS hour_str, photovoltaic_power, meter_power
FROM THIRD_ACTIVE_POWER_DAILY_UPDATE FROM THIRD_ACTIVE_POWER_DAILY_UPDATE
<where> <where>
<if test="systemSource != null"> <if test="systemSource != null">
AND system_source = #{systemSource} AND SYSTEM_SOURCE = #{systemSource}
</if> </if>
<if test="stationId != null"> <if test="stationId != null">
AND station_id = #{stationId} AND STATION_ID = #{stationId}
</if> </if>
<if test="createDate != null"> <if test="createDate != null">
AND create_date BETWEEN #{saveDate} AND #{createDate} AND create_date BETWEEN #{saveDate} AND #{createDate}
</if> </if>
<if test="stationIds != null and stationIds.size() > 0"> <if test="stationIds != null and stationIds.size() > 0">
AND station_id IN AND STATION_ID IN
<foreach collection="stationIds" item="item" open="(" separator="," close=")"> <foreach collection="stationIds" item="item" open="(" separator="," close=")">
#{item} #{item}
</foreach> </foreach>
......
...@@ -2,24 +2,24 @@ ...@@ -2,24 +2,24 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pps.core.prediction.mapper.ThirdActivePowerViewMapper"> <mapper namespace="pps.core.prediction.mapper.ThirdActivePowerViewMapper">
<resultMap id="BaseResultMap" type="pps.core.prediction.entity.ThirdActivePowerView"> <resultMap id="BaseResultMap" type="pps.core.prediction.entity.ThirdActivePowerView">
<id column="id" property="id" jdbcType="BIGINT"/> <id column="ID" property="id" />
<result column="station_name" property="stationName" jdbcType="VARCHAR"/> <result column="STATION_NAME" property="stationName" />
<result column="station_id" property="stationId" jdbcType="VARCHAR"/> <result column="STATION_ID" property="stationId" />
<result column="create_date" property="createDate" jdbcType="VARCHAR"/> <result column="create_date" property="createDate" />
<result column="photovoltaic_power" property="photovoltaicPower" jdbcType="DECIMAL"/> <result column="photovoltaic_power" property="photovoltaicPower" />
<result column="meter_power" property="meterPower" jdbcType="DECIMAL"/> <result column="meter_power" property="meterPower" />
<result column="system_source" property="systemSource" jdbcType="VARCHAR"/> <result column="SYSTEM_SOURCE" property="systemSource" />
<result column="input_time" property="inputTime" jdbcType="VARCHAR"/> <result column="INPUT_TIME" property="inputTime" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id id
, ,
station_name, STATION_NAME,
station_id, STATION_ID,
create_date, create_date,
photovoltaic_power, photovoltaic_power,
meter_power, meter_power,
system_source SYSTEM_SOURCE
</sql> </sql>
<select id="selectOne" parameterType="pps.core.prediction.entity.ThirdActivePowerView" resultMap="BaseResultMap"> <select id="selectOne" parameterType="pps.core.prediction.entity.ThirdActivePowerView" resultMap="BaseResultMap">
select select
...@@ -37,8 +37,8 @@ ...@@ -37,8 +37,8 @@
</select> </select>
<insert id="batchInsertList" parameterType="list"> <insert id="batchInsertList" parameterType="list">
INSERT INTO THIRD_ACTIVE_POWER ( station_name, station_id, create_date, photovoltaic_power, meter_power, INSERT INTO THIRD_ACTIVE_POWER ( STATION_NAME, STATION_ID, create_date, photovoltaic_power, meter_power,
system_source, input_time) SYSTEM_SOURCE, INPUT_TIME)
VALUES VALUES
<foreach collection="list" item="item" separator=","> <foreach collection="list" item="item" separator=",">
( (
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
</insert> </insert>
<resultMap id="ExtBaseResultMap" type="pps.core.prediction.entity.ThirdActivePowerView" extends="BaseResultMap"> <resultMap id="ExtBaseResultMap" type="pps.core.prediction.entity.ThirdActivePowerView" extends="BaseResultMap">
<result column="save_hour" property="saveHour" jdbcType="INTEGER"/> <result column="save_hour" property="saveHour" />
</resultMap> </resultMap>
<select id="selectEnergyUseCurve" parameterType="pps.core.prediction.entity.ThirdActivePowerView" <select id="selectEnergyUseCurve" parameterType="pps.core.prediction.entity.ThirdActivePowerView"
...@@ -62,9 +62,9 @@ ...@@ -62,9 +62,9 @@
SELECT hour_str AS save_hour, SELECT hour_str AS save_hour,
IFNULL(AVG(photovoltaic_power), 0) AS photovoltaic_power, IFNULL(AVG(photovoltaic_power), 0) AS photovoltaic_power,
IFNULL(AVG(meter_power), 0) AS meter_power IFNULL(AVG(meter_power), 0) AS meter_power
FROM (SELECT station_name, HOUR ( create_date ) AS hour_str, photovoltaic_power, meter_power FROM (SELECT STATION_NAME, HOUR ( create_date ) AS hour_str, photovoltaic_power, meter_power
FROM THIRD_ACTIVE_POWER FROM THIRD_ACTIVE_POWER
WHERE station_name = #{stationName} WHERE STATION_NAME = #{stationName}
AND DATE ( create_date ) = #{createDate}) z AND DATE ( create_date ) = #{createDate}) z
GROUP BY hour_str GROUP BY hour_str
ORDER BY hour_str ORDER BY hour_str
...@@ -87,11 +87,11 @@ ...@@ -87,11 +87,11 @@
DATE_FORMAT( create_date, '%Y-%m-%d %H:00:00' ) AS create_date, DATE_FORMAT( create_date, '%Y-%m-%d %H:00:00' ) AS create_date,
</otherwise> </otherwise>
</choose> </choose>
station_name STATION_NAME
FROM THIRD_ACTIVE_POWER FROM THIRD_ACTIVE_POWER
WHERE ( WHERE (
<if test="stationNames != null and stationNames.size() > 0"> <if test="stationNames != null and stationNames.size() > 0">
station_name IN STATION_NAME IN
<foreach collection="stationNames" item="item" open="(" separator="," close=")"> <foreach collection="stationNames" item="item" open="(" separator="," close=")">
#{item} #{item}
</foreach> </foreach>
...@@ -99,10 +99,10 @@ ...@@ -99,10 +99,10 @@
AND create_date BETWEEN #{startTime} AND create_date BETWEEN #{startTime}
AND #{endTime} AND #{endTime}
<if test="systemSource != null"> <if test="systemSource != null">
AND system_source = #{systemSource} AND SYSTEM_SOURCE = #{systemSource}
</if> </if>
) )
GROUP BY station_name, GROUP BY STATION_NAME,
create_date) z create_date) z
GROUP BY create_date GROUP BY create_date
ORDER BY ORDER BY
...@@ -111,10 +111,10 @@ ...@@ -111,10 +111,10 @@
<select id="selectAvgPhotovoltaicPower" parameterType="pps.core.prediction.entity.ThirdActivePowerView" <select id="selectAvgPhotovoltaicPower" parameterType="pps.core.prediction.entity.ThirdActivePowerView"
resultMap="BaseResultMap"> resultMap="BaseResultMap">
SELECT g.station_name, SELECT g.STATION_NAME,
g.create_time AS create_date, g.create_time AS create_date,
AVG(g.photovoltaic_power) AS photovoltaic_power AVG(g.photovoltaic_power) AS photovoltaic_power
FROM (SELECT a.station_name, FROM (SELECT a.STATION_NAME,
a.photovoltaic_power, a.photovoltaic_power,
DATE_FORMAT( DATE_FORMAT(
CASE CASE
...@@ -123,7 +123,7 @@ ...@@ -123,7 +123,7 @@
END, END,
'%H:%i:%s' '%H:%i:%s'
) AS create_time ) AS create_time
FROM (SELECT z.station_name, FROM (SELECT z.STATION_NAME,
z.photovoltaic_power, z.photovoltaic_power,
CASE CASE
...@@ -131,7 +131,7 @@ ...@@ -131,7 +131,7 @@
FROM_UNIXTIME(z.time_stamp + 10 - z.mo) FROM_UNIXTIME(z.time_stamp + 10 - z.mo)
ELSE z.create_date ELSE z.create_date
END AS create_time END AS create_time
FROM (SELECT station_name, FROM (SELECT STATION_NAME,
create_date, create_date,
photovoltaic_power, photovoltaic_power,
UNIX_TIMESTAMP(create_date) AS time_stamp, UNIX_TIMESTAMP(create_date) AS time_stamp,
...@@ -141,20 +141,20 @@ ...@@ -141,20 +141,20 @@
WHERE WHERE
DATE ( create_date ) = #{createDate} DATE ( create_date ) = #{createDate}
<if test="systemSource != null"> <if test="systemSource != null">
AND system_source = #{systemSource} AND SYSTEM_SOURCE = #{systemSource}
</if> </if>
AND photovoltaic_power AND photovoltaic_power
&gt; 0) z) a) g &gt; 0) z) a) g
GROUP BY g.station_name, GROUP BY g.STATION_NAME,
g.create_time g.create_time
ORDER BY g.station_name, ORDER BY g.STATION_NAME,
g.create_time g.create_time
</select> </select>
<select id="selectAvgPower15" parameterType="pps.core.prediction.entity.ThirdActivePowerView" <select id="selectAvgPower15" parameterType="pps.core.prediction.entity.ThirdActivePowerView"
resultMap="BaseResultMap"> resultMap="BaseResultMap">
SELECT IFNULL(AVG(z.photovoltaic_power), 0) AS photovoltaic_power, SELECT IFNULL(AVG(z.photovoltaic_power), 0) AS photovoltaic_power,
z.input_time z.INPUT_TIME
FROM (SELECT photovoltaic_power, FROM (SELECT photovoltaic_power,
<choose> <choose>
<when test="systemSource == 'SY'"> <when test="systemSource == 'SY'">
...@@ -166,34 +166,34 @@ ...@@ -166,34 +166,34 @@
WHEN MINUTE ( create_date ) &lt; 45 THEN WHEN MINUTE ( create_date ) &lt; 45 THEN
DATE_FORMAT( create_date, '%Y-%m-%d %H:30:00' ) DATE_FORMAT( create_date, '%Y-%m-%d %H:30:00' )
ELSE DATE_FORMAT( create_date, '%Y-%m-%d %H:45:00' ) ELSE DATE_FORMAT( create_date, '%Y-%m-%d %H:45:00' )
END input_time END INPUT_TIME
</when> </when>
<otherwise> <otherwise>
CASE CASE
WHEN MINUTE ( input_time) IN ( 10, 40 ) THEN WHEN MINUTE ( INPUT_TIME) IN ( 10, 40 ) THEN
DATE_SUB( input_time, INTERVAL + 10 MINUTE ) DATE_SUB( INPUT_TIME, INTERVAL + 10 MINUTE )
WHEN MINUTE ( input_time ) IN ( 20, 50 ) THEN WHEN MINUTE ( INPUT_TIME ) IN ( 20, 50 ) THEN
DATE_SUB( input_time, INTERVAL + 5 MINUTE ) ELSE input_time DATE_SUB( INPUT_TIME, INTERVAL + 5 MINUTE ) ELSE INPUT_TIME
END input_time END INPUT_TIME
</otherwise> </otherwise>
</choose> </choose>
FROM FROM
THIRD_ACTIVE_POWER THIRD_ACTIVE_POWER
WHERE WHERE
station_id = #{stationId} STATION_ID = #{stationId}
AND input_time &gt;= #{startTime} AND INPUT_TIME &gt;= #{startTime}
<if test="endTime != null"> <if test="endTime != null">
AND input_time &lt;= #{endTime} AND INPUT_TIME &lt;= #{endTime}
</if> </if>
<if test="systemSource != null"> <if test="systemSource != null">
AND system_source = #{systemSource} AND SYSTEM_SOURCE = #{systemSource}
</if> </if>
ORDER BY ORDER BY
input_time ASC INPUT_TIME ASC
) z ) z
GROUP BY GROUP BY
z.input_time z.INPUT_TIME
ORDER BY ORDER BY
z.input_time z.INPUT_TIME
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -2,25 +2,25 @@ ...@@ -2,25 +2,25 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pps.core.prediction.mapper.ThirdCurrentWellConditionViewMapper"> <mapper namespace="pps.core.prediction.mapper.ThirdCurrentWellConditionViewMapper">
<resultMap id="BaseResultMap" type="pps.core.prediction.entity.ThirdCurrentWellConditionView"> <resultMap id="BaseResultMap" type="pps.core.prediction.entity.ThirdCurrentWellConditionView">
<id column="id" property="id" jdbcType="BIGINT"/> <id column="ID" property="id" />
<result column="well_number" property="wellNumber" jdbcType="VARCHAR"/> <result column="WELL_NUMBER" property="wellNumber" />
<result column="next_time" property="nextTime" jdbcType="DATE"/> <result column="next_time" property="nextTime" />
<result column="well_status" property="wellStatus" jdbcType="VARCHAR"/> <result column="well_status" property="wellStatus" />
<result column="cumulative_production" property="cumulativeProduction" jdbcType="DECIMAL"/> <result column="cumulative_production" property="cumulativeProduction" />
<result column="running_time" property="runningTime" jdbcType="DECIMAL"/> <result column="running_time" property="runningTime" />
<result column="system_source" property="systemSource" jdbcType="VARCHAR"/> <result column="SYSTEM_SOURCE" property="systemSource" />
<result column="update_time" property="updateTime" jdbcType="DATE"/> <result column="UPDATE_TIME" property="updateTime" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id id
, ,
well_number, WELL_NUMBER,
next_time, next_time,
well_status, well_status,
cumulative_production, cumulative_production,
running_time, running_time,
system_source, SYSTEM_SOURCE,
update_time UPDATE_TIME
</sql> </sql>
<select id="selectOne" parameterType="pps.core.prediction.entity.ThirdCurrentWellConditionView" <select id="selectOne" parameterType="pps.core.prediction.entity.ThirdCurrentWellConditionView"
resultMap="BaseResultMap"> resultMap="BaseResultMap">
...@@ -42,15 +42,15 @@ ...@@ -42,15 +42,15 @@
<delete id="deleteByParams" parameterType="list"> <delete id="deleteByParams" parameterType="list">
DELETE FROM THIRD_CURRENT_WELL_CONDITION DELETE FROM THIRD_CURRENT_WELL_CONDITION
WHERE WHERE
well_number IN WELL_NUMBER IN
<foreach collection="list" item="item" open="(" separator="," close=")"> <foreach collection="list" item="item" open="(" separator="," close=")">
#{item.wellNumber} #{item.wellNumber}
</foreach> </foreach>
</delete> </delete>
<insert id="batchInsertList" parameterType="list"> <insert id="batchInsertList" parameterType="list">
INSERT INTO THIRD_CURRENT_WELL_CONDITION (well_number, next_time, well_status, cumulative_production, INSERT INTO THIRD_CURRENT_WELL_CONDITION (WELL_NUMBER, next_time, well_status, cumulative_production,
running_time, system_source, update_time) running_time, SYSTEM_SOURCE, UPDATE_TIME)
VALUES VALUES
<foreach collection="list" item="item" separator=","> <foreach collection="list" item="item" separator=",">
( (
......
...@@ -2,24 +2,24 @@ ...@@ -2,24 +2,24 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pps.core.prediction.mapper.ThirdDailyAccumulationUpdateViewMapper"> <mapper namespace="pps.core.prediction.mapper.ThirdDailyAccumulationUpdateViewMapper">
<resultMap id="BaseResultMap" type="pps.core.prediction.entity.ThirdDailyAccumulationUpdateView"> <resultMap id="BaseResultMap" type="pps.core.prediction.entity.ThirdDailyAccumulationUpdateView">
<id column="id" property="id" jdbcType="BIGINT"/> <id column="ID" property="id" />
<result column="station_name" property="stationName" jdbcType="VARCHAR"/> <result column="STATION_NAME" property="stationName" />
<result column="station_id" property="stationId" jdbcType="VARCHAR"/> <result column="STATION_ID" property="stationId" />
<result column="create_date" property="createDate" jdbcType="DATE"/> <result column="create_date" property="createDate" />
<result column="photovoltaic_power" property="photovoltaicPower" jdbcType="DECIMAL"/> <result column="photovoltaic_power" property="photovoltaicPower" />
<result column="daily_electricity_consumption" property="dailyElectricityConsumption" jdbcType="DECIMAL"/> <result column="daily_electricity_consumption" property="dailyElectricityConsumption" />
<result column="daily_liquid_production" property="dailyLiquidProduction" jdbcType="DECIMAL"/> <result column="daily_liquid_production" property="dailyLiquidProduction" />
<result column="in_place_consumption" property="inPlaceConsumption" jdbcType="DECIMAL"/> <result column="in_place_consumption" property="inPlaceConsumption" />
<result column="energy_storage_discharge" property="energyStorageDischarge" jdbcType="DECIMAL"/> <result column="energy_storage_discharge" property="energyStorageDischarge" />
<result column="save_date" property="saveDate" jdbcType="DATE"/> <result column="save_date" property="saveDate" />
<result column="system_source" property="systemSource" jdbcType="VARCHAR"/> <result column="SYSTEM_SOURCE" property="systemSource" />
<result column="save_hour" property="saveHour" jdbcType="DATE"/> <result column="save_hour" property="saveHour" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id id
, ,
station_name, STATION_NAME,
station_id, STATION_ID,
create_date, create_date,
photovoltaic_power, photovoltaic_power,
daily_electricity_consumption, daily_electricity_consumption,
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
in_place_consumption, in_place_consumption,
energy_storage_discharge, energy_storage_discharge,
save_date, save_date,
system_source, SYSTEM_SOURCE,
save_hour save_hour
</sql> </sql>
<select id="selectOne" parameterType="pps.core.prediction.entity.ThirdDailyAccumulationUpdateView" <select id="selectOne" parameterType="pps.core.prediction.entity.ThirdDailyAccumulationUpdateView"
...@@ -48,9 +48,9 @@ ...@@ -48,9 +48,9 @@
</select> </select>
<insert id="batchInsertList" parameterType="list"> <insert id="batchInsertList" parameterType="list">
INSERT INTO THIRD_DAILY_ACCUMULATION_UPDATE ( station_name, station_id, create_date, photovoltaic_power, INSERT INTO THIRD_DAILY_ACCUMULATION_UPDATE ( STATION_NAME, STATION_ID, create_date, photovoltaic_power,
daily_electricity_consumption, daily_liquid_production, in_place_consumption, energy_storage_discharge, daily_electricity_consumption, daily_liquid_production, in_place_consumption, energy_storage_discharge,
save_date, system_source, save_date, SYSTEM_SOURCE,
save_hour) save_hour)
VALUES VALUES
<foreach collection="list" item="item" separator=","> <foreach collection="list" item="item" separator=",">
...@@ -72,9 +72,9 @@ ...@@ -72,9 +72,9 @@
<resultMap id="ExtResultMap" type="pps.core.prediction.entity.ThirdDailyAccumulationUpdateView" <resultMap id="ExtResultMap" type="pps.core.prediction.entity.ThirdDailyAccumulationUpdateView"
extends="BaseResultMap"> extends="BaseResultMap">
<result column="day_flag" property="dayFlag" jdbcType="INTEGER"/> <result column="day_flag" property="dayFlag" />
<result column="green_electricity_rate" property="greenElectricityRate" jdbcType="DECIMAL"/> <result column="green_electricity_rate" property="greenElectricityRate" />
<result column="avoid_peak_rate" property="avoidPeakRate" jdbcType="DECIMAL"/> <result column="avoid_peak_rate" property="avoidPeakRate" />
</resultMap> </resultMap>
<select id="selectPowerStatisticsByDate" parameterType="pps.core.prediction.entity.ThirdDailyAccumulationUpdateView" <select id="selectPowerStatisticsByDate" parameterType="pps.core.prediction.entity.ThirdDailyAccumulationUpdateView"
...@@ -92,8 +92,8 @@ ...@@ -92,8 +92,8 @@
FROM THIRD_DAILY_ACCUMULATION_UPDATE FROM THIRD_DAILY_ACCUMULATION_UPDATE
WHERE WHERE
DATE ( create_date) = #{today} DATE ( create_date) = #{today}
AND system_source = #{systemSource} AND SYSTEM_SOURCE = #{systemSource}
AND station_name IN AND STATION_NAME IN
<foreach collection="stationNameList" open="(" close=")" separator="," item="item"> <foreach collection="stationNameList" open="(" close=")" separator="," item="item">
#{item} #{item}
</foreach> </foreach>
...@@ -105,8 +105,8 @@ ...@@ -105,8 +105,8 @@
FROM THIRD_DAILY_ACCUMULATION_UPDATE FROM THIRD_DAILY_ACCUMULATION_UPDATE
WHERE WHERE
DATE ( create_date ) = #{yesterday} DATE ( create_date ) = #{yesterday}
AND system_source = #{systemSource} AND SYSTEM_SOURCE = #{systemSource}
AND station_name IN AND STATION_NAME IN
<foreach collection="stationNameList" open="(" close=")" separator="," item="item"> <foreach collection="stationNameList" open="(" close=")" separator="," item="item">
#{item} #{item}
</foreach> </foreach>
...@@ -118,8 +118,8 @@ ...@@ -118,8 +118,8 @@
FROM THIRD_DAILY_ACCUMULATION_UPDATE FROM THIRD_DAILY_ACCUMULATION_UPDATE
WHERE WHERE
DATE ( create_date ) = #{lastYear} DATE ( create_date ) = #{lastYear}
AND system_source = #{systemSource} AND SYSTEM_SOURCE = #{systemSource}
AND station_name IN AND STATION_NAME IN
<foreach collection="stationNameList" open="(" close=")" separator="," item="item"> <foreach collection="stationNameList" open="(" close=")" separator="," item="item">
#{item} #{item}
</foreach> </foreach>
...@@ -143,7 +143,7 @@ ...@@ -143,7 +143,7 @@
FROM FROM
THIRD_DAILY_ACCUMULATION_UPDATE THIRD_DAILY_ACCUMULATION_UPDATE
WHERE WHERE
station_name IN STATION_NAME IN
<foreach collection="stationNameList" open="(" close=")" separator="," item="item"> <foreach collection="stationNameList" open="(" close=")" separator="," item="item">
#{item} #{item}
</foreach> </foreach>
...@@ -155,7 +155,7 @@ ...@@ -155,7 +155,7 @@
AND MONTH(create_date) = #{month} AND MONTH(create_date) = #{month}
</if> </if>
<if test="systemSource != null"> <if test="systemSource != null">
AND system_source = #{systemSource} AND SYSTEM_SOURCE = #{systemSource}
</if> </if>
GROUP BY GROUP BY
<choose> <choose>
......
...@@ -2,23 +2,23 @@ ...@@ -2,23 +2,23 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pps.core.prediction.mapper.ThirdDailyAccumulationViewMapper"> <mapper namespace="pps.core.prediction.mapper.ThirdDailyAccumulationViewMapper">
<resultMap id="BaseResultMap" type="pps.core.prediction.entity.ThirdDailyAccumulationView"> <resultMap id="BaseResultMap" type="pps.core.prediction.entity.ThirdDailyAccumulationView">
<id column="id" property="id" jdbcType="BIGINT"/> <id column="ID" property="id" />
<result column="station_name" property="stationName" jdbcType="VARCHAR"/> <result column="STATION_NAME" property="stationName" />
<result column="station_id" property="stationId" jdbcType="VARCHAR"/> <result column="STATION_ID" property="stationId" />
<result column="create_date" property="createDate" jdbcType="DATE"/> <result column="create_date" property="createDate" />
<result column="photovoltaic_power" property="photovoltaicPower" jdbcType="DECIMAL"/> <result column="photovoltaic_power" property="photovoltaicPower" />
<result column="daily_electricity_consumption" property="dailyElectricityConsumption" jdbcType="DECIMAL"/> <result column="daily_electricity_consumption" property="dailyElectricityConsumption" />
<result column="daily_liquid_production" property="dailyLiquidProduction" jdbcType="DECIMAL"/> <result column="daily_liquid_production" property="dailyLiquidProduction" />
<result column="in_place_consumption" property="inPlaceConsumption" jdbcType="DECIMAL"/> <result column="in_place_consumption" property="inPlaceConsumption" />
<result column="energy_storage_discharge" property="energyStorageDischarge" jdbcType="DECIMAL"/> <result column="energy_storage_discharge" property="energyStorageDischarge" />
<result column="save_date" property="saveDate" jdbcType="DATE"/> <result column="save_date" property="saveDate" />
<result column="system_source" property="systemSource" jdbcType="VARCHAR"/> <result column="SYSTEM_SOURCE" property="systemSource" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id id
, ,
station_name, STATION_NAME,
station_id, STATION_ID,
create_date, create_date,
photovoltaic_power, photovoltaic_power,
daily_electricity_consumption, daily_electricity_consumption,
...@@ -45,9 +45,9 @@ ...@@ -45,9 +45,9 @@
</select> </select>
<insert id="batchInsertList" parameterType="list"> <insert id="batchInsertList" parameterType="list">
INSERT INTO THIRD_DAILY_ACCUMULATION ( station_name, station_id, create_date, photovoltaic_power, INSERT INTO THIRD_DAILY_ACCUMULATION ( STATION_NAME, STATION_ID, create_date, photovoltaic_power,
daily_electricity_consumption, daily_liquid_production, in_place_consumption, energy_storage_discharge, daily_electricity_consumption, daily_liquid_production, in_place_consumption, energy_storage_discharge,
save_date, system_source ) save_date, SYSTEM_SOURCE )
VALUES VALUES
<foreach collection="list" item="item" separator=","> <foreach collection="list" item="item" separator=",">
( (
......
...@@ -2,19 +2,19 @@ ...@@ -2,19 +2,19 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pps.core.prediction.mapper.ThirdPhotovoltaicPowerViewMapper"> <mapper namespace="pps.core.prediction.mapper.ThirdPhotovoltaicPowerViewMapper">
<resultMap id="BaseResultMap" type="pps.core.prediction.entity.ThirdPhotovoltaicPowerView"> <resultMap id="BaseResultMap" type="pps.core.prediction.entity.ThirdPhotovoltaicPowerView">
<id column="id" property="id" jdbcType="BIGINT"/> <id column="ID" property="id" />
<result column="station_name" property="stationName" jdbcType="VARCHAR"/> <result column="STATION_NAME" property="stationName" />
<result column="create_date" property="createDate" jdbcType="DATE"/> <result column="create_date" property="createDate" />
<result column="photovoltaic_power" property="photovoltaicPower" jdbcType="DECIMAL"/> <result column="photovoltaic_power" property="photovoltaicPower" />
<result column="system_source" property="systemSource" jdbcType="VARCHAR"/> <result column="SYSTEM_SOURCE" property="systemSource" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id id
, ,
station_name, STATION_NAME,
create_date, create_date,
photovoltaic_power, photovoltaic_power,
system_source SYSTEM_SOURCE
</sql> </sql>
<select id="selectOne" parameterType="pps.core.prediction.entity.ThirdPhotovoltaicPowerView" <select id="selectOne" parameterType="pps.core.prediction.entity.ThirdPhotovoltaicPowerView"
resultMap="BaseResultMap"> resultMap="BaseResultMap">
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
</select> </select>
<insert id="batchInsertList" parameterType="list"> <insert id="batchInsertList" parameterType="list">
INSERT INTO THIRD_PHOTOVOLTAIC_POWER (station_name, create_date, photovoltaic_power, system_source) INSERT INTO THIRD_PHOTOVOLTAIC_POWER (STATION_NAME, create_date, photovoltaic_power, SYSTEM_SOURCE)
VALUES VALUES
<foreach collection="list" item="item" separator=","> <foreach collection="list" item="item" separator=",">
( (
......
...@@ -2,20 +2,20 @@ ...@@ -2,20 +2,20 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pps.core.prediction.mapper.ThirdWellAvgActivePowerViewMapper"> <mapper namespace="pps.core.prediction.mapper.ThirdWellAvgActivePowerViewMapper">
<resultMap id="BaseResultMap" type="pps.core.prediction.entity.ThirdWellAvgActivePowerView"> <resultMap id="BaseResultMap" type="pps.core.prediction.entity.ThirdWellAvgActivePowerView">
<id column="id" property="id" jdbcType="BIGINT"/> <id column="ID" property="id" />
<result column="well_number" property="wellNumber" jdbcType="VARCHAR"/> <result column="WELL_NUMBER" property="wellNumber" />
<result column="input_time" property="inputTime" jdbcType="VARCHAR"/> <result column="INPUT_TIME" property="inputTime" />
<result column="avg_active_power" property="avgActivePower" jdbcType="DECIMAL"/> <result column="avg_active_power" property="avgActivePower" />
<result column="system_source" property="systemSource" jdbcType="VARCHAR"/> <result column="SYSTEM_SOURCE" property="systemSource" />
<result column="save_date" property="saveDate" jdbcType="DATE"/> <result column="save_date" property="saveDate" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id id
, ,
well_number, WELL_NUMBER,
input_time, INPUT_TIME,
avg_active_power, avg_active_power,
system_source, SYSTEM_SOURCE,
save_date save_date
</sql> </sql>
<select id="selectOne" parameterType="pps.core.prediction.entity.ThirdWellAvgActivePowerView" <select id="selectOne" parameterType="pps.core.prediction.entity.ThirdWellAvgActivePowerView"
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
</select> </select>
<insert id="batchInsertList" parameterType="list"> <insert id="batchInsertList" parameterType="list">
INSERT INTO THIRD_WELL_AVG_ACTIVE_POWER ( well_number, input_time, avg_active_power, system_source, INSERT INTO THIRD_WELL_AVG_ACTIVE_POWER ( WELL_NUMBER, INPUT_TIME, avg_active_power, SYSTEM_SOURCE,
save_date ) save_date )
VALUES VALUES
<foreach collection="list" item="item" separator=","> <foreach collection="list" item="item" separator=",">
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
<resultMap id="ExtBaseResultMap" type="pps.core.prediction.entity.ThirdWellAvgActivePowerView" <resultMap id="ExtBaseResultMap" type="pps.core.prediction.entity.ThirdWellAvgActivePowerView"
extends="BaseResultMap"> extends="BaseResultMap">
<result column="hour_number" property="hourNumber" jdbcType="INTEGER"/> <result column="hour_number" property="hourNumber" />
</resultMap> </resultMap>
<select id="selectMeterPower" parameterType="pps.core.prediction.entity.ThirdWellAvgActivePowerView" <select id="selectMeterPower" parameterType="pps.core.prediction.entity.ThirdWellAvgActivePowerView"
...@@ -61,13 +61,13 @@ ...@@ -61,13 +61,13 @@
hour_str AS hour_number, hour_str AS hour_number,
IFNULL( AVG( avg_active_power ), 0 ) AS avg_active_power IFNULL( AVG( avg_active_power ), 0 ) AS avg_active_power
FROM FROM
( SELECT well_number, HOUR ( input_time ) AS hour_str, avg_active_power FROM THIRD_WELL_AVG_ACTIVE_POWER ( SELECT WELL_NUMBER, HOUR ( INPUT_TIME ) AS hour_str, avg_active_power FROM THIRD_WELL_AVG_ACTIVE_POWER
<where> <where>
<if test="inputTime != null"> <if test="inputTime != null">
AND DATE ( input_time ) = #{inputTime} AND DATE ( INPUT_TIME ) = #{inputTime}
</if> </if>
<if test="wellNumbers != null and wellNumbers.size() > 0"> <if test="wellNumbers != null and wellNumbers.size() > 0">
AND well_number IN AND WELL_NUMBER IN
<foreach collection="wellNumbers" item="item" open="(" separator="," close=")"> <foreach collection="wellNumbers" item="item" open="(" separator="," close=")">
#{item} #{item}
</foreach> </foreach>
...@@ -91,52 +91,52 @@ ...@@ -91,52 +91,52 @@
ROUND( SUM( avg_active_power ), 2 ) AS avg_active_power, ROUND( SUM( avg_active_power ), 2 ) AS avg_active_power,
</otherwise> </otherwise>
</choose> </choose>
input_time INPUT_TIME
FROM FROM
( (
SELECT SELECT
IFNULL( AVG( avg_active_power ), 0 ) AS avg_active_power, IFNULL( AVG( avg_active_power ), 0 ) AS avg_active_power,
z.input_time, z.INPUT_TIME,
z.well_number z.WELL_NUMBER
FROM FROM
( (
SELECT SELECT
avg_active_power, avg_active_power,
<choose> <choose>
<when test="dayFlag == 3"> <when test="dayFlag == 3">
DATE_FORMAT( input_time, '%Y-%m-01' ) AS input_time, DATE_FORMAT( INPUT_TIME, '%Y-%m-01' ) AS INPUT_TIME,
</when> </when>
<when test="dayFlag == 2"> <when test="dayFlag == 2">
DATE_FORMAT( input_time, '%Y-%m-%d' ) AS input_time, DATE_FORMAT( INPUT_TIME, '%Y-%m-%d' ) AS INPUT_TIME,
</when> </when>
<otherwise> <otherwise>
DATE_FORMAT( input_time, '%Y-%m-%d %H:00:00' ) AS input_time, DATE_FORMAT( INPUT_TIME, '%Y-%m-%d %H:00:00' ) AS INPUT_TIME,
</otherwise> </otherwise>
</choose> </choose>
well_number WELL_NUMBER
FROM FROM
THIRD_WELL_AVG_ACTIVE_POWER THIRD_WELL_AVG_ACTIVE_POWER
WHERE WHERE
( (
<if test="wellNumbers != null and wellNumbers.size() > 0"> <if test="wellNumbers != null and wellNumbers.size() > 0">
well_number IN WELL_NUMBER IN
<foreach collection="wellNumbers" item="item" open="(" separator="," close=")"> <foreach collection="wellNumbers" item="item" open="(" separator="," close=")">
#{item} #{item}
</foreach> </foreach>
</if> </if>
AND input_time BETWEEN #{startTime} AND INPUT_TIME BETWEEN #{startTime}
AND #{endTime} AND #{endTime}
<if test="systemSource != null"> <if test="systemSource != null">
AND system_source = #{systemSource} AND SYSTEM_SOURCE = #{systemSource}
</if> </if>
)) z )) z
GROUP BY GROUP BY
z.well_number, z.WELL_NUMBER,
z.input_time z.INPUT_TIME
) z ) z
GROUP BY GROUP BY
input_time INPUT_TIME
ORDER BY ORDER BY
input_time INPUT_TIME
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -2,32 +2,32 @@ ...@@ -2,32 +2,32 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pps.core.prediction.mapper.WellheadDailyProductionSituationViewMapper"> <mapper namespace="pps.core.prediction.mapper.WellheadDailyProductionSituationViewMapper">
<resultMap id="BaseResultMap" type="pps.core.prediction.entity.WellheadDailyProductionSituationView"> <resultMap id="BaseResultMap" type="pps.core.prediction.entity.WellheadDailyProductionSituationView">
<id column="id" property="id" jdbcType="BIGINT"/> <id column="ID" property="id" />
<result column="wellhead_id" property="wellheadId" jdbcType="VARCHAR"/> <result column="WELLHEAD_ID" property="wellheadId" />
<result column="well_number" property="wellNumber" jdbcType="VARCHAR"/> <result column="WELL_NUMBER" property="wellNumber" />
<result column="data_date" property="dataDate" jdbcType="DATE"/> <result column="DATA_DATE" property="dataDate" />
<result column="production_time" property="productionTime" jdbcType="DECIMAL"/> <result column="production_time" property="productionTime" />
<result column="daily_electricity_consumption" property="dailyElectricityConsumption" jdbcType="DECIMAL"/> <result column="daily_electricity_consumption" property="dailyElectricityConsumption" />
<result column="daily_liquid_production" property="dailyLiquidProduction" jdbcType="DECIMAL"/> <result column="daily_liquid_production" property="dailyLiquidProduction" />
<result column="system_source" property="systemSource" jdbcType="VARCHAR"/> <result column="SYSTEM_SOURCE" property="systemSource" />
<result column="daily_utility_electricity_consumption" property="dailyUtilityElectricityConsumption" <result column="daily_utility_electricity_consumption" property="dailyUtilityElectricityConsumption"
jdbcType="DECIMAL"/> />
<result column="electricity_consumption_ph" property="electricityConsumptionPh" jdbcType="DECIMAL"/> <result column="electricity_consumption_ph" property="electricityConsumptionPh" />
<result column="electricity_consumption_hh" property="electricityConsumptionHh" jdbcType="DECIMAL"/> <result column="electricity_consumption_hh" property="electricityConsumptionHh" />
<result column="electricity_consumption_np" property="electricityConsumptionNp" jdbcType="DECIMAL"/> <result column="electricity_consumption_np" property="electricityConsumptionNp" />
<result column="electricity_consumption_vh" property="electricityConsumptionVh" jdbcType="DECIMAL"/> <result column="electricity_consumption_vh" property="electricityConsumptionVh" />
<result column="electricity_charge_city" property="electricityChargeCity" jdbcType="DECIMAL"/> <result column="electricity_charge_city" property="electricityChargeCity" />
<result column="electricity_charges_ph" property="electricityChargesPh" jdbcType="DECIMAL"/> <result column="electricity_charges_ph" property="electricityChargesPh" />
<result column="peak_hour_tariff" property="peakHourTariff" jdbcType="DECIMAL"/> <result column="peak_hour_tariff" property="peakHourTariff" />
<result column="normal_period_tariff" property="normalPeriodTariff" jdbcType="DECIMAL"/> <result column="normal_period_tariff" property="normalPeriodTariff" />
<result column="alley_hours_tariff" property="alleyHoursTariff" jdbcType="DECIMAL"/> <result column="alley_hours_tariff" property="alleyHoursTariff" />
<result column="create_date" property="createDate" jdbcType="VARCHAR"/> <result column="create_date" property="createDate" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id id
, ,
wellhead_id, WELLHEAD_ID,
well_number, WELL_NUMBER,
data_date, data_date,
production_time, production_time,
daily_electricity_consumption, daily_electricity_consumption,
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
peak_hour_tariff, peak_hour_tariff,
normal_period_tariff, normal_period_tariff,
alley_hours_tariff, alley_hours_tariff,
system_source, SYSTEM_SOURCE,
create_date create_date
</sql> </sql>
<select id="selectOne" parameterType="pps.core.prediction.entity.WellheadDailyProductionSituationView" <select id="selectOne" parameterType="pps.core.prediction.entity.WellheadDailyProductionSituationView"
...@@ -63,8 +63,8 @@ ...@@ -63,8 +63,8 @@
</select> </select>
<insert id="batchInsertList" parameterType="list"> <insert id="batchInsertList" parameterType="list">
INSERT INTO WELLHEAD_DAILY_PRODUCTION_SITUATION ( wellhead_id, well_number, data_date, production_time, INSERT INTO WELLHEAD_DAILY_PRODUCTION_SITUATION ( WELLHEAD_ID, WELL_NUMBER, data_date, production_time,
daily_electricity_consumption, daily_liquid_production, system_source, daily_utility_electricity_consumption, daily_electricity_consumption, daily_liquid_production, SYSTEM_SOURCE, daily_utility_electricity_consumption,
electricity_consumption_ph, electricity_consumption_ph,
electricity_consumption_hh, electricity_consumption_hh,
electricity_consumption_np, electricity_consumption_np,
...@@ -103,22 +103,22 @@ ...@@ -103,22 +103,22 @@
<resultMap id="SumResultMap" type="pps.core.prediction.entity.WellheadDailyProductionSituationView" <resultMap id="SumResultMap" type="pps.core.prediction.entity.WellheadDailyProductionSituationView"
extends="BaseResultMap"> extends="BaseResultMap">
<result column="line_id" property="lineId" jdbcType="VARCHAR"/> <result column="LINE_ID" property="lineId" />
<result column="line_name" property="lineName" jdbcType="VARCHAR"/> <result column="LINE_NAME" property="lineName" />
</resultMap> </resultMap>
<select id="selectSumDailyElectricityConsumption" parameterType="date" <select id="selectSumDailyElectricityConsumption" parameterType="date"
resultType="pps.core.prediction.entity.WellheadDailyProductionSituationView"> resultType="pps.core.prediction.entity.WellheadDailyProductionSituationView">
SELECT w.line_id AS line_id, SELECT w.line_id AS line_id,
l.line_name AS line_name, l.LINE_NAME AS LINE_NAME,
IFNULL(SUM(s.daily_electricity_consumption), 0) AS daily_electricity_consumption IFNULL(SUM(s.daily_electricity_consumption), 0) AS daily_electricity_consumption
FROM BASE_POWER_LINE_WELLHEAD w FROM BASE_POWER_LINE_WELLHEAD w
JOIN WELLHEAD_DAILY_PRODUCTION_SITUATION s ON w.wellhead_id = s.wellhead_id JOIN WELLHEAD_DAILY_PRODUCTION_SITUATION s ON w.WELLHEAD_ID = s.WELLHEAD_ID
LEFT JOIN BASE_POWER_LINE l ON w.line_id = l.id LEFT JOIN BASE_POWER_LINE l ON w.line_id = l.id
WHERE w.is_deleted = 1 WHERE w.is_deleted = 1
AND s.data_date = #{date} AND s.data_date = #{date}
<if test="systemSource != null"> <if test="systemSource != null">
AND s.system_source = #{systemSource} AND s.SYSTEM_SOURCE = #{systemSource}
</if> </if>
GROUP BY w.line_id GROUP BY w.line_id
</select> </select>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment