feature (办公基价迁移): 完成办公计价迁移

1. 办公案例下载
2. 办公案例清洗
3. 办公基价计算
4. 办公基价导入
5. 物业基价菜单调整
6. 住宅租赁挂牌案例下载
7. 住宅租赁案例清洗
This commit is contained in:
purple
2020-07-06 18:46:13 +08:00
parent 706dddeedd
commit 1c2e15016a
371 changed files with 25749 additions and 24484 deletions

View File

@ -8,13 +8,13 @@ ruoyi:
# 实例演示开关
demoEnabled: true
# 文件路径 示例( Windows配置D:/ruoyi/uploadPathLinux配置 /home/ruoyi/uploadPath
profile: D:/ruoyi/uploadPath
profile: /opt/sites/
# 获取ip地址开关
addressEnabled: false
# web服务器配置
server:
port: 9700
port: 8080
servlet:
# 应用的访问路径
context-path: /
@ -77,74 +77,4 @@ spring:
driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
url: jdbc:sqlserver://139.196.201.83:1433;DatabaseName=TEST
username: purple
password: liancheng
# druid:
# statViewServlet:
# enabled: true
# # 设置白名单,不填则允许所有访问
# allow:
# url-pattern: /druid/*
# # 控制台管理用户名和密码
# login-username:
# login-password:
# dynamic:
# druid:
# # 初始连接数
# initialSize: 5
# # 最小连接池数量
# minIdle: 10
# # 最大连接池数量
# maxActive: 20
# # 配置获取连接等待超时的时间
# maxWait: 60000
# # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
# timeBetweenEvictionRunsMillis: 60000
# # 配置一个连接在池中最小生存的时间,单位是毫秒
# minEvictableIdleTimeMillis: 300000
# # 配置一个连接在池中最大生存的时间,单位是毫秒
# maxEvictableIdleTimeMillis: 900000
# # 配置检测连接是否有效
# validationQuery: SELECT 1
# testWhileIdle: true
# testOnBorrow: false
# testOnReturn: false
## webStatFilter:
## enabled: true
## filters: stat,wall
## wall:
## multiStatementAllow: true
# stat:
# log-slow-sql: true
# slow-sql-millis: 1000
# merge-sql: true
# primary: master
# datasource:
# # 主库数据源
# master:
# driver-class-name: com.mysql.jdbc.Driver
# url: jdbc:mysql://172.16.30.243:6060/ruoyi?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
# username: root
# password: LOLm2dI2UQF#RxOf
# # 从库数据源
## slave:
## # 从数据源开关/默认关闭
## enabled: false
## url:
## username:
## password:
# teemlink:
# driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
# url: jdbc:sqlserver://172.16.30.233:1433;DatabaseName=obpm_LianCheng_Data
# username: sa
# password: Lcdatacenter_888
# compute:
# driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
# url: jdbc:sqlserver://172.16.30.233:1433;DatabaseName=uv_compute
# username: sa
# password: Lcdatacenter_888
# clean:
# driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
# url: jdbc:sqlserver://172.16.30.233:1433;DatabaseName=uv_clean
# username: sa
# password: Lcdatacenter_888
password: liancheng

View File

@ -49,7 +49,7 @@ spring:
# 国际化资源文件路径
basename: i18n/messages
profiles:
active: uat
active: dev
# 文件上传
servlet:
multipart:

View File

@ -139,7 +139,7 @@
<logger name="java.sql.Connection" level="DEBUG"/>
<logger name="java.sql.Statement" level="DEBUG"/>
<logger name="java.sql.PreparedStatement" level="DEBUG"/>
<logger name="com.ruoyi" level="info"/>
<logger name="com.uvaluation" level="info"/>
</springProfile>
<root level="info">

View File

@ -1,93 +1,93 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<!-- 日志存放路径 -->
<property name="log.path" value="/home/ruoyi/logs" />
<!-- 日志输出格式 -->
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
<!-- 控制台输出 -->
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>${log.pattern}</pattern>
</encoder>
</appender>
<!-- 系统日志输出 -->
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/sys-info.log</file>
<!-- 循环政策:基于时间创建日志文件 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 日志文件名格式 -->
<fileNamePattern>${log.path}/sys-info.%d{yyyy-MM-dd}.log</fileNamePattern>
<!-- 日志最大的历史 60天 -->
<maxHistory>60</maxHistory>
</rollingPolicy>
<encoder>
<pattern>${log.pattern}</pattern>
</encoder>
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<!-- 过滤的级别 -->
<level>INFO</level>
<!-- 匹配时的操作:接收(记录) -->
<onMatch>ACCEPT</onMatch>
<!-- 不匹配时的操作:拒绝(不记录) -->
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/sys-error.log</file>
<!-- 循环政策:基于时间创建日志文件 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 日志文件名格式 -->
<fileNamePattern>${log.path}/sys-error.%d{yyyy-MM-dd}.log</fileNamePattern>
<!-- 日志最大的历史 60天 -->
<maxHistory>60</maxHistory>
</rollingPolicy>
<encoder>
<pattern>${log.pattern}</pattern>
</encoder>
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<!-- 过滤的级别 -->
<level>ERROR</level>
<!-- 匹配时的操作:接收(记录) -->
<onMatch>ACCEPT</onMatch>
<!-- 不匹配时的操作:拒绝(不记录) -->
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!-- 用户访问日志输出 -->
<appender name="sys-user" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/sys-user.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 按天回滚 daily -->
<fileNamePattern>${log.path}/sys-user.%d{yyyy-MM-dd}.log</fileNamePattern>
<!-- 日志最大的历史 60天 -->
<maxHistory>60</maxHistory>
</rollingPolicy>
<encoder>
<pattern>${log.pattern}</pattern>
</encoder>
</appender>
<!-- 系统模块日志级别控制 -->
<logger name="com.ruoyi" level="info" />
<!-- Spring日志级别控制 -->
<logger name="org.springframework" level="warn" />
<root level="info">
<appender-ref ref="console" />
</root>
<!--系统操作日志-->
<root level="info">
<appender-ref ref="file_info" />
<appender-ref ref="file_error" />
</root>
<!--系统用户操作日志-->
<logger name="sys-user" level="info">
<appender-ref ref="sys-user"/>
</logger>
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<!-- 日志存放路径 -->
<property name="log.path" value="/home/ruoyi/logs" />
<!-- 日志输出格式 -->
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
<!-- 控制台输出 -->
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>${log.pattern}</pattern>
</encoder>
</appender>
<!-- 系统日志输出 -->
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/sys-info.log</file>
<!-- 循环政策:基于时间创建日志文件 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 日志文件名格式 -->
<fileNamePattern>${log.path}/sys-info.%d{yyyy-MM-dd}.log</fileNamePattern>
<!-- 日志最大的历史 60天 -->
<maxHistory>60</maxHistory>
</rollingPolicy>
<encoder>
<pattern>${log.pattern}</pattern>
</encoder>
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<!-- 过滤的级别 -->
<level>INFO</level>
<!-- 匹配时的操作:接收(记录) -->
<onMatch>ACCEPT</onMatch>
<!-- 不匹配时的操作:拒绝(不记录) -->
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/sys-error.log</file>
<!-- 循环政策:基于时间创建日志文件 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 日志文件名格式 -->
<fileNamePattern>${log.path}/sys-error.%d{yyyy-MM-dd}.log</fileNamePattern>
<!-- 日志最大的历史 60天 -->
<maxHistory>60</maxHistory>
</rollingPolicy>
<encoder>
<pattern>${log.pattern}</pattern>
</encoder>
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<!-- 过滤的级别 -->
<level>ERROR</level>
<!-- 匹配时的操作:接收(记录) -->
<onMatch>ACCEPT</onMatch>
<!-- 不匹配时的操作:拒绝(不记录) -->
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!-- 用户访问日志输出 -->
<appender name="sys-user" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/sys-user.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 按天回滚 daily -->
<fileNamePattern>${log.path}/sys-user.%d{yyyy-MM-dd}.log</fileNamePattern>
<!-- 日志最大的历史 60天 -->
<maxHistory>60</maxHistory>
</rollingPolicy>
<encoder>
<pattern>${log.pattern}</pattern>
</encoder>
</appender>
<!-- 系统模块日志级别控制 -->
<logger name="com.uvaluation" level="info" />
<!-- Spring日志级别控制 -->
<logger name="org.springframework" level="warn" />
<root level="info">
<appender-ref ref="console" />
</root>
<!--系统操作日志-->
<root level="info">
<appender-ref ref="file_info" />
<appender-ref ref="file_error" />
</root>
<!--系统用户操作日志-->
<logger name="sys-user" level="info">
<appender-ref ref="sys-user"/>
</logger>
</configuration>

View File

@ -2,13 +2,13 @@
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.project.data.price.mapper.ArtificialResidenceRentPriceMapper">
<mapper namespace="com.uvaluation.project.data.price.mapper.ArtificialResidenceRentPriceMapper">
<resultMap type="com.ruoyi.project.data.price.domain.ArtificialResidenceRentBasePrice"
<resultMap type="com.uvaluation.project.data.price.domain.ArtificialResidenceRentBasePrice"
id="MainMappingResult">
<result property="id" column="id"/>
<result property="communityId" column="ProjectID"/>
<result property="mainRentCoefficient" column="MainCoff_Rent"/>
<result property="mainCoefficientRent" column="MainCoff_Rent"/>
<result property="mainRentPrice" column="MainRentPrice"/>
<result property="rentPrice" column="RentPrice"/>
<result property="rentPrice_1" column="rentPrice_1"/>
@ -22,7 +22,7 @@
</select>
<select id="selectPageCount"
parameterType="com.ruoyi.project.data.price.domain.ArtificialResidenceRentBasePrice" resultType="int">
parameterType="com.uvaluation.project.data.price.domain.ArtificialResidenceRentBasePrice" resultType="int">
select count(1) from DWA_PROJECTBASEPRICE_RENT_MANU_${yearMonth}
<where>
<if test="communityId != null">
@ -32,7 +32,7 @@
</select>
<!-- 分页 -->
<select id="selectPageList"
parameterType="com.ruoyi.project.data.price.domain.ArtificialResidenceRentBasePrice"
parameterType="com.uvaluation.project.data.price.domain.ArtificialResidenceRentBasePrice"
resultMap="MainMappingResult">
SELECT ID,ProjectID,MainCoff_Rent,RentPrice,MainRentPrice,RentPrice_1,VOPPAT,VOPPA
FROM dbo.DWA_PROJECTBASEPRICE_RENT_MANU_${yearMonth}
@ -45,7 +45,7 @@
</select>
<!-- 获取表名 -->
<select id="yearMonthList" resultType="com.ruoyi.project.common.VueSelectModel">
<select id="yearMonthList" resultType="com.uvaluation.project.common.VueSelectModel">
SELECT right(name,6) as value, right(name,6) as label
FROM sys.tables
where name like 'DWA_PROJECTBASEPRICE_RENT_MANU_%' and name not like '%_bak'
@ -63,19 +63,24 @@
truncate table DWA_PROJECTBASEPRICE_RENT_MANU_${yearMonth};
</update>
<!-- 更新人工修正租赁基价-->
<update id="update" parameterType="com.ruoyi.project.data.price.domain.ArtificialResidenceRentBasePrice">
<update id="update" parameterType="com.uvaluation.project.data.price.domain.ArtificialResidenceRentBasePrice">
update dbo.DWA_PROJECTBASEPRICE_RENT_MANU_${yearMonth}
set RentPrice=#{rentPrice},MainRentPrice=#{mainRentPrice},VOPPAT=#{voppat},VOPPA=#{voppa},RentPrice_1=#{rentPrice_1}
,ModifyDate=getdate()
where ID=#{id}
</update>
<update id="initProcedure">
IF OBJECT_ID('BatchImportOfArtificialResidenceRent', 'P') IS NOT NULL
drop procedure BatchImportOfArtificialResidenceRent;
</update>
<!-- 创建存储过程-->
<update id="prepareBachImport" parameterType="int">
create procedure dbo.BatchImportOfArtificialResidenceRent @table DWA_PROJECTBASEPRICE_RENT_MANU_Table readonly
as
begin
insert into dbo.DWA_PROJECTBASEPRICE_RENT_MANU_${yearMonth}(ProjectID,MainCoff_Rent,RentPrice,MainRentPrice,RentPrice_1,VOPPAT,VOPPA,ModifyDate )
select ProjectID,MainCoff_Rent,RentPrice,MainRentPrice,RentPrice_1,VOPPAT,VOPPA,ModifyDate
insert into
dbo.DWA_PROJECTBASEPRICE_RENT_MANU_${yearMonth}(ID,ProjectID,MainCoff_Rent,RentPrice,MainRentPrice,RentPrice_1,VOPPAT,VOPPA,ModifyDate)
select id,ProjectID,MainCoff_Rent,RentPrice,MainRentPrice,RentPrice_1,VOPPAT,VOPPA,getdate()
from @table;
end;
</update>

View File

@ -2,9 +2,9 @@
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.project.data.price.mapper.ArtificialResidenceSaleBasePriceMapper">
<mapper namespace="com.uvaluation.project.data.price.mapper.ArtificialResidenceSalePriceMapper">
<resultMap type="com.ruoyi.project.data.price.domain.ArtificialResidenceSaleBasePrice"
<resultMap type="com.uvaluation.project.data.price.domain.ArtificialResidenceSaleBasePrice"
id="MainMappingResult">
<result property="communityId" column="ProjectID"/>
<result property="communityName" column="ProjectName"/>
@ -134,7 +134,7 @@
</sql>
<!-- 分页总数 -->
<select id="selectPageCount"
parameterType="com.ruoyi.project.data.price.domain.ArtificialResidenceSaleBasePrice" resultType="int">
parameterType="com.uvaluation.project.data.price.domain.ArtificialResidenceSaleBasePrice" resultType="int">
select count(1) from dbo.DWA_PROJECTBASEPRICE_MANU_${yearMonth}
<where>
<if test="communityId != null">
@ -148,7 +148,7 @@
</select>
<!-- 分页列表 -->
<select id="selectPageList"
parameterType="com.ruoyi.project.data.price.domain.ArtificialResidenceSaleBasePrice"
parameterType="com.uvaluation.project.data.price.domain.ArtificialResidenceSaleBasePrice"
resultMap="MainMappingResult">
<include refid="selectAllField"/>
<where>
@ -169,7 +169,7 @@
where id = #{id}
</select>
<!-- 获取表名 -->
<select id="yearMonthList" resultType="com.ruoyi.project.common.VueSelectModel">
<select id="yearMonthList" resultType="com.uvaluation.project.common.VueSelectModel">
SELECT right(name,6) as value, right(name,6) as label
FROM sys.tables
where name like 'DWA_PROJECTBASEPRICE_MANU_%'
@ -177,13 +177,13 @@
</select>
<!-- 修改价格信息(基价、主力基价、上月基价、幅度)、注意修改上期基价问题、还要把基价更新一下。 -->
<update id="updateEntity" parameterType="com.ruoyi.project.data.price.domain.ArtificialResidenceSaleBasePrice">
<update id="updateEntity" parameterType="com.uvaluation.project.data.price.domain.ArtificialResidenceSaleBasePrice">
update dbo.DWA_PROJECTBASEPRICE_MANU_${yearMonth} set
BasePrice=#{basePrice},mainPrice=#{mainPrice},BasePrice_1=#{basePrice_1},VOPPAT=#{voppat},VOPPA=#{voppa},
PriceNote=#{comment}
where ProjectID=#{communityId};
</update>
<update id="initImport">
<update id="initProcedure">
IF OBJECT_ID('BatchImportOfArtificialResidenceSale', 'P') IS NOT NULL
drop procedure BatchImportOfArtificialResidenceSale;
</update>
@ -198,7 +198,7 @@
from @table;
end;
</update>
<insert id="insert" parameterType="com.ruoyi.project.data.price.domain.ArtificialResidenceSaleBasePrice">
<insert id="insert" parameterType="com.uvaluation.project.data.price.domain.ArtificialResidenceSaleBasePrice">
insert into dbo.DWA_PROJECTBASEPRICE_MANU_${yearMonth}
(
ProjectID
@ -322,7 +322,7 @@
)
</insert>
<!-- 同步到基价库 -->
<insert id="insertUVBasePrice" parameterType="com.ruoyi.project.data.price.domain.ArtificialResidenceSaleBasePrice">
<insert id="insertUVBasePrice" parameterType="com.uvaluation.project.data.price.domain.ArtificialResidenceSaleBasePrice">
insert into obpm_LianCheng_Data.dbo.TLK_基价信息
(
LASTMODIFIED
@ -381,7 +381,7 @@
, #{voppa}
)
</insert>
<insert id="insertUVDocument" parameterType="com.ruoyi.project.data.price.domain.ArtificialResidenceSaleBasePrice">
<insert id="insertUVDocument" parameterType="com.uvaluation.project.data.price.domain.ArtificialResidenceSaleBasePrice">
insert into obpm_LianCheng_Data.dbo.T_DOCUMENT
(
ID

View File

@ -2,9 +2,9 @@
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.project.data.price.mapper.ComputeResidenceRentPriceMapper">
<mapper namespace="com.uvaluation.project.data.price.mapper.ComputeResidenceRentPriceMapper">
<resultMap type="com.ruoyi.project.data.price.domain.ComputeResidenceRentBasePrice"
<resultMap type="com.uvaluation.project.data.price.domain.ComputeResidenceRentBasePrice"
id="MainMappingResult">
<result property="id" column="id"/>
<result property="communityId" column="ProjectID"/>
@ -131,7 +131,7 @@
</sql>
<select id="selectPageCount"
parameterType="com.ruoyi.project.data.price.domain.ComputeResidenceRentBasePrice" resultType="int">
parameterType="com.uvaluation.project.data.price.domain.ComputeResidenceRentBasePrice" resultType="int">
select count(1) from DWA_PROJECTBASEPRICE_RENT_IMDT_${yearMonth}
<where>
<if test="communityId != null">
@ -141,7 +141,7 @@
</select>
<!-- 分页 -->
<select id="selectPageList"
parameterType="com.ruoyi.project.data.price.domain.ComputeResidenceRentBasePrice"
parameterType="com.uvaluation.project.data.price.domain.ComputeResidenceRentBasePrice"
resultMap="MainMappingResult">
<![CDATA[ SELECT ID,ProjectID,ProjectName,ProjectAddr,County,Block,[Loop] as loopLine,IsIndxGen,IsPstCalc,StatusRun,PropertyType,ProjectType,ProjectTypeDtl,ProjectLevel,PropertyDevPeriod,BindClassID,MainCoff_Rent,RentPriceDft,MainRentPriceDft,RentPrice_1,PriceDealMean_1,PriceDealMax_1,SumDeal_1,PriceDeal_1_ToAI_Pst,PriceDealMean,PriceDealMax,SumDeal,PriceDeal_ToAI_Pst,PriceDeal_ToLst_Pst,PriceCaseOff,PriceCaseOff_ToLst_Pst,PriceListedMin,PriceLstMn_ToAI_Pst,PriceCase1_ToAI_Pst,PriceCase2_ToAI_Pst,PriceCase1_ToLst_Pst,PriceCase2_ToLst_Pst,PriceCase1,PriceCase1AdjPst,SumCase1,PriceCase2,PriceCase2AdjPst,SumCase2,VOPPBT,VOPPB,BindProjID,Bind_Proj_Pst,Bind_Block_Class,Bind_Block_Class_Pst,Bind_Block_Plevel,Bind_Block_Plevel_Pst,Bind_Block_PType,Bind_Block_Ptype_Pst,Bind_County_PType,Bind_County_Ptype_Pst,Bind_MixProject_PType,Bind_MixProject_Pst,VOPPAT,VOPPA ]]>
FROM dbo.DWA_PROJECTBASEPRICE_RENT_IMDT_${yearMonth}
@ -154,7 +154,7 @@
where id = #{id}
</select>
<!-- 获取表名 -->
<select id="yearMonthList" resultType="com.ruoyi.project.common.VueSelectModel">
<select id="yearMonthList" resultType="com.uvaluation.project.common.VueSelectModel">
SELECT right(name,6) as value, right(name,6) as label
FROM sys.tables
where name like 'DWA_PROJECTBASEPRICE_RENT_IMDT_%'

View File

@ -2,9 +2,9 @@
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.project.data.price.mapper.ComputeResidenceSalePriceMapper">
<mapper namespace="com.uvaluation.project.data.price.mapper.ComputeResidenceSalePriceMapper">
<resultMap type="com.ruoyi.project.data.price.domain.ComputeResidenceSaleBasePrice"
<resultMap type="com.uvaluation.project.data.price.domain.ComputeResidenceSaleBasePrice"
id="MainMappingResult">
<result property="id" column="sid"/>
<result property="communityId" column="ProjectID"/>
@ -136,7 +136,7 @@
</sql>
<!-- 分页总数 -->
<select id="selectPageCount"
parameterType="com.ruoyi.project.data.price.domain.ComputeResidenceRentBasePrice" resultType="int">
parameterType="com.uvaluation.project.data.price.domain.ComputeResidenceRentBasePrice" resultType="int">
select count(1) from dbo.DWA_PROJECTBASEPRICE_IMDT_${yearMonth}
<where>
<if test="communityId != null">
@ -150,7 +150,7 @@
</select>
<!-- 分页列表 -->
<select id="selectPageList"
parameterType="com.ruoyi.project.data.price.domain.ComputeResidenceSaleBasePrice"
parameterType="com.uvaluation.project.data.price.domain.ComputeResidenceSaleBasePrice"
resultMap="MainMappingResult">
<include refid="selectAllField"/>
<where>
@ -171,14 +171,14 @@
where id = #{id}
</select>
<!-- 获取表名 -->
<select id="yearMonthList" resultType="com.ruoyi.project.common.VueSelectModel">
<select id="yearMonthList" resultType="com.uvaluation.project.common.VueSelectModel">
SELECT top 12 right(name,6) as value, right(name,6) as label
FROM sys.tables
where name like 'DWA_PROJECTBASEPRICE_IMDT_%'
order by cast(right(name,6) as int) desc
</select>
<!-- 区域涨跌幅 -->
<select id="getBlockChange" resultType="com.ruoyi.project.data.price.domain.DistrictBlockChange">
<select id="getBlockChange" resultType="com.uvaluation.project.data.price.domain.DistrictBlockChange">
select Block as name
, avg(VOPPA) as value
from dbo.DWA_PROJECTBASEPRICE_IMDT_${yearMonth}
@ -187,7 +187,7 @@
order by avg(VOPPA)
</select>
<!--区域涨跌幅-->
<select id="getCountyChange" resultType="com.ruoyi.project.data.price.domain.DistrictBlockChange">
<select id="getCountyChange" resultType="com.uvaluation.project.data.price.domain.DistrictBlockChange">
select left(County,2) as name
, avg(VOPPA) as value
from dbo.DWA_PROJECTBASEPRICE_IMDT_${yearMonth}

View File

@ -2,8 +2,8 @@
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.project.data.cases.mapper.sync.DownloadOriginalOfficeCaseMapper">
<resultMap id="DownloadMapping" type="com.ruoyi.project.data.cases.domain.OriginalOfficeCase">
<mapper namespace="com.uvaluation.project.data.cases.mapper.sync.DownloadOriginalOfficeCaseMapper">
<resultMap id="DownloadMapping" type="com.uvaluation.project.data.cases.domain.OriginalOfficeCase">
<result property="url" column="url"/>
<result property="title" column="title"/>
<result property="floorAreaRatio" column="容积率"/>

View File

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.uvaluation.project.data.cases.mapper.sync.DownloadOriginalResidenceRentClosingCaseMapper">
<select id="download" resultType="com.uvaluation.project.data.cases.domain.OriginalResidenceRentClosingCase">
SELECT 合同编号 as caseContractNo
,小区名称 as caseCommunityName
,挂牌时间 as caseOpeningDate
,交易时间 as caseClosingDate
,租金 as caseRentPrice
,建筑面积 as caseArea
,住宅楼总楼层数 as caseTotalFloor
,朝向 as caseToward
,户型 as caseApartmentLayout
,装修状况 as caseDecoration
,小区ID as caseCommunityId
,楼栋ID as caseBuildingId
FROM dbo.ODS_HOUSINGCASEDEAL_RENT_${yearMonth}_RAW
</select>
</mapper>

View File

@ -2,8 +2,8 @@
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.project.data.cases.mapper.sync.DownloadOriginalResidenceRentOpeningCaseMapper">
<resultMap id="resultMapping" type="com.ruoyi.project.data.cases.domain.OriginalResidenceRentOpeningCase">
<mapper namespace="com.uvaluation.project.data.cases.mapper.sync.DownloadOriginalResidenceRentOpeningCaseMapper">
<resultMap id="resultMapping" type="com.uvaluation.project.data.cases.domain.OriginalResidenceRentOpeningCase">
<result property="caseLianJiaId" column="llid"/>
<result property="caseLianJiaCommunityId" column="lcid"/>
<result property="cleanCommunityId" column="airaid" />

View File

@ -2,8 +2,8 @@
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.project.data.cases.mapper.sync.DownloadOriginalResidenceRentPlatformCaseMapper">
<resultMap id="resultMapping" type="com.ruoyi.project.data.cases.domain.OriginalResidencePlatformRentOpeningCase">
<mapper namespace="com.uvaluation.project.data.cases.mapper.sync.DownloadOriginalResidenceRentPlatformCaseMapper">
<resultMap id="resultMapping" type="com.uvaluation.project.data.cases.domain.OriginalResidencePlatformRentOpeningCase">
<result property="caseArea" column="面积" javaType="java.math.BigDecimal"/>
<result property="caseBlock" column="block" />
<result property="caseAddress" column="地址"/>

View File

@ -2,8 +2,8 @@
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.project.data.cases.mapper.sync.DownloadOriginalResidenceSaleClosingCaseMapper">
<resultMap id="resultMapping" type="com.ruoyi.project.data.cases.domain.OriginalResidenceSaleClosingCase">
<mapper namespace="com.uvaluation.project.data.cases.mapper.sync.DownloadOriginalResidenceSaleClosingCaseMapper">
<resultMap id="resultMapping" type="com.uvaluation.project.data.cases.domain.OriginalResidenceSaleClosingCase">
<result property="caseCountyName" column="区域"/>
<result property="caseBlockName" column="板块"/>
<result property="caseLoopName" column="环线"/>

View File

@ -2,8 +2,8 @@
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.project.data.cases.mapper.sync.DownloadOriginalResidenceSaleOpeningCaseMapper">
<resultMap id="resultMapping" type="com.ruoyi.project.data.cases.domain.OriginalResidenceSaleOpeningCase">
<mapper namespace="com.uvaluation.project.data.cases.mapper.sync.DownloadOriginalResidenceSaleOpeningCaseMapper">
<resultMap id="resultMapping" type="com.uvaluation.project.data.cases.domain.OriginalResidenceSaleOpeningCase">
<result property="caseLianJiaId" column="llid"/>
<result property="caseLianJiaCommunityId" column="lcid"/>
<result property="caseTitle" column="name"/>

View File

@ -2,9 +2,9 @@
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.project.data.basis.mapper.LianJiaCommunityDictMapper">
<mapper namespace="com.uvaluation.project.data.basis.mapper.LianJiaCommunityDictMapper">
<select id="selectPageOfList" resultType="com.ruoyi.project.data.basis.domain.LianJiaCommunityDict">
<select id="selectPageOfList" resultType="com.uvaluation.project.data.basis.domain.LianJiaCommunityDict">
SELECT id
,lianjia_community_id AS lianJiaCommunityid
,lianjia_community_name as lianJiaCommunityName
@ -59,7 +59,7 @@
</if>
</where>
</select>
<select id="selectById" resultType="com.ruoyi.project.data.basis.domain.LianJiaCommunityDict">
<select id="selectById" resultType="com.uvaluation.project.data.basis.domain.LianJiaCommunityDict">
SELECT id
,lianjia_community_id AS lianJiaCommunityid
,lianjia_community_name as lianJiaCommunityName

View File

@ -2,7 +2,7 @@
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.project.data.cases.mapper.OriginalOfficeCaseMapper">
<mapper namespace="com.uvaluation.project.data.cases.mapper.OriginalOfficeCaseMapper">
<update id="createTable">
<bind name="targetTableName" value="'dbo.ODS_OFFICECASELISTED_' + yearMonth + '_RAW'"/>
IF OBJECT_ID(#{targetTableName}, 'U') IS NOT NULL

View File

@ -0,0 +1,270 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.uvaluation.project.data.cases.mapper.OriginalResidenceRentClosingCaseMapper">
<update id="createRawTable">
<bind name="targetTableName" value="'dbo.ODS_HOUSINGCASEDEAL_RENT_' + yearMonth+'_RAW'"/>
IF OBJECT_ID(#{targetTableName}, 'U') IS NOT NULL
drop table ${targetTableName};
CREATE TABLE ${targetTableName}
(
case_id varchar(32) not null,
case_contract_no nvarchar (32) NOT null primary key,
case_community_name nvarchar (512) NULL,
case_opening_date date NULL,
case_closing_date date NULL,
case_rent_price decimal (18, 2) NULL,
case_area decimal (18, 2) NULL,
case_total_floor int NULL,
case_toward nvarchar (16) NULL,
case_apartment_layout nvarchar (16) NULL,
case_decoration nvarchar (16) NULL,
clean_community_id nvarchar (32) NULL,
clean_building_id nvarchar (32) NULL
)
</update>
<update id="createCleanTable">
<bind name="targetTableName" value="'dbo.ODS_HOUSINGCASEDEAL_RENT_' + yearMonth"/>
IF OBJECT_ID(#{targetTableName}, 'U') IS NOT NULL
drop table ${targetTableName};
create table ${targetTableName}
(
case_id varchar(32) not null
, HouseholdsID_SRC nvarchar(64) primary key
, ProjectID_SRC nvarchar(64) not null
, ProjectID bigint
, BuildingID bigint
, RentType tinyint
, Room tinyint
, Hall tinyint
, Bashroom tinyint
, Area decimal(18, 2)
, Towards nvarchar(64)
, UpperFloorSum nvarchar(32)
, UpperFloorNum nvarchar(32)
, Elevator tinyint
, Decoration nvarchar(64)
, Year int
, AreaCoff decimal(7, 4)
, TowardsCoff decimal(7, 4)
, FloorCoff decimal(7, 4)
, DecorationRng int
, YearCoff decimal(7, 4)
, BuildingCoff decimal(7, 4)
, RoomTypeCoff decimal(7, 4)
, PriceTotal decimal(18, 2) not null
, PriceUnit decimal(18, 2) not null
, PriceScatterRent decimal(18, 2)
, PriceEntireRent decimal(18, 2)
, PriceShareRent0 decimal(18, 2)
, PriceShareRent decimal(18, 2)
, Visited_Num int
, First_Visit_Time date
, Visited_Num_15 int
, Visited_Num_30 int
, Status tinyint
, AdjustedValue decimal(18, 2)
, AdjustedPst decimal(18, 6)
, AdjustedCumValue decimal(18, 2)
, AdjustedCumPst decimal(18, 6)
, AdjustedCumValueAbs decimal(18, 2)
, AdjustedCumPstAbs decimal(18, 6)
, AdjustedCumNum int
, PriceTotalIn decimal(18, 2)
, PriceTotalOut decimal(18, 2)
, PriceDateIn date
, PriceDateOut date
, Origin nvarchar(64)
, UrlHouseholds nvarchar(max)
, UrlProjects nvarchar(max)
, CaseName nvarchar(1024)
);
</update>
<update id="createAssembleTable">
<bind name="targetTableName" value="'dbo.DW_HOUSINGCASE_RENT_COMM_' + yearMonth"/>
IF OBJECT_ID(#{targetTableName}, 'U') IS NOT NULL
drop table ${targetTableName};
CREATE TABLE ${targetTableName}
(
ID int NOT NULL IDENTITY(1, 1),
HouseholdsID_SRC nvarchar (64) NOT NULL,
ProjectID_SRC nvarchar (64) NOT NULL,
ProjectID nvarchar (32) NULL,
BuildingID nvarchar (32) NULL,
RentType tinyint NULL,
Room tinyint NULL,
Hall tinyint NULL,
Bashroom tinyint NULL,
Area decimal (18, 2) NULL,
Towards nvarchar (64) NULL,
UpperFloorSum nvarchar (32) NULL,
UpperFloorNum nvarchar (32) NULL,
Elevator tinyint NULL,
Decoration nvarchar (64) NULL,
Year int NULL,
AreaCoff decimal (7, 4) NULL,
TowardsCoff decimal (7, 4) NULL,
FloorCoff decimal (7, 4) NULL,
DecorationRng int NULL,
YearCoff decimal (7, 4) NULL,
BuildingCoff decimal (7, 4) NULL,
RoomTypeCoff decimal (7, 4) NULL,
PriceTotal decimal (18, 2) NOT NULL,
PriceUnit decimal (18, 2) NOT NULL,
PriceScatterRent decimal (18, 2) NULL,
PriceEntireRent decimal (18, 2) NULL,
PriceShareRent0 decimal (18, 2) NULL,
PriceShareRent decimal (18, 2) NULL,
Visited_Num int NULL,
First_Visit_Time date NULL,
Visited_Num_15 int NULL,
Visited_Num_30 int NULL,
Status tinyint NULL,
AdjustedValue decimal (18, 2) NULL,
AdjustedPst decimal (18, 6) NULL,
AdjustedCumValue decimal (18, 2) NULL,
AdjustedCumPst decimal (18, 6) NULL,
AdjustedCumValueAbs decimal (18, 2) NULL,
AdjustedCumPstAbs decimal (18, 6) NULL,
AdjustedCumNum int NULL,
PriceTotalIn decimal (18, 2) NULL,
PriceTotalOut decimal (18, 2) NULL,
PriceDateIn date NULL,
PriceDateOut date NULL,
Origin nvarchar (64) NULL,
UrlHouseholds nvarchar (2000) NULL,
UrlProjects nvarchar (2000) NULL,
CaseName nvarchar (1024) NULL,
CaseType tinyint NULL,
RentPrice_1 decimal (18, 2) NULL,
Range decimal (18, 4) NULL,
RangeFlag int NULL,
RentPrice decimal (18, 2) NULL,
EntireRentRatio decimal (18, 6) NULL,
ShareRentRatio decimal (18, 6) NULL
)
</update>
<!-- 计算表-->
<update id="createComputeTable">
<bind name="targetTableName" value="'dbo.DWA_PROJECTBASEPRICE_RENT_IMDT_' + yearMonth"/>
IF OBJECT_ID(#{targetTableName}, 'U') IS NOT NULL
drop table ${targetTableName};
CREATE TABLE ${targetTableName}
(
ID int NOT NULL IDENTITY(1, 1),
ProjectID nvarchar(32) NOT NULL,
ProjectName nvarchar (1024) NULL,
ProjectAddr nvarchar (1024) NULL,
County nvarchar (512) NULL,
Block nvarchar (512) NULL,
Loop nvarchar (512) NULL,
IsIndxGen tinyint NULL,
IsPstCalc tinyint NULL,
StatusRun tinyint NULL,
PropertyType nvarchar (256) NULL,
ProjectType nvarchar (256) NULL,
ProjectTypeDtl nvarchar (256) NULL,
ProjectLevel nvarchar (64) NULL,
PropertyDevPeriod tinyint NULL,
BindClassID nvarchar (16) NULL,
MainCoff_Rent decimal (7, 4) NULL,
RentPriceDft decimal (18, 2) NULL,
MainRentPriceDft decimal (18, 2) NULL,
RentPrice_1 decimal (18, 2) NULL,
PriceDealMean_1 decimal (18, 2) NULL,
PriceDealMax_1 decimal (18, 2) NULL,
SumDeal_1 int NULL,
PriceDeal_1_ToAI_Pst decimal (18, 6) NULL,
PriceDealMean decimal (18, 2) NULL,
PriceDealMax decimal (18, 2) NULL,
SumDeal int NULL,
PriceDeal_ToAI_Pst decimal (18, 6) NULL,
PriceDeal_ToLst_Pst decimal (18, 6) NULL,
PriceCaseOff decimal (18, 2) NULL,
PriceCaseOff_ToLst_Pst decimal (18, 6) NULL,
PriceListedMin decimal (18, 2) NULL,
PriceLstMn_ToAI_Pst decimal (18, 6) NULL,
PriceCase1_ToAI_Pst decimal (18, 6) NULL,
PriceCase2_ToAI_Pst decimal (18, 6) NULL,
PriceCase1_ToLst_Pst decimal (18, 6) NULL,
PriceCase2_ToLst_Pst decimal (18, 6) NULL,
PriceCase1 decimal (18, 2) NULL,
PriceCase1AdjPst decimal (18, 6) NULL,
SumCase1 int NULL,
PriceCase2 decimal (18, 2) NULL,
PriceCase2AdjPst decimal (18, 6) NULL,
SumCase2 int NULL,
VOPPBT varchar (64) NULL,
VOPPB decimal (18, 6) NULL,
BindProjID int NULL,
Bind_Proj_Pst decimal (18, 6) NULL,
Bind_Block_Class nvarchar (128) NULL,
Bind_Block_Class_Pst decimal (18, 6) NULL,
Bind_Block_Plevel nvarchar (128) NULL,
Bind_Block_Plevel_Pst decimal (18, 6) NULL,
Bind_Block_PType nvarchar (128) NULL,
Bind_Block_Ptype_Pst decimal (18, 6) NULL,
Bind_County_PType nvarchar (128) NULL,
Bind_County_Ptype_Pst decimal (18, 6) NULL,
Bind_MixProject_PType nvarchar (128) NULL,
Bind_MixProject_Pst decimal (18, 6) NULL,
VOPPAT varchar (64) NULL,
VOPPA decimal (18, 6) NULL
)
</update>
<update id="createArtificialTable">
<bind name="targetTableName" value="'dbo.DWA_PROJECTBASEPRICE_RENT_MANU_' + yearMonth"/>
IF OBJECT_ID(#{targetTableName}, 'U') IS NOT NULL
drop table ${targetTableName};
create table ${targetTableName}
(
ID int not null
, ProjectID nvarchar(32) primary key
, MainCoff_Rent decimal(7, 4)
, RentPrice decimal(18, 2)
, MainRentPrice decimal(18, 2)
, RentPrice_1 decimal(18, 2)
, VOPPAT varchar(64)
, VOPPA decimal(18, 6)
, ModifyDate date
)
</update>
<update id="createUltimateTable">
<bind name="targetTableName" value="'dbo.ODS_PROJECT_RENT_PRICE_INFO_' + yearMonth"/>
IF OBJECT_ID(#{targetTableName}, 'U') IS NOT NULL
drop table ${targetTableName};
create table ${targetTableName}
(
ID int primary key identity
, ProjectID nvarchar(32) not null
, PriceType int
, BasePrice_1 decimal(18, 2)
, RentPrice decimal(18, 2)
, SumCase1 int
, VOPPAT varchar(64)
, VOPPA decimal(18, 6)
, GF_1Room decimal(18, 2)
, GF_2Room decimal(18, 2)
, GY_2Room decimal(18, 2)
, GY_3Room decimal(18, 2)
, One_Room decimal(18, 2)
, Two_Room decimal(18, 2)
, Three_Room decimal(18, 2)
, EntireRentRatio decimal(18, 4)
, EntireRentNum int
, ShareRentRatio decimal(18, 4)
, ShareRentNum int
, SaleRentRatio decimal(18, 4)
, ModifyDate date
, Status int
, AdjEvd nvarchar(1024)
)
</update>
</mapper>

View File

@ -2,8 +2,8 @@
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.project.data.cases.mapper.OriginalResidenceRentOpeningCaseMapper">
<mapper namespace="com.uvaluation.project.data.cases.mapper.OriginalResidenceRentOpeningCaseMapper">
<!--挂牌案例-->
<update id="createTable">
<bind name="targetTableName" value="'dbo.ODS_HOUSINGCASELISTED_RENT_LJ_' + yearMonth +'_RAW' "/>
IF OBJECT_ID(#{targetTableName}, 'U') IS NOT NULL
@ -134,6 +134,7 @@
savetime date NULL
)
</update>
<!-- 挂牌清洗案例-->
<update id="createCleanTable">
<bind name="targetTableName" value="'dbo.ODS_HOUSINGCASELISTED_RENT_' + yearMonth"/>
IF OBJECT_ID(#{targetTableName}, 'U') IS NOT NULL
@ -192,179 +193,4 @@
, CaseName nvarchar(1024)
);
</update>
<update id="createAssembleTable">
<bind name="targetTableName" value="'dbo.DW_HOUSINGCASE_COMM_' + yearMonth"/>
IF OBJECT_ID(#{targetTableName}, 'U') IS NOT NULL
drop table ${targetTableName};
create table ${targetTableName}
(
SID int primary key identity
, case_id varchar(32) not null
, HouseholdsID_LJ bigint
, ProjectID_LJ bigint
, ProjectID bigint --modified
, ProjectName nvarchar(1024)
, ProjectAddr nvarchar(1024)
, County nvarchar(512)
, Block nvarchar(512)
, Loop nvarchar(512)
, Roomtype nvarchar(64)
, Area decimal(18, 2)
, Towards nvarchar(64)
, UpperFloorSum nvarchar(32)
, UpperFloorNum nvarchar(32)
, Elevator tinyint
, Decoration nvarchar(64)
, Year int
, AreaCoff decimal(7, 4)
, TowardsCoff decimal(7, 4)
, FloorCoff decimal(7, 4)
, DecorationRng int
, YearCoff decimal(7, 4)
, BuildingCoff decimal(7, 4)
, BasePrice_1 decimal(18, 2)
, PriceTotal decimal(18, 2) not null
, PriceUnit decimal(18, 2) not null
, PriceUnitAdj decimal(18, 2) not null
, Visited_Num int
, First_Visit_Time date
, Visited_Num_15 int
, Visited_Num_30 int
, Status tinyint
, AdjustedValue decimal(18, 2)
, AdjustedPst decimal(18, 6)
, AdjustedCumValue decimal(18, 2)
, AdjustedCumPst decimal(18, 6)
, AdjustedCumValueAbs decimal(18, 2)
, AdjustedCumPstAbs decimal(18, 6)
, AdjustedCumNum int
, PriceTotalIn decimal(18, 2)
, PriceDateIn date
, CaseType int
, RangeFlag int
);
</update>
<update id="createComputePriceTable">
<bind name="targetTableName" value="'dbo.DWA_PROJECTBASEPRICE_IMDT_' + yearMonth"/>
IF OBJECT_ID(#{targetTableName}, 'U') IS NOT NULL
drop table ${targetTableName};
create table ${targetTableName}
(
SID int not null identity(1,1)
, ProjectID nvarchar(20) primary key
, ProjectName nvarchar(1024)
, ProjectAddr nvarchar(1024)
, County nvarchar(512)
, Block nvarchar(512)
, Loop nvarchar(512)
, IsIndxGen tinyint
, IsPstCalc tinyint
, StatusRun tinyint
, ProjectSPLabel nvarchar(64)
, PropertyType nvarchar(256)
, ProjectType nvarchar(256)
, ProjectTypeDtl nvarchar(256)
, ProjectLevel nvarchar(64)
, Year int
, MainArea decimal(18, 2)
, AreaCoff decimal(7, 4)
, YearCoff decimal(7, 4)
, PriceNote nvarchar(1024)
, BasePriceDft decimal(18, 2)
, MainPriceDft decimal(18, 2)
, BasePrice_1 decimal(18, 2)
, PriceUnitAdj decimal(18, 2)
, Visited_Num int
, First_Visit_Time date
, Visited_Num_15 int
, Visited_Num_30 int
, PriceDealMean_1 decimal(18, 2)
, PriceDealMax_1 decimal(18, 2)
, SumDeal_1 int
, PriceDealMean decimal(18, 2)
, PriceDealMax decimal(18, 2)
, SumDeal int
, PriceListedMin decimal(18, 2)
, PriceCase1_ToAI_Pst decimal(18, 6)
, PriceCase2_ToAI_Pst decimal(18, 6)
, PriceCase1_ToLst_Pst decimal(18, 6)
, PriceCase2_ToLst_Pst decimal(18, 6)
, PriceCase1 decimal(18, 2)
, PriceCase1AdjPst decimal(18, 6)
, SumCase1 int
, PriceCase2 decimal(18, 2)
, PriceCase2AdjPst decimal(18, 6)
, SumCase2 int
, VOPPBT varchar(64)
, VOPPB decimal(18, 6)
, BindProjID int
, Bind_Proj_Pst decimal(18, 6)
, Bind_Block_Class nvarchar(128)
, Bind_Block_Class_Pst decimal(18, 6)
, Bind_Block_Plevel nvarchar(128)
, Bind_Block_Plevel_Pst decimal(18, 6)
, Bind_Block_PType nvarchar(128)
, Bind_Block_Ptype_Pst decimal(18, 6)
, Bind_County_PType nvarchar(128)
, Bind_County_Ptype_Pst decimal(18, 6)
, VOPPAT varchar(64)
, VOPPA decimal(18, 6)
);
</update>
<!-- 人工修正表 -->
<update id="createArtificialPriceTable">
<bind name="targetTableName" value="'dbo.DWA_PROJECTBASEPRICE_RENT_MANU_' + yearMonth"/>
IF OBJECT_ID(#{targetTableName}, 'U') IS NOT NULL
drop table ${targetTableName};
create table ${targetTableName}
(
id uniqueidentifier not null
, ProjectID bigint primary key
, MainCoff_Rent decimal(7, 4)
, RentPrice decimal(18, 2)
, MainRentPrice decimal(18, 2)
, RentPrice_1 decimal(18, 2)
, VOPPAT varchar(64)
, VOPPA decimal(18, 6)
, ModifyDate date
);
</update>
<!-- 核准住宅租赁基价 -->
<update id="createUltimatePriceTable">
<bind name="targetTableName" value="'dbo.ODS_PROJECT_RENT_PRICE_INFO_' + yearMonth"/>
IF OBJECT_ID(#{targetTableName}, 'U') IS NOT NULL
drop table ${targetTableName};
create table ${targetTableName}
(
id varchar(32) primary key
, ProjectID bigint not null
, PriceType int
, BasePrice_1 decimal(18, 2)
, RentPrice decimal(18, 2)
, SumCase1 int
, VOPPAT varchar(64)
, VOPPA decimal(18, 6)
, GF_1Room decimal(18, 2)
, GF_2Room decimal(18, 2)
, GY_2Room decimal(18, 2)
, GY_3Room decimal(18, 2)
, One_Room decimal(18, 2)
, Two_Room decimal(18, 2)
, Three_Room decimal(18, 2)
, EntireRentRatio decimal(18, 4)
, EntireRentNum int
, ShareRentRatio decimal(18, 4)
, ShareRentNum int
, SaleRentRatio decimal(18, 4)
, ModifyDate date
, Status bit
, AdjEvd nvarchar(1024)
);
</update>
</mapper>

View File

@ -2,7 +2,7 @@
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.project.data.cases.mapper.OriginalResidenceSaleClosingCaseMapper">
<mapper namespace="com.uvaluation.project.data.cases.mapper.OriginalResidenceSaleClosingCaseMapper">
<update id="createRawClosingCaseTable">
<bind name="targetTableName" value="'dbo.二手房成交数据' + yearMonth" />

View File

@ -2,7 +2,7 @@
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.project.data.cases.mapper.OriginalResidenceSaleOpeningCaseMapper">
<mapper namespace="com.uvaluation.project.data.cases.mapper.OriginalResidenceSaleOpeningCaseMapper">
<!--案例原始表-->
<update id="createOpeningCaseRawTable">
<bind name="targetTableName" value="'dbo.ODS_HOUSINGCASELISTED_LJ_' + yearMonth +'_RAW'"/>

View File

@ -2,7 +2,7 @@
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.project.data.cases.mapper.sync.SyncOriginalResidenceSaleOpeningCaseMapper">
<mapper namespace="com.uvaluation.project.data.cases.mapper.sync.SyncOriginalResidenceSaleOpeningCaseMapper">
<update id="createTable">
<bind name="targetTableName" value="'dbo.ODS_HOUSINGCASELISTED_LJ_' + yearMonth + '_RAW'"/>
IF OBJECT_ID(#{targetTableName}, 'U') IS NULL
@ -35,7 +35,7 @@
truncate table ${targetTableName}
</update>
<insert id="insert" parameterType="com.ruoyi.project.data.cases.domain.OriginalResidenceSaleOpeningCase">
<insert id="insert" parameterType="com.uvaluation.project.data.cases.domain.OriginalResidenceSaleOpeningCase">
insert into dbo.ODS_HOUSINGCASELISTED_LJ_${yearMonth}_RAW
(
llid

View File

@ -2,12 +2,12 @@
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.project.data.basis.mapper.UVBasePriceMapper">
<mapper namespace="com.uvaluation.project.data.basis.mapper.UVBasePriceMapper">
<!-- <resultMap id="resultMapping" type="com.ruoyi.project.data.basis.domain.UVBasePrice">-->
<!-- -->
<!-- </resultMap>-->
<select id="pageCount"
parameterType="com.ruoyi.project.data.basis.domain.UVBasePriceQueryModel"
parameterType="com.uvaluation.project.data.basis.domain.UVBasePriceQueryModel"
resultType="int">
select count(1) from dbo.TLK_基价信息
<where>
@ -26,8 +26,8 @@
</where>
</select>
<select id="pageList"
parameterType="com.ruoyi.project.data.basis.domain.UVBasePriceQueryModel"
resultType="com.ruoyi.project.data.basis.domain.UVBasePrice">
parameterType="com.uvaluation.project.data.basis.domain.UVBasePriceQueryModel"
resultType="com.uvaluation.project.data.basis.domain.UVBasePrice">
<!-- <bind name="skip" value=" (pageIndex - 1) * pageSize "></bind>-->
SELECT ITEM_AIRAID as communityId
,ITEM_PROJECTTYPE as communityType

View File

@ -2,9 +2,9 @@
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.project.data.price.mapper.UltimateOfficeBasePriceMapper">
<mapper namespace="com.uvaluation.project.data.price.mapper.UltimateOfficeBasePriceMapper">
<resultMap type="com.ruoyi.project.data.price.domain.UltimateOfficeBasePrice"
<resultMap type="com.uvaluation.project.data.price.domain.UltimateOfficeBasePrice"
id="OfficeBasePriceUltimateResult">
<result property="id" column="id"/>
<result property="yearMonth" column="yearMonth"/>
@ -76,7 +76,7 @@
FROM ODS_OFFICE_BUILDING_PRICE_INFO_${yearMonth} a
</sql>
<select id="getCount" parameterType="com.ruoyi.project.data.price.domain.UltimateOfficeBasePrice" resultType="int">
<select id="getCount" parameterType="com.uvaluation.project.data.price.domain.UltimateOfficeBasePrice" resultType="int">
select count(1) FROM ODS_OFFICE_BUILDING_PRICE_INFO_${yearMonth} a
<where>
<if test="communityId != null">
@ -101,7 +101,7 @@
</where>
</select>
<select id="getList" parameterType="com.ruoyi.project.data.price.domain.UltimateOfficeBasePrice"
<select id="getList" parameterType="com.uvaluation.project.data.price.domain.UltimateOfficeBasePrice"
resultMap="OfficeBasePriceUltimateResult">
<include refid="getById"/>
<where>
@ -138,7 +138,7 @@
</select>
<!-- 更新基价 -->
<update id="updateBasePrice" parameterType="com.ruoyi.project.data.price.domain.OfficeBasePriceModifyModel">
<update id="updateBasePrice" parameterType="com.uvaluation.project.data.price.domain.OfficeBasePriceModifyModel">
update ODS_OFFICE_BUILDING_PRICE_INFO_${yearMonth} set Status=0 where id=#{id};
</update>
<insert id="batchInsertArtificialOfficeBase">
@ -150,7 +150,7 @@
</foreach>
</insert>
<!-- 更新基价 -->
<insert id="updateBasePriceCopyNew" parameterType="com.ruoyi.project.data.price.domain.OfficeBasePriceModifyModel">
<insert id="updateBasePriceCopyNew" parameterType="com.uvaluation.project.data.price.domain.OfficeBasePriceModifyModel">
insert into ODS_OFFICE_BUILDING_PRICE_INFO_${yearMonth}(BuildingID
,UnifiedID
,ProjectID
@ -185,14 +185,14 @@
</insert>
<!-- 获取表名 -->
<select id="getYearMonthList" resultType="com.ruoyi.project.common.VueSelectModel">
<select id="getYearMonthList" resultType="com.uvaluation.project.common.VueSelectModel">
SELECT right(name,6) as value, right(name,6) as label
FROM sys.tables
where name like 'ODS_OFFICE_BUILDING_PRICE_INFO_%' and name not like '%_bak'
order by cast(right(name,6) as int) desc
</select>
<!-- -->
<select id="getByBuildingId" resultType="com.ruoyi.project.data.price.domain.UltimateOfficeBasePrice">
<select id="getByBuildingId" resultType="com.uvaluation.project.data.price.domain.UltimateOfficeBasePrice">
select ID
,BuildingID_P as buildingId
,ProjectID_P as communityId
@ -210,7 +210,7 @@
where BuildingID_P=#{buildingId} AND status= 1
</select>
<!-- 查询价格 -->
<select id="getByRouteId" resultType="com.ruoyi.project.data.price.domain.UltimateOfficeBasePrice">
<select id="getByRouteId" resultType="com.uvaluation.project.data.price.domain.UltimateOfficeBasePrice">
SELECT ID
,BuildingID_P as buildingId
,ProjectID_P as communityId
@ -229,7 +229,7 @@
</select>
<!-- 插入人工修正办公基价 -->
<insert id="insertArtificialOfficeBasePrice"
parameterType="com.ruoyi.project.data.price.domain.UltimateOfficeBasePrice">
parameterType="com.uvaluation.project.data.price.domain.UltimateOfficeBasePrice">
insert into
dbo.DWA_PROJECTBASEPRICE_OFFICE_MANU_${yearMonth}(ID,BuildingID,ProjectID,County,"Loop",Block,ProjectAddr,ProjectName,Year,AvgArea,TotalFloorSum,UpperFloorSum,OfficeClass,Grade,MainPrice_1,MainPriceRent_1,MainPrice,MainPriceRent,ModifyDate)
values(#{id},#{buildingId},#{communityId},#{countyName},#{loopName},#{blockName},#{communityAddress},#{communityName},#{year},#{avgArea},#{totalFloorSum},#{upperFloorSum},#{officeClass},#{officeLevel},#{mainPrice_1},#{mainPriceRent_1},#{mainPrice},#{mainPriceRent},getdate())
@ -312,7 +312,7 @@
from ODS_OFFICE_BUILDING_PRICE_INFO_${yearMonth}
where id=#{id};
</update>
<update id="initImport">
<update id="initProcedure">
IF OBJECT_ID('BatchImportOfArtificialOfficePrice', 'P') IS NOT NULL
drop procedure BatchImportOfArtificialOfficePrice;
</update>

View File

@ -2,12 +2,20 @@
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.project.data.price.mapper.UltimateResidenceRentPriceMapper">
<mapper namespace="com.uvaluation.project.data.price.mapper.UltimateResidenceRentPriceMapper">
<resultMap type="com.ruoyi.project.data.price.domain.UltimateResidenceRentBasePrice"
<resultMap type="com.uvaluation.project.data.price.domain.UltimateResidenceRentBasePrice"
id="MappingResult">
<result property="id" column="id"/>
<result property="communityId" column="projectID"/>
<result property="communityName" column="ProjectName"/>
<result property="communityAddress" column="ProjectAddr"/>
<result property="county" column="county"/>
<result property="block" column="block"/>
<result property="loop" column="loop"/>
<result property="interCommunity" column="InterCommunity"/>
<result property="magnetSchool" column="MagnetSchool"/>
<result property="loop" column="loop"/>
<result property="priceType" column="priceType"/>
<result property="basePrice_1" column="basePrice_1"/>
<result property="rentPrice" column="rentPrice"/>
@ -32,38 +40,72 @@
</resultMap>
<sql id="selectAllColumn">
select
ID,ProjectID,PriceType,BasePrice_1,RentPrice,SumCase1,VOPPAT,VOPPA,GF_1Room,GF_2Room,GY_2Room,GY_3Room,One_Room,Two_Room,Three_Room,EntireRentRatio,EntireRentNum,ShareRentRatio,ShareRentNum,SaleRentRatio,ModifyDate,Status,AdjEvd
from ODS_PROJECT_RENT_PRICE_INFO_${yearMonth}
SELECT a.id,
A.ProjectID,
B.ProjectName,
B.ProjectAddr,
B.County,
B.Block,
B.Loop,
B.InterCommunity,
B.MagnetSchool,
B.ProjectLevel,
B.RoomNum,
A.BasePrice_1,
A.RentPrice,
A.SumCase1,
A.VOPPA,
A.GF_1Room,
A.GF_2Room,
A.GY_2Room,
A.GY_3Room,
A.One_Room,
A.Two_Room,
A.Three_Room,
A.EntireRentRatio,
A.EntireRentNum,
A.ShareRentRatio,
A.ShareRentNum,
A.SaleRentRatio,
a.status,
a.adjEvd,
a.modifyDate
FROM ODS_PROJECT_RENT_PRICE_INFO_${yearMonth} A
LEFT JOIN obpm_LianCheng_Data.dbo.V_RESIDENCE_COMMUNITY B
ON A.ProjectID = B.projectid
</sql>
<select id="selectPageCount" parameterType="com.ruoyi.project.data.price.domain.UltimateResidenceRentBasePrice" resultType="int">
select count(1) from ODS_PROJECT_RENT_PRICE_INFO_${yearMonth}
<select id="selectPageCount" parameterType="com.uvaluation.project.data.price.domain.UltimateResidenceRentBasePrice" resultType="int">
select count(1) from ODS_PROJECT_RENT_PRICE_INFO_${yearMonth} a LEFT JOIN
obpm_LianCheng_Data.dbo.V_RESIDENCE_COMMUNITY B
ON A.ProjectID = B.projectid
<where>
B.projectid is not null
<if test="communityId != null">
AND ProjectID = #{communityId}
AND a.ProjectID = #{communityId}
</if>
<if test="status != null">
AND Status = #{status}
AND a.Status = #{status}
</if>
</where>
</select>
<select id="selectPageList" parameterType="com.ruoyi.project.data.price.domain.UltimateResidenceRentBasePrice"
<select id="selectPageList" parameterType="com.uvaluation.project.data.price.domain.UltimateResidenceRentBasePrice"
resultMap="MappingResult">
<include refid="selectAllColumn"/>
<where>
B.projectid is not null
<if test="communityId != null">
AND ProjectID = #{communityId}
AND a.ProjectID = #{communityId}
</if>
<if test="status != null">
AND Status = #{status}
AND a.Status = #{status}
</if>
</where>
order by ProjectID ASC, status DESC OFFSET #{pageIndex} rows fetch next #{pageSize} rows only;
order by a.ProjectID ASC, a.status DESC OFFSET #{pageIndex} rows fetch next #{pageSize} rows only;
</select>
<select id="yearMonthList" resultType="com.ruoyi.project.common.VueSelectModel">
<select id="yearMonthList" resultType="com.uvaluation.project.common.VueSelectModel">
SELECT right(name,6) as value, right(name,6) as label
FROM sys.tables
where name like 'ODS_PROJECT_RENT_PRICE_INFO_%' and name not like '%_bak'

View File

@ -2,9 +2,9 @@
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.project.data.price.mapper.UltimateResidenceSalePriceMapper">
<mapper namespace="com.uvaluation.project.data.price.mapper.UltimateResidenceSalePriceMapper">
<resultMap type="com.ruoyi.project.data.price.domain.UltimateResidenceSaleBasePrice"
<resultMap type="com.uvaluation.project.data.price.domain.UltimateResidenceSaleBasePrice"
id="MainMappingResult">
<result property="id" column="id"/>
<result property="yearMonth" column="yearMonth"/>
@ -43,7 +43,7 @@
</sql>
<!-- 分页总数 -->
<select id="selectPageCount"
parameterType="com.ruoyi.project.data.price.domain.UltimateResidenceSaleBasePrice" resultType="int">
parameterType="com.uvaluation.project.data.price.domain.UltimateResidenceSaleBasePrice" resultType="int">
select count(1) from dbo.ODS_PROJECT_PRICE_INFO_${yearMonth}
<where>
<if test="communityId != null">
@ -56,7 +56,7 @@
</select>
<!-- 分页列表 -->
<select id="selectPageList"
parameterType="com.ruoyi.project.data.price.domain.UltimateResidenceSaleBasePrice"
parameterType="com.uvaluation.project.data.price.domain.UltimateResidenceSaleBasePrice"
resultMap="MainMappingResult">
<include refid="selectAllField"/>
<where>
@ -71,7 +71,7 @@
</select>
<!-- 获取表名 -->
<select id="yearMonthList" resultType="com.ruoyi.project.common.VueSelectModel">
<select id="yearMonthList" resultType="com.uvaluation.project.common.VueSelectModel">
SELECT right(name,6) as value, right(name,6) as label
FROM sys.tables
where name like 'ODS_PROJECT_PRICE_INFO_%' and name not like '%_bak'

View File

@ -1,57 +1,57 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.project.monitor.mapper.SysLogininforMapper">
<resultMap type="SysLogininfor" id="SysLogininforResult">
<id property="infoId" column="info_id" />
<result property="userName" column="user_name" />
<result property="status" column="status" />
<result property="ipaddr" column="ipaddr" />
<result property="loginLocation" column="login_location" />
<result property="browser" column="browser" />
<result property="os" column="os" />
<result property="msg" column="msg" />
<result property="loginTime" column="login_time" />
</resultMap>
<insert id="insertLogininfor" parameterType="SysLogininfor">
insert into sys_logininfor (user_name, status, ipaddr, login_location, browser, os, msg, login_time)
values (#{userName}, #{status}, #{ipaddr}, #{loginLocation}, #{browser}, #{os}, #{msg}, sysdate())
</insert>
<select id="selectLogininforList" parameterType="SysLogininfor" resultMap="SysLogininforResult">
select info_id, user_name, ipaddr, login_location, browser, os, status, msg, login_time from sys_logininfor
<where>
<if test="ipaddr != null and ipaddr != ''">
AND ipaddr like concat('%', #{ipaddr}, '%')
</if>
<if test="status != null and status != ''">
AND status = #{status}
</if>
<if test="userName != null and userName != ''">
AND user_name like concat('%', #{userName}, '%')
</if>
<if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
and date_format(login_time,'%y%m%d') &gt;= date_format(#{beginTime},'%y%m%d')
</if>
<if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
and date_format(login_time,'%y%m%d') &lt;= date_format(#{endTime},'%y%m%d')
</if>
</where>
order by info_id desc
</select>
<delete id="deleteLogininforByIds" parameterType="Long">
delete from sys_logininfor where info_id in
<foreach collection="array" item="infoId" open="(" separator="," close=")">
#{infoId}
</foreach>
</delete>
<update id="cleanLogininfor">
truncate table sys_logininfor
</update>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.uvaluation.project.monitor.mapper.SysLogininforMapper">
<resultMap type="SysLogininfor" id="SysLogininforResult">
<id property="infoId" column="info_id" />
<result property="userName" column="user_name" />
<result property="status" column="status" />
<result property="ipaddr" column="ipaddr" />
<result property="loginLocation" column="login_location" />
<result property="browser" column="browser" />
<result property="os" column="os" />
<result property="msg" column="msg" />
<result property="loginTime" column="login_time" />
</resultMap>
<insert id="insertLogininfor" parameterType="SysLogininfor">
insert into sys_logininfor (user_name, status, ipaddr, login_location, browser, os, msg, login_time)
values (#{userName}, #{status}, #{ipaddr}, #{loginLocation}, #{browser}, #{os}, #{msg}, sysdate())
</insert>
<select id="selectLogininforList" parameterType="SysLogininfor" resultMap="SysLogininforResult">
select info_id, user_name, ipaddr, login_location, browser, os, status, msg, login_time from sys_logininfor
<where>
<if test="ipaddr != null and ipaddr != ''">
AND ipaddr like concat('%', #{ipaddr}, '%')
</if>
<if test="status != null and status != ''">
AND status = #{status}
</if>
<if test="userName != null and userName != ''">
AND user_name like concat('%', #{userName}, '%')
</if>
<if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
and date_format(login_time,'%y%m%d') &gt;= date_format(#{beginTime},'%y%m%d')
</if>
<if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
and date_format(login_time,'%y%m%d') &lt;= date_format(#{endTime},'%y%m%d')
</if>
</where>
order by info_id desc
</select>
<delete id="deleteLogininforByIds" parameterType="Long">
delete from sys_logininfor where info_id in
<foreach collection="array" item="infoId" open="(" separator="," close=")">
#{infoId}
</foreach>
</delete>
<update id="cleanLogininfor">
truncate table sys_logininfor
</update>
</mapper>

View File

@ -1,83 +1,83 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.project.monitor.mapper.SysOperLogMapper">
<resultMap type="SysOperLog" id="SysOperLogResult">
<id property="operId" column="oper_id" />
<result property="title" column="title" />
<result property="businessType" column="business_type" />
<result property="method" column="method" />
<result property="requestMethod" column="request_method" />
<result property="operatorType" column="operator_type" />
<result property="operName" column="oper_name" />
<result property="deptName" column="dept_name" />
<result property="operUrl" column="oper_url" />
<result property="operIp" column="oper_ip" />
<result property="operLocation" column="oper_location" />
<result property="operParam" column="oper_param" />
<result property="jsonResult" column="json_result" />
<result property="status" column="status" />
<result property="errorMsg" column="error_msg" />
<result property="operTime" column="oper_time" />
</resultMap>
<sql id="selectOperLogVo">
select oper_id, title, business_type, method, request_method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_location, oper_param, json_result, status, error_msg, oper_time
from sys_oper_log
</sql>
<insert id="insertOperlog" parameterType="SysOperLog">
insert into sys_oper_log(title, business_type, method, request_method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_location, oper_param, json_result, status, error_msg, oper_time)
values (#{title}, #{businessType}, #{method}, #{requestMethod}, #{operatorType}, #{operName}, #{deptName}, #{operUrl}, #{operIp}, #{operLocation}, #{operParam}, #{jsonResult}, #{status}, #{errorMsg}, sysdate())
</insert>
<select id="selectOperLogList" parameterType="SysOperLog" resultMap="SysOperLogResult">
<include refid="selectOperLogVo"/>
<where>
<if test="title != null and title != ''">
AND title like concat('%', #{title}, '%')
</if>
<if test="businessType != null and businessType != ''">
AND business_type = #{businessType}
</if>
<if test="businessTypes != null and businessTypes.length > 0">
AND business_type in
<foreach collection="businessTypes" item="businessType" open="(" separator="," close=")">
#{businessType}
</foreach>
</if>
<if test="status != null">
AND status = #{status}
</if>
<if test="operName != null and operName != ''">
AND oper_name like concat('%', #{operName}, '%')
</if>
<if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
and date_format(oper_time,'%y%m%d') &gt;= date_format(#{beginTime},'%y%m%d')
</if>
<if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
and date_format(oper_time,'%y%m%d') &lt;= date_format(#{endTime},'%y%m%d')
</if>
</where>
order by oper_id desc
</select>
<delete id="deleteOperLogByIds" parameterType="Long">
delete from sys_oper_log where oper_id in
<foreach collection="array" item="operId" open="(" separator="," close=")">
#{operId}
</foreach>
</delete>
<select id="selectOperLogById" parameterType="Long" resultMap="SysOperLogResult">
<include refid="selectOperLogVo"/>
where oper_id = #{operId}
</select>
<update id="cleanOperLog">
truncate table sys_oper_log
</update>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.uvaluation.project.monitor.mapper.SysOperLogMapper">
<resultMap type="SysOperLog" id="SysOperLogResult">
<id property="operId" column="oper_id" />
<result property="title" column="title" />
<result property="businessType" column="business_type" />
<result property="method" column="method" />
<result property="requestMethod" column="request_method" />
<result property="operatorType" column="operator_type" />
<result property="operName" column="oper_name" />
<result property="deptName" column="dept_name" />
<result property="operUrl" column="oper_url" />
<result property="operIp" column="oper_ip" />
<result property="operLocation" column="oper_location" />
<result property="operParam" column="oper_param" />
<result property="jsonResult" column="json_result" />
<result property="status" column="status" />
<result property="errorMsg" column="error_msg" />
<result property="operTime" column="oper_time" />
</resultMap>
<sql id="selectOperLogVo">
select oper_id, title, business_type, method, request_method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_location, oper_param, json_result, status, error_msg, oper_time
from sys_oper_log
</sql>
<insert id="insertOperlog" parameterType="SysOperLog">
insert into sys_oper_log(title, business_type, method, request_method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_location, oper_param, json_result, status, error_msg, oper_time)
values (#{title}, #{businessType}, #{method}, #{requestMethod}, #{operatorType}, #{operName}, #{deptName}, #{operUrl}, #{operIp}, #{operLocation}, #{operParam}, #{jsonResult}, #{status}, #{errorMsg}, sysdate())
</insert>
<select id="selectOperLogList" parameterType="SysOperLog" resultMap="SysOperLogResult">
<include refid="selectOperLogVo"/>
<where>
<if test="title != null and title != ''">
AND title like concat('%', #{title}, '%')
</if>
<if test="businessType != null and businessType != ''">
AND business_type = #{businessType}
</if>
<if test="businessTypes != null and businessTypes.length > 0">
AND business_type in
<foreach collection="businessTypes" item="businessType" open="(" separator="," close=")">
#{businessType}
</foreach>
</if>
<if test="status != null">
AND status = #{status}
</if>
<if test="operName != null and operName != ''">
AND oper_name like concat('%', #{operName}, '%')
</if>
<if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
and date_format(oper_time,'%y%m%d') &gt;= date_format(#{beginTime},'%y%m%d')
</if>
<if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
and date_format(oper_time,'%y%m%d') &lt;= date_format(#{endTime},'%y%m%d')
</if>
</where>
order by oper_id desc
</select>
<delete id="deleteOperLogByIds" parameterType="Long">
delete from sys_oper_log where oper_id in
<foreach collection="array" item="operId" open="(" separator="," close=")">
#{operId}
</foreach>
</delete>
<select id="selectOperLogById" parameterType="Long" resultMap="SysOperLogResult">
<include refid="selectOperLogVo"/>
where oper_id = #{operId}
</select>
<update id="cleanOperLog">
truncate table sys_oper_log
</update>
</mapper>

View File

@ -1,112 +1,112 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.project.system.mapper.SysConfigMapper">
<resultMap type="SysConfig" id="SysConfigResult">
<id property="configId" column="config_id" />
<result property="configName" column="config_name" />
<result property="configKey" column="config_key" />
<result property="configValue" column="config_value" />
<result property="configType" column="config_type" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectConfigVo">
select config_id, config_name, config_key, config_value, config_type, create_by, create_time, update_by, update_time, remark
from sys_config
</sql>
<!-- 查询条件 -->
<sql id="sqlwhereSearch">
<where>
<if test="configId !=null">
and config_id = #{configId}
</if>
<if test="configKey !=null and configKey != ''">
and config_key = #{configKey}
</if>
</where>
</sql>
<select id="selectConfig" parameterType="SysConfig" resultMap="SysConfigResult">
<include refid="selectConfigVo"/>
<include refid="sqlwhereSearch"/>
</select>
<select id="selectConfigList" parameterType="SysConfig" resultMap="SysConfigResult">
<include refid="selectConfigVo"/>
<where>
<if test="configName != null and configName != ''">
AND config_name like concat('%', #{configName}, '%')
</if>
<if test="configType != null and configType != ''">
AND config_type = #{configType}
</if>
<if test="configKey != null and configKey != ''">
AND config_key like concat('%', #{configKey}, '%')
</if>
<if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
and date_format(create_time,'%y%m%d') &gt;= date_format(#{beginTime},'%y%m%d')
</if>
<if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
and date_format(create_time,'%y%m%d') &lt;= date_format(#{endTime},'%y%m%d')
</if>
</where>
</select>
<select id="checkConfigKeyUnique" parameterType="String" resultMap="SysConfigResult">
<include refid="selectConfigVo"/>
where config_key = #{configKey}
</select>
<insert id="insertConfig" parameterType="SysConfig">
insert into sys_config (
<if test="configName != null and configName != '' ">config_name,</if>
<if test="configKey != null and configKey != '' ">config_key,</if>
<if test="configValue != null and configValue != '' ">config_value,</if>
<if test="configType != null and configType != '' ">config_type,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
<if test="remark != null and remark != ''">remark,</if>
create_time
)values(
<if test="configName != null and configName != ''">#{configName},</if>
<if test="configKey != null and configKey != ''">#{configKey},</if>
<if test="configValue != null and configValue != ''">#{configValue},</if>
<if test="configType != null and configType != ''">#{configType},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
<if test="remark != null and remark != ''">#{remark},</if>
sysdate()
)
</insert>
<update id="updateConfig" parameterType="SysConfig">
update sys_config
<set>
<if test="configName != null and configName != ''">config_name = #{configName},</if>
<if test="configKey != null and configKey != ''">config_key = #{configKey},</if>
<if test="configValue != null and configValue != ''">config_value = #{configValue},</if>
<if test="configType != null and configType != ''">config_type = #{configType},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
<if test="remark != null">remark = #{remark},</if>
update_time = sysdate()
</set>
where config_id = #{configId}
</update>
<delete id="deleteConfigById" parameterType="Long">
delete from sys_config where config_id = #{configId}
</delete>
<delete id="deleteConfigByIds" parameterType="Long">
delete from sys_config where config_id in
<foreach item="configId" collection="array" open="(" separator="," close=")">
#{configId}
</foreach>
</delete>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.uvaluation.project.system.mapper.SysConfigMapper">
<resultMap type="SysConfig" id="SysConfigResult">
<id property="configId" column="config_id" />
<result property="configName" column="config_name" />
<result property="configKey" column="config_key" />
<result property="configValue" column="config_value" />
<result property="configType" column="config_type" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectConfigVo">
select config_id, config_name, config_key, config_value, config_type, create_by, create_time, update_by, update_time, remark
from sys_config
</sql>
<!-- 查询条件 -->
<sql id="sqlwhereSearch">
<where>
<if test="configId !=null">
and config_id = #{configId}
</if>
<if test="configKey !=null and configKey != ''">
and config_key = #{configKey}
</if>
</where>
</sql>
<select id="selectConfig" parameterType="SysConfig" resultMap="SysConfigResult">
<include refid="selectConfigVo"/>
<include refid="sqlwhereSearch"/>
</select>
<select id="selectConfigList" parameterType="SysConfig" resultMap="SysConfigResult">
<include refid="selectConfigVo"/>
<where>
<if test="configName != null and configName != ''">
AND config_name like concat('%', #{configName}, '%')
</if>
<if test="configType != null and configType != ''">
AND config_type = #{configType}
</if>
<if test="configKey != null and configKey != ''">
AND config_key like concat('%', #{configKey}, '%')
</if>
<if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
and date_format(create_time,'%y%m%d') &gt;= date_format(#{beginTime},'%y%m%d')
</if>
<if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
and date_format(create_time,'%y%m%d') &lt;= date_format(#{endTime},'%y%m%d')
</if>
</where>
</select>
<select id="checkConfigKeyUnique" parameterType="String" resultMap="SysConfigResult">
<include refid="selectConfigVo"/>
where config_key = #{configKey}
</select>
<insert id="insertConfig" parameterType="SysConfig">
insert into sys_config (
<if test="configName != null and configName != '' ">config_name,</if>
<if test="configKey != null and configKey != '' ">config_key,</if>
<if test="configValue != null and configValue != '' ">config_value,</if>
<if test="configType != null and configType != '' ">config_type,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
<if test="remark != null and remark != ''">remark,</if>
create_time
)values(
<if test="configName != null and configName != ''">#{configName},</if>
<if test="configKey != null and configKey != ''">#{configKey},</if>
<if test="configValue != null and configValue != ''">#{configValue},</if>
<if test="configType != null and configType != ''">#{configType},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
<if test="remark != null and remark != ''">#{remark},</if>
sysdate()
)
</insert>
<update id="updateConfig" parameterType="SysConfig">
update sys_config
<set>
<if test="configName != null and configName != ''">config_name = #{configName},</if>
<if test="configKey != null and configKey != ''">config_key = #{configKey},</if>
<if test="configValue != null and configValue != ''">config_value = #{configValue},</if>
<if test="configType != null and configType != ''">config_type = #{configType},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
<if test="remark != null">remark = #{remark},</if>
update_time = sysdate()
</set>
where config_id = #{configId}
</update>
<delete id="deleteConfigById" parameterType="Long">
delete from sys_config where config_id = #{configId}
</delete>
<delete id="deleteConfigByIds" parameterType="Long">
delete from sys_config where config_id in
<foreach item="configId" collection="array" open="(" separator="," close=")">
#{configId}
</foreach>
</delete>
</mapper>

View File

@ -1,155 +1,155 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.project.system.mapper.SysDeptMapper">
<resultMap type="SysDept" id="SysDeptResult">
<id property="deptId" column="dept_id" />
<result property="parentId" column="parent_id" />
<result property="ancestors" column="ancestors" />
<result property="deptName" column="dept_name" />
<result property="orderNum" column="order_num" />
<result property="leader" column="leader" />
<result property="phone" column="phone" />
<result property="email" column="email" />
<result property="status" column="status" />
<result property="delFlag" column="del_flag" />
<result property="parentName" column="parent_name" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectDeptVo">
select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status, d.del_flag, d.create_by, d.create_time
from sys_dept d
</sql>
<select id="selectDeptList" parameterType="SysDept" resultMap="SysDeptResult">
<include refid="selectDeptVo"/>
where d.del_flag = '0'
<if test="parentId != null and parentId != 0">
AND parent_id = #{parentId}
</if>
<if test="deptName != null and deptName != ''">
AND dept_name like concat('%', #{deptName}, '%')
</if>
<if test="status != null and status != ''">
AND status = #{status}
</if>
<!-- 数据范围过滤 -->
${dataScope}
order by d.parent_id, d.order_num
</select>
<select id="selectDeptListByRoleId" parameterType="Long" resultType="Integer">
select d.dept_id, d.parent_id
from sys_dept d
left join sys_role_dept rd on d.dept_id = rd.dept_id
where rd.role_id = #{roleId}
and d.dept_id not in (select d.parent_id from sys_dept d inner join sys_role_dept rd on d.dept_id = rd.dept_id and rd.role_id = #{roleId})
order by d.parent_id, d.order_num
</select>
<select id="selectDeptById" parameterType="Long" resultMap="SysDeptResult">
<include refid="selectDeptVo"/>
where dept_id = #{deptId}
</select>
<select id="checkDeptExistUser" parameterType="Long" resultType="int">
select count(1) from sys_user where dept_id = #{deptId} and del_flag = '0'
</select>
<select id="hasChildByDeptId" parameterType="Long" resultType="int">
select count(1) from sys_dept
where del_flag = '0' and parent_id = #{deptId}
</select>
<select id="selectChildrenDeptById" parameterType="Long" resultMap="SysDeptResult">
select * from sys_dept where find_in_set(#{deptId}, ancestors)
</select>
<select id="selectNormalChildrenDeptById" parameterType="Long" resultType="int">
select count(*) from sys_dept where status = 0 and del_flag = '0' and find_in_set(#{deptId}, ancestors)
</select>
<select id="checkDeptNameUnique" resultMap="SysDeptResult">
<include refid="selectDeptVo"/>
where dept_name=#{deptName} and parent_id = #{parentId}
</select>
<insert id="insertDept" parameterType="SysDept">
insert into sys_dept(
<if test="deptId != null and deptId != 0">dept_id,</if>
<if test="parentId != null and parentId != 0">parent_id,</if>
<if test="deptName != null and deptName != ''">dept_name,</if>
<if test="ancestors != null and ancestors != ''">ancestors,</if>
<if test="orderNum != null and orderNum != ''">order_num,</if>
<if test="leader != null and leader != ''">leader,</if>
<if test="phone != null and phone != ''">phone,</if>
<if test="email != null and email != ''">email,</if>
<if test="status != null">status,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
create_time
)values(
<if test="deptId != null and deptId != 0">#{deptId},</if>
<if test="parentId != null and parentId != 0">#{parentId},</if>
<if test="deptName != null and deptName != ''">#{deptName},</if>
<if test="ancestors != null and ancestors != ''">#{ancestors},</if>
<if test="orderNum != null and orderNum != ''">#{orderNum},</if>
<if test="leader != null and leader != ''">#{leader},</if>
<if test="phone != null and phone != ''">#{phone},</if>
<if test="email != null and email != ''">#{email},</if>
<if test="status != null">#{status},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
sysdate()
)
</insert>
<update id="updateDept" parameterType="SysDept">
update sys_dept
<set>
<if test="parentId != null and parentId != 0">parent_id = #{parentId},</if>
<if test="deptName != null and deptName != ''">dept_name = #{deptName},</if>
<if test="ancestors != null and ancestors != ''">ancestors = #{ancestors},</if>
<if test="orderNum != null and orderNum != ''">order_num = #{orderNum},</if>
<if test="leader != null">leader = #{leader},</if>
<if test="phone != null">phone = #{phone},</if>
<if test="email != null">email = #{email},</if>
<if test="status != null and status != ''">status = #{status},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
update_time = sysdate()
</set>
where dept_id = #{deptId}
</update>
<update id="updateDeptChildren" parameterType="java.util.List">
update sys_dept set ancestors =
<foreach collection="depts" item="item" index="index"
separator=" " open="case dept_id" close="end">
when #{item.deptId} then #{item.ancestors}
</foreach>
where dept_id in
<foreach collection="depts" item="item" index="index"
separator="," open="(" close=")">
#{item.deptId}
</foreach>
</update>
<update id="updateDeptStatus" parameterType="SysDept">
update sys_dept
<set>
<if test="status != null and status != ''">status = #{status},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
update_time = sysdate()
</set>
where dept_id in (${ancestors})
</update>
<delete id="deleteDeptById" parameterType="Long">
update sys_dept set del_flag = '2' where dept_id = #{deptId}
</delete>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.uvaluation.project.system.mapper.SysDeptMapper">
<resultMap type="SysDept" id="SysDeptResult">
<id property="deptId" column="dept_id" />
<result property="parentId" column="parent_id" />
<result property="ancestors" column="ancestors" />
<result property="deptName" column="dept_name" />
<result property="orderNum" column="order_num" />
<result property="leader" column="leader" />
<result property="phone" column="phone" />
<result property="email" column="email" />
<result property="status" column="status" />
<result property="delFlag" column="del_flag" />
<result property="parentName" column="parent_name" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectDeptVo">
select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status, d.del_flag, d.create_by, d.create_time
from sys_dept d
</sql>
<select id="selectDeptList" parameterType="SysDept" resultMap="SysDeptResult">
<include refid="selectDeptVo"/>
where d.del_flag = '0'
<if test="parentId != null and parentId != 0">
AND parent_id = #{parentId}
</if>
<if test="deptName != null and deptName != ''">
AND dept_name like concat('%', #{deptName}, '%')
</if>
<if test="status != null and status != ''">
AND status = #{status}
</if>
<!-- 数据范围过滤 -->
${dataScope}
order by d.parent_id, d.order_num
</select>
<select id="selectDeptListByRoleId" parameterType="Long" resultType="Integer">
select d.dept_id, d.parent_id
from sys_dept d
left join sys_role_dept rd on d.dept_id = rd.dept_id
where rd.role_id = #{roleId}
and d.dept_id not in (select d.parent_id from sys_dept d inner join sys_role_dept rd on d.dept_id = rd.dept_id and rd.role_id = #{roleId})
order by d.parent_id, d.order_num
</select>
<select id="selectDeptById" parameterType="Long" resultMap="SysDeptResult">
<include refid="selectDeptVo"/>
where dept_id = #{deptId}
</select>
<select id="checkDeptExistUser" parameterType="Long" resultType="int">
select count(1) from sys_user where dept_id = #{deptId} and del_flag = '0'
</select>
<select id="hasChildByDeptId" parameterType="Long" resultType="int">
select count(1) from sys_dept
where del_flag = '0' and parent_id = #{deptId}
</select>
<select id="selectChildrenDeptById" parameterType="Long" resultMap="SysDeptResult">
select * from sys_dept where find_in_set(#{deptId}, ancestors)
</select>
<select id="selectNormalChildrenDeptById" parameterType="Long" resultType="int">
select count(*) from sys_dept where status = 0 and del_flag = '0' and find_in_set(#{deptId}, ancestors)
</select>
<select id="checkDeptNameUnique" resultMap="SysDeptResult">
<include refid="selectDeptVo"/>
where dept_name=#{deptName} and parent_id = #{parentId}
</select>
<insert id="insertDept" parameterType="SysDept">
insert into sys_dept(
<if test="deptId != null and deptId != 0">dept_id,</if>
<if test="parentId != null and parentId != 0">parent_id,</if>
<if test="deptName != null and deptName != ''">dept_name,</if>
<if test="ancestors != null and ancestors != ''">ancestors,</if>
<if test="orderNum != null and orderNum != ''">order_num,</if>
<if test="leader != null and leader != ''">leader,</if>
<if test="phone != null and phone != ''">phone,</if>
<if test="email != null and email != ''">email,</if>
<if test="status != null">status,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
create_time
)values(
<if test="deptId != null and deptId != 0">#{deptId},</if>
<if test="parentId != null and parentId != 0">#{parentId},</if>
<if test="deptName != null and deptName != ''">#{deptName},</if>
<if test="ancestors != null and ancestors != ''">#{ancestors},</if>
<if test="orderNum != null and orderNum != ''">#{orderNum},</if>
<if test="leader != null and leader != ''">#{leader},</if>
<if test="phone != null and phone != ''">#{phone},</if>
<if test="email != null and email != ''">#{email},</if>
<if test="status != null">#{status},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
sysdate()
)
</insert>
<update id="updateDept" parameterType="SysDept">
update sys_dept
<set>
<if test="parentId != null and parentId != 0">parent_id = #{parentId},</if>
<if test="deptName != null and deptName != ''">dept_name = #{deptName},</if>
<if test="ancestors != null and ancestors != ''">ancestors = #{ancestors},</if>
<if test="orderNum != null and orderNum != ''">order_num = #{orderNum},</if>
<if test="leader != null">leader = #{leader},</if>
<if test="phone != null">phone = #{phone},</if>
<if test="email != null">email = #{email},</if>
<if test="status != null and status != ''">status = #{status},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
update_time = sysdate()
</set>
where dept_id = #{deptId}
</update>
<update id="updateDeptChildren" parameterType="java.util.List">
update sys_dept set ancestors =
<foreach collection="depts" item="item" index="index"
separator=" " open="case dept_id" close="end">
when #{item.deptId} then #{item.ancestors}
</foreach>
where dept_id in
<foreach collection="depts" item="item" index="index"
separator="," open="(" close=")">
#{item.deptId}
</foreach>
</update>
<update id="updateDeptStatus" parameterType="SysDept">
update sys_dept
<set>
<if test="status != null and status != ''">status = #{status},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
update_time = sysdate()
</set>
where dept_id in (${ancestors})
</update>
<delete id="deleteDeptById" parameterType="Long">
update sys_dept set del_flag = '2' where dept_id = #{deptId}
</delete>
</mapper>

View File

@ -1,123 +1,123 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.project.system.mapper.SysDictDataMapper">
<resultMap type="SysDictData" id="SysDictDataResult">
<id property="dictCode" column="dict_code" />
<result property="dictSort" column="dict_sort" />
<result property="dictLabel" column="dict_label" />
<result property="dictValue" column="dict_value" />
<result property="dictType" column="dict_type" />
<result property="cssClass" column="css_class" />
<result property="listClass" column="list_class" />
<result property="isDefault" column="is_default" />
<result property="status" column="status" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectDictDataVo">
select dict_code, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, remark
from sys_dict_data
</sql>
<select id="selectDictDataList" parameterType="SysDictData" resultMap="SysDictDataResult">
<include refid="selectDictDataVo"/>
<where>
<if test="dictType != null and dictType != ''">
AND dict_type = #{dictType}
</if>
<if test="dictLabel != null and dictLabel != ''">
AND dict_label like concat('%', #{dictLabel}, '%')
</if>
<if test="status != null and status != ''">
AND status = #{status}
</if>
</where>
</select>
<select id="selectDictDataByType" parameterType="SysDictData" resultMap="SysDictDataResult">
<include refid="selectDictDataVo"/>
where status = '0' and dict_type = #{dictType} order by dict_sort asc
</select>
<select id="selectDictLabel" resultType="String">
select dict_label from sys_dict_data
where dict_type = #{dictType} and dict_value = #{dictValue}
</select>
<select id="selectDictDataById" parameterType="Long" resultMap="SysDictDataResult">
<include refid="selectDictDataVo"/>
where dict_code = #{dictCode}
</select>
<select id="countDictDataByType" resultType="Integer">
select count(1) from sys_dict_data where dict_type=#{dictType}
</select>
<delete id="deleteDictDataById" parameterType="Long">
delete from sys_dict_data where dict_code = #{dictCode}
</delete>
<delete id="deleteDictDataByIds" parameterType="Long">
delete from sys_dict_data where dict_code in
<foreach collection="array" item="dictCode" open="(" separator="," close=")">
#{dictCode}
</foreach>
</delete>
<update id="updateDictData" parameterType="SysDictData">
update sys_dict_data
<set>
<if test="dictSort != null and dictSort != ''">dict_sort = #{dictSort},</if>
<if test="dictLabel != null and dictLabel != ''">dict_label = #{dictLabel},</if>
<if test="dictValue != null and dictValue != ''">dict_value = #{dictValue},</if>
<if test="dictType != null and dictType != ''">dict_type = #{dictType},</if>
<if test="cssClass != null">css_class = #{cssClass},</if>
<if test="listClass != null">list_class = #{listClass},</if>
<if test="isDefault != null and isDefault != ''">is_default = #{isDefault},</if>
<if test="status != null">status = #{status},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
update_time = sysdate()
</set>
where dict_code = #{dictCode}
</update>
<update id="updateDictDataType" parameterType="String">
update sys_dict_data set dict_type = #{newDictType} where dict_type = #{oldDictType}
</update>
<insert id="insertDictData" parameterType="SysDictData">
insert into sys_dict_data(
<if test="dictSort != null and dictSort != ''">dict_sort,</if>
<if test="dictLabel != null and dictLabel != ''">dict_label,</if>
<if test="dictValue != null and dictValue != ''">dict_value,</if>
<if test="dictType != null and dictType != ''">dict_type,</if>
<if test="cssClass != null and cssClass != ''">css_class,</if>
<if test="listClass != null and listClass != ''">list_class,</if>
<if test="isDefault != null and isDefault != ''">is_default,</if>
<if test="status != null">status,</if>
<if test="remark != null and remark != ''">remark,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
create_time
)values(
<if test="dictSort != null and dictSort != ''">#{dictSort},</if>
<if test="dictLabel != null and dictLabel != ''">#{dictLabel},</if>
<if test="dictValue != null and dictValue != ''">#{dictValue},</if>
<if test="dictType != null and dictType != ''">#{dictType},</if>
<if test="cssClass != null and cssClass != ''">#{cssClass},</if>
<if test="listClass != null and listClass != ''">#{listClass},</if>
<if test="isDefault != null and isDefault != ''">#{isDefault},</if>
<if test="status != null">#{status},</if>
<if test="remark != null and remark != ''">#{remark},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
sysdate()
)
</insert>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.uvaluation.project.system.mapper.SysDictDataMapper">
<resultMap type="SysDictData" id="SysDictDataResult">
<id property="dictCode" column="dict_code" />
<result property="dictSort" column="dict_sort" />
<result property="dictLabel" column="dict_label" />
<result property="dictValue" column="dict_value" />
<result property="dictType" column="dict_type" />
<result property="cssClass" column="css_class" />
<result property="listClass" column="list_class" />
<result property="isDefault" column="is_default" />
<result property="status" column="status" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectDictDataVo">
select dict_code, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, remark
from sys_dict_data
</sql>
<select id="selectDictDataList" parameterType="SysDictData" resultMap="SysDictDataResult">
<include refid="selectDictDataVo"/>
<where>
<if test="dictType != null and dictType != ''">
AND dict_type = #{dictType}
</if>
<if test="dictLabel != null and dictLabel != ''">
AND dict_label like concat('%', #{dictLabel}, '%')
</if>
<if test="status != null and status != ''">
AND status = #{status}
</if>
</where>
</select>
<select id="selectDictDataByType" parameterType="SysDictData" resultMap="SysDictDataResult">
<include refid="selectDictDataVo"/>
where status = '0' and dict_type = #{dictType} order by dict_sort asc
</select>
<select id="selectDictLabel" resultType="String">
select dict_label from sys_dict_data
where dict_type = #{dictType} and dict_value = #{dictValue}
</select>
<select id="selectDictDataById" parameterType="Long" resultMap="SysDictDataResult">
<include refid="selectDictDataVo"/>
where dict_code = #{dictCode}
</select>
<select id="countDictDataByType" resultType="Integer">
select count(1) from sys_dict_data where dict_type=#{dictType}
</select>
<delete id="deleteDictDataById" parameterType="Long">
delete from sys_dict_data where dict_code = #{dictCode}
</delete>
<delete id="deleteDictDataByIds" parameterType="Long">
delete from sys_dict_data where dict_code in
<foreach collection="array" item="dictCode" open="(" separator="," close=")">
#{dictCode}
</foreach>
</delete>
<update id="updateDictData" parameterType="SysDictData">
update sys_dict_data
<set>
<if test="dictSort != null and dictSort != ''">dict_sort = #{dictSort},</if>
<if test="dictLabel != null and dictLabel != ''">dict_label = #{dictLabel},</if>
<if test="dictValue != null and dictValue != ''">dict_value = #{dictValue},</if>
<if test="dictType != null and dictType != ''">dict_type = #{dictType},</if>
<if test="cssClass != null">css_class = #{cssClass},</if>
<if test="listClass != null">list_class = #{listClass},</if>
<if test="isDefault != null and isDefault != ''">is_default = #{isDefault},</if>
<if test="status != null">status = #{status},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
update_time = sysdate()
</set>
where dict_code = #{dictCode}
</update>
<update id="updateDictDataType" parameterType="String">
update sys_dict_data set dict_type = #{newDictType} where dict_type = #{oldDictType}
</update>
<insert id="insertDictData" parameterType="SysDictData">
insert into sys_dict_data(
<if test="dictSort != null and dictSort != ''">dict_sort,</if>
<if test="dictLabel != null and dictLabel != ''">dict_label,</if>
<if test="dictValue != null and dictValue != ''">dict_value,</if>
<if test="dictType != null and dictType != ''">dict_type,</if>
<if test="cssClass != null and cssClass != ''">css_class,</if>
<if test="listClass != null and listClass != ''">list_class,</if>
<if test="isDefault != null and isDefault != ''">is_default,</if>
<if test="status != null">status,</if>
<if test="remark != null and remark != ''">remark,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
create_time
)values(
<if test="dictSort != null and dictSort != ''">#{dictSort},</if>
<if test="dictLabel != null and dictLabel != ''">#{dictLabel},</if>
<if test="dictValue != null and dictValue != ''">#{dictValue},</if>
<if test="dictType != null and dictType != ''">#{dictType},</if>
<if test="cssClass != null and cssClass != ''">#{cssClass},</if>
<if test="listClass != null and listClass != ''">#{listClass},</if>
<if test="isDefault != null and isDefault != ''">#{isDefault},</if>
<if test="status != null">#{status},</if>
<if test="remark != null and remark != ''">#{remark},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
sysdate()
)
</insert>
</mapper>

View File

@ -1,105 +1,105 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.project.system.mapper.SysDictTypeMapper">
<resultMap type="SysDictType" id="SysDictTypeResult">
<id property="dictId" column="dict_id" />
<result property="dictName" column="dict_name" />
<result property="dictType" column="dict_type" />
<result property="status" column="status" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectDictTypeVo">
select dict_id, dict_name, dict_type, status, create_by, create_time, remark
from sys_dict_type
</sql>
<select id="selectDictTypeList" parameterType="SysDictType" resultMap="SysDictTypeResult">
<include refid="selectDictTypeVo"/>
<where>
<if test="dictName != null and dictName != ''">
AND dict_name like concat('%', #{dictName}, '%')
</if>
<if test="status != null and status != ''">
AND status = #{status}
</if>
<if test="dictType != null and dictType != ''">
AND dict_type like concat('%', #{dictType}, '%')
</if>
<if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
and date_format(create_time,'%y%m%d') &gt;= date_format(#{beginTime},'%y%m%d')
</if>
<if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
and date_format(create_time,'%y%m%d') &lt;= date_format(#{endTime},'%y%m%d')
</if>
</where>
</select>
<select id="selectDictTypeAll" resultMap="SysDictTypeResult">
<include refid="selectDictTypeVo"/>
</select>
<select id="selectDictTypeById" parameterType="Long" resultMap="SysDictTypeResult">
<include refid="selectDictTypeVo"/>
where dict_id = #{dictId}
</select>
<select id="selectDictTypeByType" parameterType="String" resultMap="SysDictTypeResult">
<include refid="selectDictTypeVo"/>
where dict_type = #{dictType}
</select>
<select id="checkDictTypeUnique" parameterType="String" resultMap="SysDictTypeResult">
<include refid="selectDictTypeVo"/>
where dict_type = #{dictType}
</select>
<delete id="deleteDictTypeById" parameterType="Long">
delete from sys_dict_type where dict_id = #{dictId}
</delete>
<delete id="deleteDictTypeByIds" parameterType="Long">
delete from sys_dict_type where dict_id in
<foreach collection="array" item="dictId" open="(" separator="," close=")">
#{dictId}
</foreach>
</delete>
<update id="updateDictType" parameterType="SysDictType">
update sys_dict_type
<set>
<if test="dictName != null and dictName != ''">dict_name = #{dictName},</if>
<if test="dictType != null and dictType != ''">dict_type = #{dictType},</if>
<if test="status != null">status = #{status},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
update_time = sysdate()
</set>
where dict_id = #{dictId}
</update>
<insert id="insertDictType" parameterType="SysDictType">
insert into sys_dict_type(
<if test="dictName != null and dictName != ''">dict_name,</if>
<if test="dictType != null and dictType != ''">dict_type,</if>
<if test="status != null">status,</if>
<if test="remark != null and remark != ''">remark,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
create_time
)values(
<if test="dictName != null and dictName != ''">#{dictName},</if>
<if test="dictType != null and dictType != ''">#{dictType},</if>
<if test="status != null">#{status},</if>
<if test="remark != null and remark != ''">#{remark},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
sysdate()
)
</insert>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.uvaluation.project.system.mapper.SysDictTypeMapper">
<resultMap type="SysDictType" id="SysDictTypeResult">
<id property="dictId" column="dict_id" />
<result property="dictName" column="dict_name" />
<result property="dictType" column="dict_type" />
<result property="status" column="status" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectDictTypeVo">
select dict_id, dict_name, dict_type, status, create_by, create_time, remark
from sys_dict_type
</sql>
<select id="selectDictTypeList" parameterType="SysDictType" resultMap="SysDictTypeResult">
<include refid="selectDictTypeVo"/>
<where>
<if test="dictName != null and dictName != ''">
AND dict_name like concat('%', #{dictName}, '%')
</if>
<if test="status != null and status != ''">
AND status = #{status}
</if>
<if test="dictType != null and dictType != ''">
AND dict_type like concat('%', #{dictType}, '%')
</if>
<if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
and date_format(create_time,'%y%m%d') &gt;= date_format(#{beginTime},'%y%m%d')
</if>
<if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
and date_format(create_time,'%y%m%d') &lt;= date_format(#{endTime},'%y%m%d')
</if>
</where>
</select>
<select id="selectDictTypeAll" resultMap="SysDictTypeResult">
<include refid="selectDictTypeVo"/>
</select>
<select id="selectDictTypeById" parameterType="Long" resultMap="SysDictTypeResult">
<include refid="selectDictTypeVo"/>
where dict_id = #{dictId}
</select>
<select id="selectDictTypeByType" parameterType="String" resultMap="SysDictTypeResult">
<include refid="selectDictTypeVo"/>
where dict_type = #{dictType}
</select>
<select id="checkDictTypeUnique" parameterType="String" resultMap="SysDictTypeResult">
<include refid="selectDictTypeVo"/>
where dict_type = #{dictType}
</select>
<delete id="deleteDictTypeById" parameterType="Long">
delete from sys_dict_type where dict_id = #{dictId}
</delete>
<delete id="deleteDictTypeByIds" parameterType="Long">
delete from sys_dict_type where dict_id in
<foreach collection="array" item="dictId" open="(" separator="," close=")">
#{dictId}
</foreach>
</delete>
<update id="updateDictType" parameterType="SysDictType">
update sys_dict_type
<set>
<if test="dictName != null and dictName != ''">dict_name = #{dictName},</if>
<if test="dictType != null and dictType != ''">dict_type = #{dictType},</if>
<if test="status != null">status = #{status},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
update_time = sysdate()
</set>
where dict_id = #{dictId}
</update>
<insert id="insertDictType" parameterType="SysDictType">
insert into sys_dict_type(
<if test="dictName != null and dictName != ''">dict_name,</if>
<if test="dictType != null and dictType != ''">dict_type,</if>
<if test="status != null">status,</if>
<if test="remark != null and remark != ''">remark,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
create_time
)values(
<if test="dictName != null and dictName != ''">#{dictName},</if>
<if test="dictType != null and dictType != ''">#{dictType},</if>
<if test="status != null">#{status},</if>
<if test="remark != null and remark != ''">#{remark},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
sysdate()
)
</insert>
</mapper>

View File

@ -2,7 +2,7 @@
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.project.monitor.mapper.SysJobLogMapper">
<mapper namespace="com.uvaluation.project.monitor.mapper.SysJobLogMapper">
<resultMap type="SysJobLog" id="SysJobLogResult">
<id property="jobLogId" column="job_log_id" />

View File

@ -2,7 +2,7 @@
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.project.monitor.mapper.SysJobMapper">
<mapper namespace="com.uvaluation.project.monitor.mapper.SysJobMapper">
<resultMap type="SysJob" id="SysJobResult">
<id property="jobId" column="job_id" />

View File

@ -1,185 +1,185 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.project.system.mapper.SysMenuMapper">
<resultMap type="SysMenu" id="SysMenuResult">
<id property="menuId" column="menu_id" />
<result property="menuName" column="menu_name" />
<result property="parentName" column="parent_name" />
<result property="parentId" column="parent_id" />
<result property="orderNum" column="order_num" />
<result property="path" column="path" />
<result property="component" column="component" />
<result property="isFrame" column="is_frame" />
<result property="menuType" column="menu_type" />
<result property="visible" column="visible" />
<result property="status" column="status" />
<result property="perms" column="perms" />
<result property="icon" column="icon" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
<result property="updateBy" column="update_by" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectMenuVo">
select menu_id, menu_name, parent_id, order_num, path, component, is_frame, menu_type, visible, status, ifnull(perms,'') as perms, icon, create_time
from sys_menu
</sql>
<select id="selectMenuList" parameterType="SysMenu" resultMap="SysMenuResult">
<include refid="selectMenuVo"/>
<where>
<if test="menuName != null and menuName != ''">
AND menu_name like concat('%', #{menuName}, '%')
</if>
<if test="visible != null and visible != ''">
AND visible = #{visible}
</if>
<if test="status != null and status != ''">
AND status = #{status}
</if>
</where>
order by parent_id, order_num
</select>
<select id="selectMenuTreeAll" resultMap="SysMenuResult">
select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.menu_type, m.icon, m.order_num, m.create_time
from sys_menu m where m.menu_type in ('M', 'C') and m.status = 0
order by m.parent_id, m.order_num
</select>
<select id="selectMenuListByUserId" parameterType="SysMenu" resultMap="SysMenuResult">
select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.menu_type, m.icon, m.order_num, m.create_time
from sys_menu m
left join sys_role_menu rm on m.menu_id = rm.menu_id
left join sys_user_role ur on rm.role_id = ur.role_id
left join sys_role ro on ur.role_id = ro.role_id
where ur.user_id = #{params.userId}
<if test="menuName != null and menuName != ''">
AND menu_name like concat('%', #{menuName}, '%')
</if>
<if test="visible != null and visible != ''">
AND visible = #{visible}
</if>
<if test="status != null and status != ''">
AND status = #{status}
</if>
order by m.parent_id, m.order_num
</select>
<select id="selectMenuTreeByUserId" parameterType="Long" resultMap="SysMenuResult">
select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.menu_type, m.icon, m.order_num, m.create_time
from sys_menu m
left join sys_role_menu rm on m.menu_id = rm.menu_id
left join sys_user_role ur on rm.role_id = ur.role_id
left join sys_role ro on ur.role_id = ro.role_id
left join sys_user u on ur.user_id = u.user_id
where u.user_id = #{userId} and m.menu_type in ('M', 'C') and m.status = 0 AND ro.status = 0
order by m.parent_id, m.order_num
</select>
<select id="selectMenuListByRoleId" parameterType="Long" resultType="Integer">
select m.menu_id, m.parent_id
from sys_menu m
left join sys_role_menu rm on m.menu_id = rm.menu_id
where rm.role_id = #{roleId}
and m.menu_id not in (select m.parent_id from sys_menu m inner join sys_role_menu rm on m.menu_id = rm.menu_id and rm.role_id = #{roleId})
order by m.parent_id, m.order_num
</select>
<select id="selectMenuPerms" resultType="String">
select distinct m.perms
from sys_menu m
left join sys_role_menu rm on m.menu_id = rm.menu_id
left join sys_user_role ur on rm.role_id = ur.role_id
</select>
<select id="selectMenuPermsByUserId" parameterType="Long" resultType="String">
select distinct m.perms
from sys_menu m
left join sys_role_menu rm on m.menu_id = rm.menu_id
left join sys_user_role ur on rm.role_id = ur.role_id
left join sys_role r on r.role_id = ur.role_id
where m.status = '0' and r.status = '0' and ur.user_id = #{userId}
</select>
<select id="selectMenuById" parameterType="Long" resultMap="SysMenuResult">
<include refid="selectMenuVo"/>
where menu_id = #{menuId}
</select>
<select id="hasChildByMenuId" resultType="Integer">
select count(1) from sys_menu where parent_id = #{menuId}
</select>
<select id="checkMenuNameUnique" parameterType="SysMenu" resultMap="SysMenuResult">
<include refid="selectMenuVo"/>
where menu_name=#{menuName} and parent_id = #{parentId}
</select>
<update id="updateMenu" parameterType="SysMenu">
update sys_menu
<set>
<if test="menuName != null and menuName != ''">menu_name = #{menuName},</if>
<if test="parentId != null">parent_id = #{parentId},</if>
<if test="orderNum != null and orderNum != ''">order_num = #{orderNum},</if>
<if test="path != null and path != ''">path = #{path},</if>
<if test="component != null and component != ''">component = #{component},</if>
<if test="isFrame != null and isFrame != ''">is_frame = #{isFrame},</if>
<if test="menuType != null and menuType != ''">menu_type = #{menuType},</if>
<if test="visible != null">visible = #{visible},</if>
<if test="status != null">status = #{status},</if>
<if test="perms !=null">perms = #{perms},</if>
<if test="icon !=null and icon != ''">icon = #{icon},</if>
<if test="remark != null and remark != ''">remark = #{remark},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
update_time = sysdate()
</set>
where menu_id = #{menuId}
</update>
<insert id="insertMenu" parameterType="SysMenu">
insert into sys_menu(
<if test="menuId != null and menuId != 0">menu_id,</if>
<if test="parentId != null and parentId != 0">parent_id,</if>
<if test="menuName != null and menuName != ''">menu_name,</if>
<if test="orderNum != null and orderNum != ''">order_num,</if>
<if test="path != null and path != ''">path,</if>
<if test="component != null and component != ''">component,</if>
<if test="isFrame != null and isFrame != ''">is_frame,</if>
<if test="menuType != null and menuType != ''">menu_type,</if>
<if test="visible != null">visible,</if>
<if test="status != null">status,</if>
<if test="perms !=null and perms != ''">perms,</if>
<if test="icon != null and icon != ''">icon,</if>
<if test="remark != null and remark != ''">remark,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
create_time
)values(
<if test="menuId != null and menuId != 0">#{menuId},</if>
<if test="parentId != null and parentId != 0">#{parentId},</if>
<if test="menuName != null and menuName != ''">#{menuName},</if>
<if test="orderNum != null and orderNum != ''">#{orderNum},</if>
<if test="path != null and path != ''">#{path},</if>
<if test="component != null and component != ''">#{component},</if>
<if test="isFrame != null and isFrame != ''">#{isFrame},</if>
<if test="menuType != null and menuType != ''">#{menuType},</if>
<if test="visible != null">#{visible},</if>
<if test="status != null">#{status},</if>
<if test="perms !=null and perms != ''">#{perms},</if>
<if test="icon != null and icon != ''">#{icon},</if>
<if test="remark != null and remark != ''">#{remark},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
sysdate()
)
</insert>
<delete id="deleteMenuById" parameterType="Long">
delete from sys_menu where menu_id = #{menuId}
</delete>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.uvaluation.project.system.mapper.SysMenuMapper">
<resultMap type="SysMenu" id="SysMenuResult">
<id property="menuId" column="menu_id" />
<result property="menuName" column="menu_name" />
<result property="parentName" column="parent_name" />
<result property="parentId" column="parent_id" />
<result property="orderNum" column="order_num" />
<result property="path" column="path" />
<result property="component" column="component" />
<result property="isFrame" column="is_frame" />
<result property="menuType" column="menu_type" />
<result property="visible" column="visible" />
<result property="status" column="status" />
<result property="perms" column="perms" />
<result property="icon" column="icon" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
<result property="updateBy" column="update_by" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectMenuVo">
select menu_id, menu_name, parent_id, order_num, path, component, is_frame, menu_type, visible, status, ifnull(perms,'') as perms, icon, create_time
from sys_menu
</sql>
<select id="selectMenuList" parameterType="SysMenu" resultMap="SysMenuResult">
<include refid="selectMenuVo"/>
<where>
<if test="menuName != null and menuName != ''">
AND menu_name like concat('%', #{menuName}, '%')
</if>
<if test="visible != null and visible != ''">
AND visible = #{visible}
</if>
<if test="status != null and status != ''">
AND status = #{status}
</if>
</where>
order by parent_id, order_num
</select>
<select id="selectMenuTreeAll" resultMap="SysMenuResult">
select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.menu_type, m.icon, m.order_num, m.create_time
from sys_menu m where m.menu_type in ('M', 'C') and m.status = 0
order by m.parent_id, m.order_num
</select>
<select id="selectMenuListByUserId" parameterType="SysMenu" resultMap="SysMenuResult">
select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.menu_type, m.icon, m.order_num, m.create_time
from sys_menu m
left join sys_role_menu rm on m.menu_id = rm.menu_id
left join sys_user_role ur on rm.role_id = ur.role_id
left join sys_role ro on ur.role_id = ro.role_id
where ur.user_id = #{params.userId}
<if test="menuName != null and menuName != ''">
AND menu_name like concat('%', #{menuName}, '%')
</if>
<if test="visible != null and visible != ''">
AND visible = #{visible}
</if>
<if test="status != null and status != ''">
AND status = #{status}
</if>
order by m.parent_id, m.order_num
</select>
<select id="selectMenuTreeByUserId" parameterType="Long" resultMap="SysMenuResult">
select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.menu_type, m.icon, m.order_num, m.create_time
from sys_menu m
left join sys_role_menu rm on m.menu_id = rm.menu_id
left join sys_user_role ur on rm.role_id = ur.role_id
left join sys_role ro on ur.role_id = ro.role_id
left join sys_user u on ur.user_id = u.user_id
where u.user_id = #{userId} and m.menu_type in ('M', 'C') and m.status = 0 AND ro.status = 0
order by m.parent_id, m.order_num
</select>
<select id="selectMenuListByRoleId" parameterType="Long" resultType="Integer">
select m.menu_id, m.parent_id
from sys_menu m
left join sys_role_menu rm on m.menu_id = rm.menu_id
where rm.role_id = #{roleId}
and m.menu_id not in (select m.parent_id from sys_menu m inner join sys_role_menu rm on m.menu_id = rm.menu_id and rm.role_id = #{roleId})
order by m.parent_id, m.order_num
</select>
<select id="selectMenuPerms" resultType="String">
select distinct m.perms
from sys_menu m
left join sys_role_menu rm on m.menu_id = rm.menu_id
left join sys_user_role ur on rm.role_id = ur.role_id
</select>
<select id="selectMenuPermsByUserId" parameterType="Long" resultType="String">
select distinct m.perms
from sys_menu m
left join sys_role_menu rm on m.menu_id = rm.menu_id
left join sys_user_role ur on rm.role_id = ur.role_id
left join sys_role r on r.role_id = ur.role_id
where m.status = '0' and r.status = '0' and ur.user_id = #{userId}
</select>
<select id="selectMenuById" parameterType="Long" resultMap="SysMenuResult">
<include refid="selectMenuVo"/>
where menu_id = #{menuId}
</select>
<select id="hasChildByMenuId" resultType="Integer">
select count(1) from sys_menu where parent_id = #{menuId}
</select>
<select id="checkMenuNameUnique" parameterType="SysMenu" resultMap="SysMenuResult">
<include refid="selectMenuVo"/>
where menu_name=#{menuName} and parent_id = #{parentId}
</select>
<update id="updateMenu" parameterType="SysMenu">
update sys_menu
<set>
<if test="menuName != null and menuName != ''">menu_name = #{menuName},</if>
<if test="parentId != null">parent_id = #{parentId},</if>
<if test="orderNum != null and orderNum != ''">order_num = #{orderNum},</if>
<if test="path != null and path != ''">path = #{path},</if>
<if test="component != null and component != ''">component = #{component},</if>
<if test="isFrame != null and isFrame != ''">is_frame = #{isFrame},</if>
<if test="menuType != null and menuType != ''">menu_type = #{menuType},</if>
<if test="visible != null">visible = #{visible},</if>
<if test="status != null">status = #{status},</if>
<if test="perms !=null">perms = #{perms},</if>
<if test="icon !=null and icon != ''">icon = #{icon},</if>
<if test="remark != null and remark != ''">remark = #{remark},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
update_time = sysdate()
</set>
where menu_id = #{menuId}
</update>
<insert id="insertMenu" parameterType="SysMenu">
insert into sys_menu(
<if test="menuId != null and menuId != 0">menu_id,</if>
<if test="parentId != null and parentId != 0">parent_id,</if>
<if test="menuName != null and menuName != ''">menu_name,</if>
<if test="orderNum != null and orderNum != ''">order_num,</if>
<if test="path != null and path != ''">path,</if>
<if test="component != null and component != ''">component,</if>
<if test="isFrame != null and isFrame != ''">is_frame,</if>
<if test="menuType != null and menuType != ''">menu_type,</if>
<if test="visible != null">visible,</if>
<if test="status != null">status,</if>
<if test="perms !=null and perms != ''">perms,</if>
<if test="icon != null and icon != ''">icon,</if>
<if test="remark != null and remark != ''">remark,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
create_time
)values(
<if test="menuId != null and menuId != 0">#{menuId},</if>
<if test="parentId != null and parentId != 0">#{parentId},</if>
<if test="menuName != null and menuName != ''">#{menuName},</if>
<if test="orderNum != null and orderNum != ''">#{orderNum},</if>
<if test="path != null and path != ''">#{path},</if>
<if test="component != null and component != ''">#{component},</if>
<if test="isFrame != null and isFrame != ''">#{isFrame},</if>
<if test="menuType != null and menuType != ''">#{menuType},</if>
<if test="visible != null">#{visible},</if>
<if test="status != null">#{status},</if>
<if test="perms !=null and perms != ''">#{perms},</if>
<if test="icon != null and icon != ''">#{icon},</if>
<if test="remark != null and remark != ''">#{remark},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
sysdate()
)
</insert>
<delete id="deleteMenuById" parameterType="Long">
delete from sys_menu where menu_id = #{menuId}
</delete>
</mapper>

View File

@ -1,89 +1,89 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.project.system.mapper.SysNoticeMapper">
<resultMap type="SysNotice" id="SysNoticeResult">
<result property="noticeId" column="notice_id" />
<result property="noticeTitle" column="notice_title" />
<result property="noticeType" column="notice_type" />
<result property="noticeContent" column="notice_content" />
<result property="status" column="status" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectNoticeVo">
select notice_id, notice_title, notice_type, notice_content, status, create_by, create_time, update_by, update_time, remark
from sys_notice
</sql>
<select id="selectNoticeById" parameterType="Long" resultMap="SysNoticeResult">
<include refid="selectNoticeVo"/>
where notice_id = #{noticeId}
</select>
<select id="selectNoticeList" parameterType="SysNotice" resultMap="SysNoticeResult">
<include refid="selectNoticeVo"/>
<where>
<if test="noticeTitle != null and noticeTitle != ''">
AND notice_title like concat('%', #{noticeTitle}, '%')
</if>
<if test="noticeType != null and noticeType != ''">
AND notice_type = #{noticeType}
</if>
<if test="createBy != null and createBy != ''">
AND create_by like concat('%', #{createBy}, '%')
</if>
</where>
</select>
<insert id="insertNotice" parameterType="SysNotice">
insert into sys_notice (
<if test="noticeTitle != null and noticeTitle != '' ">notice_title, </if>
<if test="noticeType != null and noticeType != '' ">notice_type, </if>
<if test="noticeContent != null and noticeContent != '' ">notice_content, </if>
<if test="status != null and status != '' ">status, </if>
<if test="remark != null and remark != ''">remark,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
create_time
)values(
<if test="noticeTitle != null and noticeTitle != ''">#{noticeTitle}, </if>
<if test="noticeType != null and noticeType != ''">#{noticeType}, </if>
<if test="noticeContent != null and noticeContent != ''">#{noticeContent}, </if>
<if test="status != null and status != ''">#{status}, </if>
<if test="remark != null and remark != ''">#{remark},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
sysdate()
)
</insert>
<update id="updateNotice" parameterType="SysNotice">
update sys_notice
<set>
<if test="noticeTitle != null and noticeTitle != ''">notice_title = #{noticeTitle}, </if>
<if test="noticeType != null and noticeType != ''">notice_type = #{noticeType}, </if>
<if test="noticeContent != null">notice_content = #{noticeContent}, </if>
<if test="status != null and status != ''">status = #{status}, </if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
update_time = sysdate()
</set>
where notice_id = #{noticeId}
</update>
<delete id="deleteNoticeById" parameterType="Long">
delete from sys_notice where notice_id = #{noticeId}
</delete>
<delete id="deleteNoticeByIds" parameterType="Long">
delete from sys_notice where notice_id in
<foreach item="noticeId" collection="array" open="(" separator="," close=")">
#{noticeId}
</foreach>
</delete>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.uvaluation.project.system.mapper.SysNoticeMapper">
<resultMap type="SysNotice" id="SysNoticeResult">
<result property="noticeId" column="notice_id" />
<result property="noticeTitle" column="notice_title" />
<result property="noticeType" column="notice_type" />
<result property="noticeContent" column="notice_content" />
<result property="status" column="status" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectNoticeVo">
select notice_id, notice_title, notice_type, notice_content, status, create_by, create_time, update_by, update_time, remark
from sys_notice
</sql>
<select id="selectNoticeById" parameterType="Long" resultMap="SysNoticeResult">
<include refid="selectNoticeVo"/>
where notice_id = #{noticeId}
</select>
<select id="selectNoticeList" parameterType="SysNotice" resultMap="SysNoticeResult">
<include refid="selectNoticeVo"/>
<where>
<if test="noticeTitle != null and noticeTitle != ''">
AND notice_title like concat('%', #{noticeTitle}, '%')
</if>
<if test="noticeType != null and noticeType != ''">
AND notice_type = #{noticeType}
</if>
<if test="createBy != null and createBy != ''">
AND create_by like concat('%', #{createBy}, '%')
</if>
</where>
</select>
<insert id="insertNotice" parameterType="SysNotice">
insert into sys_notice (
<if test="noticeTitle != null and noticeTitle != '' ">notice_title, </if>
<if test="noticeType != null and noticeType != '' ">notice_type, </if>
<if test="noticeContent != null and noticeContent != '' ">notice_content, </if>
<if test="status != null and status != '' ">status, </if>
<if test="remark != null and remark != ''">remark,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
create_time
)values(
<if test="noticeTitle != null and noticeTitle != ''">#{noticeTitle}, </if>
<if test="noticeType != null and noticeType != ''">#{noticeType}, </if>
<if test="noticeContent != null and noticeContent != ''">#{noticeContent}, </if>
<if test="status != null and status != ''">#{status}, </if>
<if test="remark != null and remark != ''">#{remark},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
sysdate()
)
</insert>
<update id="updateNotice" parameterType="SysNotice">
update sys_notice
<set>
<if test="noticeTitle != null and noticeTitle != ''">notice_title = #{noticeTitle}, </if>
<if test="noticeType != null and noticeType != ''">notice_type = #{noticeType}, </if>
<if test="noticeContent != null">notice_content = #{noticeContent}, </if>
<if test="status != null and status != ''">status = #{status}, </if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
update_time = sysdate()
</set>
where notice_id = #{noticeId}
</update>
<delete id="deleteNoticeById" parameterType="Long">
delete from sys_notice where notice_id = #{noticeId}
</delete>
<delete id="deleteNoticeByIds" parameterType="Long">
delete from sys_notice where notice_id in
<foreach item="noticeId" collection="array" open="(" separator="," close=")">
#{noticeId}
</foreach>
</delete>
</mapper>

View File

@ -1,122 +1,122 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.project.system.mapper.SysPostMapper">
<resultMap type="SysPost" id="SysPostResult">
<id property="postId" column="post_id" />
<result property="postCode" column="post_code" />
<result property="postName" column="post_name" />
<result property="postSort" column="post_sort" />
<result property="status" column="status" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectPostVo">
select post_id, post_code, post_name, post_sort, status, create_by, create_time, remark
from sys_post
</sql>
<select id="selectPostList" parameterType="SysPost" resultMap="SysPostResult">
<include refid="selectPostVo"/>
<where>
<if test="postCode != null and postCode != ''">
AND post_code like concat('%', #{postCode}, '%')
</if>
<if test="status != null and status != ''">
AND status = #{status}
</if>
<if test="postName != null and postName != ''">
AND post_name like concat('%', #{postName}, '%')
</if>
</where>
</select>
<select id="selectPostAll" resultMap="SysPostResult">
<include refid="selectPostVo"/>
</select>
<select id="selectPostById" parameterType="Long" resultMap="SysPostResult">
<include refid="selectPostVo"/>
where post_id = #{postId}
</select>
<select id="selectPostListByUserId" parameterType="Long" resultType="Integer">
select p.post_id
from sys_post p
left join sys_user_post up on up.post_id = p.post_id
left join sys_user u on u.user_id = up.user_id
where u.user_id = #{userId}
</select>
<select id="selectPostsByUserName" parameterType="String" resultMap="SysPostResult">
select p.post_id, p.post_name, p.post_code
from sys_post p
left join sys_user_post up on up.post_id = p.post_id
left join sys_user u on u.user_id = up.user_id
where u.user_name = #{userName}
</select>
<select id="checkPostNameUnique" parameterType="String" resultMap="SysPostResult">
<include refid="selectPostVo"/>
where post_name=#{postName}
</select>
<select id="checkPostCodeUnique" parameterType="String" resultMap="SysPostResult">
<include refid="selectPostVo"/>
where post_code=#{postCode}
</select>
<update id="updatePost" parameterType="SysPost">
update sys_post
<set>
<if test="postCode != null and postCode != ''">post_code = #{postCode},</if>
<if test="postName != null and postName != ''">post_name = #{postName},</if>
<if test="postSort != null and postSort != ''">post_sort = #{postSort},</if>
<if test="status != null and status != ''">status = #{status},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
update_time = sysdate()
</set>
where post_id = #{postId}
</update>
<insert id="insertPost" parameterType="SysPost" useGeneratedKeys="true" keyProperty="postId">
insert into sys_post(
<if test="postId != null and postId != 0">post_id,</if>
<if test="postCode != null and postCode != ''">post_code,</if>
<if test="postName != null and postName != ''">post_name,</if>
<if test="postSort != null and postSort != ''">post_sort,</if>
<if test="status != null and status != ''">status,</if>
<if test="remark != null and remark != ''">remark,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
create_time
)values(
<if test="postId != null and postId != 0">#{postId},</if>
<if test="postCode != null and postCode != ''">#{postCode},</if>
<if test="postName != null and postName != ''">#{postName},</if>
<if test="postSort != null and postSort != ''">#{postSort},</if>
<if test="status != null and status != ''">#{status},</if>
<if test="remark != null and remark != ''">#{remark},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
sysdate()
)
</insert>
<delete id="deletePostById" parameterType="Long">
delete from sys_post where post_id = #{postId}
</delete>
<delete id="deletePostByIds" parameterType="Long">
delete from sys_post where post_id in
<foreach collection="array" item="postId" open="(" separator="," close=")">
#{postId}
</foreach>
</delete>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.uvaluation.project.system.mapper.SysPostMapper">
<resultMap type="SysPost" id="SysPostResult">
<id property="postId" column="post_id" />
<result property="postCode" column="post_code" />
<result property="postName" column="post_name" />
<result property="postSort" column="post_sort" />
<result property="status" column="status" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectPostVo">
select post_id, post_code, post_name, post_sort, status, create_by, create_time, remark
from sys_post
</sql>
<select id="selectPostList" parameterType="SysPost" resultMap="SysPostResult">
<include refid="selectPostVo"/>
<where>
<if test="postCode != null and postCode != ''">
AND post_code like concat('%', #{postCode}, '%')
</if>
<if test="status != null and status != ''">
AND status = #{status}
</if>
<if test="postName != null and postName != ''">
AND post_name like concat('%', #{postName}, '%')
</if>
</where>
</select>
<select id="selectPostAll" resultMap="SysPostResult">
<include refid="selectPostVo"/>
</select>
<select id="selectPostById" parameterType="Long" resultMap="SysPostResult">
<include refid="selectPostVo"/>
where post_id = #{postId}
</select>
<select id="selectPostListByUserId" parameterType="Long" resultType="Integer">
select p.post_id
from sys_post p
left join sys_user_post up on up.post_id = p.post_id
left join sys_user u on u.user_id = up.user_id
where u.user_id = #{userId}
</select>
<select id="selectPostsByUserName" parameterType="String" resultMap="SysPostResult">
select p.post_id, p.post_name, p.post_code
from sys_post p
left join sys_user_post up on up.post_id = p.post_id
left join sys_user u on u.user_id = up.user_id
where u.user_name = #{userName}
</select>
<select id="checkPostNameUnique" parameterType="String" resultMap="SysPostResult">
<include refid="selectPostVo"/>
where post_name=#{postName}
</select>
<select id="checkPostCodeUnique" parameterType="String" resultMap="SysPostResult">
<include refid="selectPostVo"/>
where post_code=#{postCode}
</select>
<update id="updatePost" parameterType="SysPost">
update sys_post
<set>
<if test="postCode != null and postCode != ''">post_code = #{postCode},</if>
<if test="postName != null and postName != ''">post_name = #{postName},</if>
<if test="postSort != null and postSort != ''">post_sort = #{postSort},</if>
<if test="status != null and status != ''">status = #{status},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
update_time = sysdate()
</set>
where post_id = #{postId}
</update>
<insert id="insertPost" parameterType="SysPost" useGeneratedKeys="true" keyProperty="postId">
insert into sys_post(
<if test="postId != null and postId != 0">post_id,</if>
<if test="postCode != null and postCode != ''">post_code,</if>
<if test="postName != null and postName != ''">post_name,</if>
<if test="postSort != null and postSort != ''">post_sort,</if>
<if test="status != null and status != ''">status,</if>
<if test="remark != null and remark != ''">remark,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
create_time
)values(
<if test="postId != null and postId != 0">#{postId},</if>
<if test="postCode != null and postCode != ''">#{postCode},</if>
<if test="postName != null and postName != ''">#{postName},</if>
<if test="postSort != null and postSort != ''">#{postSort},</if>
<if test="status != null and status != ''">#{status},</if>
<if test="remark != null and remark != ''">#{remark},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
sysdate()
)
</insert>
<delete id="deletePostById" parameterType="Long">
delete from sys_post where post_id = #{postId}
</delete>
<delete id="deletePostByIds" parameterType="Long">
delete from sys_post where post_id in
<foreach collection="array" item="postId" open="(" separator="," close=")">
#{postId}
</foreach>
</delete>
</mapper>

View File

@ -1,34 +1,34 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.project.system.mapper.SysRoleDeptMapper">
<resultMap type="SysRoleDept" id="SysRoleDeptResult">
<result property="roleId" column="role_id" />
<result property="deptId" column="dept_id" />
</resultMap>
<delete id="deleteRoleDeptByRoleId" parameterType="Long">
delete from sys_role_dept where role_id=#{roleId}
</delete>
<select id="selectCountRoleDeptByDeptId" resultType="Integer">
select count(1) from sys_role_dept where dept_id=#{deptId}
</select>
<delete id="deleteRoleDept" parameterType="Long">
delete from sys_role_dept where role_id in
<foreach collection="array" item="roleId" open="(" separator="," close=")">
#{roleId}
</foreach>
</delete>
<insert id="batchRoleDept">
insert into sys_role_dept(role_id, dept_id) values
<foreach item="item" index="index" collection="list" separator=",">
(#{item.roleId},#{item.deptId})
</foreach>
</insert>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.uvaluation.project.system.mapper.SysRoleDeptMapper">
<resultMap type="SysRoleDept" id="SysRoleDeptResult">
<result property="roleId" column="role_id" />
<result property="deptId" column="dept_id" />
</resultMap>
<delete id="deleteRoleDeptByRoleId" parameterType="Long">
delete from sys_role_dept where role_id=#{roleId}
</delete>
<select id="selectCountRoleDeptByDeptId" resultType="Integer">
select count(1) from sys_role_dept where dept_id=#{deptId}
</select>
<delete id="deleteRoleDept" parameterType="Long">
delete from sys_role_dept where role_id in
<foreach collection="array" item="roleId" open="(" separator="," close=")">
#{roleId}
</foreach>
</delete>
<insert id="batchRoleDept">
insert into sys_role_dept(role_id, dept_id) values
<foreach item="item" index="index" collection="list" separator=",">
(#{item.roleId},#{item.deptId})
</foreach>
</insert>
</mapper>

View File

@ -1,145 +1,145 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.project.system.mapper.SysRoleMapper">
<resultMap type="SysRole" id="SysRoleResult">
<id property="roleId" column="role_id" />
<result property="roleName" column="role_name" />
<result property="roleKey" column="role_key" />
<result property="roleSort" column="role_sort" />
<result property="dataScope" column="data_scope" />
<result property="status" column="status" />
<result property="delFlag" column="del_flag" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectRoleVo">
select distinct r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope,
r.status, r.del_flag, r.create_time, r.remark
from sys_role r
left join sys_user_role ur on ur.role_id = r.role_id
left join sys_user u on u.user_id = ur.user_id
left join sys_dept d on u.dept_id = d.dept_id
</sql>
<select id="selectRoleList" parameterType="SysRole" resultMap="SysRoleResult">
<include refid="selectRoleVo"/>
where r.del_flag = '0'
<if test="roleName != null and roleName != ''">
AND r.role_name like concat('%', #{roleName}, '%')
</if>
<if test="status != null and status != ''">
AND r.status = #{status}
</if>
<if test="roleKey != null and roleKey != ''">
AND r.role_key like concat('%', #{roleKey}, '%')
</if>
<if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
and date_format(r.create_time,'%y%m%d') &gt;= date_format(#{beginTime},'%y%m%d')
</if>
<if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
and date_format(r.create_time,'%y%m%d') &lt;= date_format(#{endTime},'%y%m%d')
</if>
<!-- 数据范围过滤 -->
${dataScope}
order by r.role_sort
</select>
<select id="selectRolePermissionByUserId" parameterType="Long" resultMap="SysRoleResult">
<include refid="selectRoleVo"/>
WHERE r.del_flag = '0' and ur.user_id = #{userId}
</select>
<select id="selectRoleAll" resultMap="SysRoleResult">
<include refid="selectRoleVo"/>
</select>
<select id="selectRoleListByUserId" parameterType="Long" resultType="Integer">
select r.role_id
from sys_role r
left join sys_user_role ur on ur.role_id = r.role_id
left join sys_user u on u.user_id = ur.user_id
where u.user_id = #{userId}
</select>
<select id="selectRoleById" parameterType="Long" resultMap="SysRoleResult">
<include refid="selectRoleVo"/>
where r.role_id = #{roleId}
</select>
<select id="selectRolesByUserName" parameterType="String" resultMap="SysRoleResult">
<include refid="selectRoleVo"/>
WHERE r.del_flag = '0' and u.user_name = #{userName}
</select>
<select id="checkRoleNameUnique" parameterType="String" resultMap="SysRoleResult">
<include refid="selectRoleVo"/>
where r.role_name=#{roleName}
</select>
<select id="checkRoleKeyUnique" parameterType="String" resultMap="SysRoleResult">
<include refid="selectRoleVo"/>
where r.role_key=#{roleKey}
</select>
<insert id="insertRole" parameterType="SysRole" useGeneratedKeys="true" keyProperty="roleId">
insert into sys_role(
<if test="roleId != null and roleId != 0">role_id,</if>
<if test="roleName != null and roleName != ''">role_name,</if>
<if test="roleKey != null and roleKey != ''">role_key,</if>
<if test="roleSort != null and roleSort != ''">role_sort,</if>
<if test="dataScope != null and dataScope != ''">data_scope,</if>
<if test="status != null and status != ''">status,</if>
<if test="remark != null and remark != ''">remark,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
create_time
)values(
<if test="roleId != null and roleId != 0">#{roleId},</if>
<if test="roleName != null and roleName != ''">#{roleName},</if>
<if test="roleKey != null and roleKey != ''">#{roleKey},</if>
<if test="roleSort != null and roleSort != ''">#{roleSort},</if>
<if test="dataScope != null and dataScope != ''">#{dataScope},</if>
<if test="status != null and status != ''">#{status},</if>
<if test="remark != null and remark != ''">#{remark},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
sysdate()
)
</insert>
<update id="updateRole" parameterType="SysRole">
update sys_role
<set>
<if test="roleName != null and roleName != ''">role_name = #{roleName},</if>
<if test="roleKey != null and roleKey != ''">role_key = #{roleKey},</if>
<if test="roleSort != null and roleSort != ''">role_sort = #{roleSort},</if>
<if test="dataScope != null and dataScope != ''">data_scope = #{dataScope},</if>
<if test="status != null and status != ''">status = #{status},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
update_time = sysdate()
</set>
where role_id = #{roleId}
</update>
<update id="updateRoleStatus" parameterType="SysRole">
update sys_user set status = #{status} where user_id = #{userId}
</update>
<delete id="deleteRoleById" parameterType="Long">
delete from sys_role where role_id = #{roleId}
</delete>
<delete id="deleteRoleByIds" parameterType="Long">
update sys_role set del_flag = '2' where role_id in
<foreach collection="array" item="roleId" open="(" separator="," close=")">
#{roleId}
</foreach>
</delete>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.uvaluation.project.system.mapper.SysRoleMapper">
<resultMap type="SysRole" id="SysRoleResult">
<id property="roleId" column="role_id" />
<result property="roleName" column="role_name" />
<result property="roleKey" column="role_key" />
<result property="roleSort" column="role_sort" />
<result property="dataScope" column="data_scope" />
<result property="status" column="status" />
<result property="delFlag" column="del_flag" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectRoleVo">
select distinct r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope,
r.status, r.del_flag, r.create_time, r.remark
from sys_role r
left join sys_user_role ur on ur.role_id = r.role_id
left join sys_user u on u.user_id = ur.user_id
left join sys_dept d on u.dept_id = d.dept_id
</sql>
<select id="selectRoleList" parameterType="SysRole" resultMap="SysRoleResult">
<include refid="selectRoleVo"/>
where r.del_flag = '0'
<if test="roleName != null and roleName != ''">
AND r.role_name like concat('%', #{roleName}, '%')
</if>
<if test="status != null and status != ''">
AND r.status = #{status}
</if>
<if test="roleKey != null and roleKey != ''">
AND r.role_key like concat('%', #{roleKey}, '%')
</if>
<if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
and date_format(r.create_time,'%y%m%d') &gt;= date_format(#{beginTime},'%y%m%d')
</if>
<if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
and date_format(r.create_time,'%y%m%d') &lt;= date_format(#{endTime},'%y%m%d')
</if>
<!-- 数据范围过滤 -->
${dataScope}
order by r.role_sort
</select>
<select id="selectRolePermissionByUserId" parameterType="Long" resultMap="SysRoleResult">
<include refid="selectRoleVo"/>
WHERE r.del_flag = '0' and ur.user_id = #{userId}
</select>
<select id="selectRoleAll" resultMap="SysRoleResult">
<include refid="selectRoleVo"/>
</select>
<select id="selectRoleListByUserId" parameterType="Long" resultType="Integer">
select r.role_id
from sys_role r
left join sys_user_role ur on ur.role_id = r.role_id
left join sys_user u on u.user_id = ur.user_id
where u.user_id = #{userId}
</select>
<select id="selectRoleById" parameterType="Long" resultMap="SysRoleResult">
<include refid="selectRoleVo"/>
where r.role_id = #{roleId}
</select>
<select id="selectRolesByUserName" parameterType="String" resultMap="SysRoleResult">
<include refid="selectRoleVo"/>
WHERE r.del_flag = '0' and u.user_name = #{userName}
</select>
<select id="checkRoleNameUnique" parameterType="String" resultMap="SysRoleResult">
<include refid="selectRoleVo"/>
where r.role_name=#{roleName}
</select>
<select id="checkRoleKeyUnique" parameterType="String" resultMap="SysRoleResult">
<include refid="selectRoleVo"/>
where r.role_key=#{roleKey}
</select>
<insert id="insertRole" parameterType="SysRole" useGeneratedKeys="true" keyProperty="roleId">
insert into sys_role(
<if test="roleId != null and roleId != 0">role_id,</if>
<if test="roleName != null and roleName != ''">role_name,</if>
<if test="roleKey != null and roleKey != ''">role_key,</if>
<if test="roleSort != null and roleSort != ''">role_sort,</if>
<if test="dataScope != null and dataScope != ''">data_scope,</if>
<if test="status != null and status != ''">status,</if>
<if test="remark != null and remark != ''">remark,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
create_time
)values(
<if test="roleId != null and roleId != 0">#{roleId},</if>
<if test="roleName != null and roleName != ''">#{roleName},</if>
<if test="roleKey != null and roleKey != ''">#{roleKey},</if>
<if test="roleSort != null and roleSort != ''">#{roleSort},</if>
<if test="dataScope != null and dataScope != ''">#{dataScope},</if>
<if test="status != null and status != ''">#{status},</if>
<if test="remark != null and remark != ''">#{remark},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
sysdate()
)
</insert>
<update id="updateRole" parameterType="SysRole">
update sys_role
<set>
<if test="roleName != null and roleName != ''">role_name = #{roleName},</if>
<if test="roleKey != null and roleKey != ''">role_key = #{roleKey},</if>
<if test="roleSort != null and roleSort != ''">role_sort = #{roleSort},</if>
<if test="dataScope != null and dataScope != ''">data_scope = #{dataScope},</if>
<if test="status != null and status != ''">status = #{status},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
update_time = sysdate()
</set>
where role_id = #{roleId}
</update>
<update id="updateRoleStatus" parameterType="SysRole">
update sys_user set status = #{status} where user_id = #{userId}
</update>
<delete id="deleteRoleById" parameterType="Long">
delete from sys_role where role_id = #{roleId}
</delete>
<delete id="deleteRoleByIds" parameterType="Long">
update sys_role set del_flag = '2' where role_id in
<foreach collection="array" item="roleId" open="(" separator="," close=")">
#{roleId}
</foreach>
</delete>
</mapper>

View File

@ -1,27 +1,27 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.project.system.mapper.SysRoleMenuMapper">
<resultMap type="SysRoleMenu" id="SysRoleMenuResult">
<result property="roleId" column="role_id" />
<result property="menuId" column="menu_id" />
</resultMap>
<select id="checkMenuExistRole" resultType="Integer">
select count(1) from sys_role_menu where menu_id = #{menuId}
</select>
<delete id="deleteRoleMenuByRoleId" parameterType="Long">
delete from sys_role_menu where role_id=#{roleId}
</delete>
<insert id="batchRoleMenu">
insert into sys_role_menu(role_id, menu_id) values
<foreach item="item" index="index" collection="list" separator=",">
(#{item.roleId},#{item.menuId})
</foreach>
</insert>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.uvaluation.project.system.mapper.SysRoleMenuMapper">
<resultMap type="SysRoleMenu" id="SysRoleMenuResult">
<result property="roleId" column="role_id" />
<result property="menuId" column="menu_id" />
</resultMap>
<select id="checkMenuExistRole" resultType="Integer">
select count(1) from sys_role_menu where menu_id = #{menuId}
</select>
<delete id="deleteRoleMenuByRoleId" parameterType="Long">
delete from sys_role_menu where role_id=#{roleId}
</delete>
<insert id="batchRoleMenu">
insert into sys_role_menu(role_id, menu_id) values
<foreach item="item" index="index" collection="list" separator=",">
(#{item.roleId},#{item.menuId})
</foreach>
</insert>
</mapper>

View File

@ -1,182 +1,182 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.project.system.mapper.SysUserMapper">
<resultMap type="SysUser" id="SysUserResult">
<id property="userId" column="user_id" />
<result property="deptId" column="dept_id" />
<result property="userName" column="user_name" />
<result property="nickName" column="nick_name" />
<result property="email" column="email" />
<result property="phonenumber" column="phonenumber" />
<result property="sex" column="sex" />
<result property="avatar" column="avatar" />
<result property="password" column="password" />
<result property="status" column="status" />
<result property="delFlag" column="del_flag" />
<result property="loginIp" column="login_ip" />
<result property="loginDate" column="login_date" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
<association property="dept" column="dept_id" javaType="SysDept" resultMap="deptResult" />
<collection property="roles" javaType="java.util.List" resultMap="RoleResult" />
</resultMap>
<resultMap id="deptResult" type="SysDept">
<id property="deptId" column="dept_id" />
<result property="parentId" column="parent_id" />
<result property="deptName" column="dept_name" />
<result property="orderNum" column="order_num" />
<result property="leader" column="leader" />
<result property="status" column="dept_status" />
</resultMap>
<resultMap id="RoleResult" type="SysRole">
<id property="roleId" column="role_id" />
<result property="roleName" column="role_name" />
<result property="roleKey" column="role_key" />
<result property="roleSort" column="role_sort" />
<result property="dataScope" column="data_scope" />
<result property="status" column="role_status" />
</resultMap>
<sql id="selectUserVo">
select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,
d.dept_id, d.parent_id, d.dept_name, d.order_num, d.leader, d.status as dept_status,
r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status
from sys_user u
left join sys_dept d on u.dept_id = d.dept_id
left join sys_user_role ur on u.user_id = ur.user_id
left join sys_role r on r.role_id = ur.role_id
</sql>
<select id="selectUserList" parameterType="SysUser" resultMap="SysUserResult">
select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader from sys_user u
left join sys_dept d on u.dept_id = d.dept_id
where u.del_flag = '0'
<if test="userName != null and userName != ''">
AND u.user_name like concat('%', #{userName}, '%')
</if>
<if test="status != null and status != ''">
AND u.status = #{status}
</if>
<if test="phonenumber != null and phonenumber != ''">
AND u.phonenumber like concat('%', #{phonenumber}, '%')
</if>
<if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
AND date_format(u.create_time,'%y%m%d') &gt;= date_format(#{beginTime},'%y%m%d')
</if>
<if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
AND date_format(u.create_time,'%y%m%d') &lt;= date_format(#{endTime},'%y%m%d')
</if>
<if test="deptId != null and deptId != 0">
AND (u.dept_id = #{deptId} OR u.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE FIND_IN_SET (#{deptId},ancestors) ))
</if>
<!-- 数据范围过滤 -->
${dataScope}
</select>
<select id="selectUserByUserName" parameterType="String" resultMap="SysUserResult">
<include refid="selectUserVo"/>
where u.user_name = #{userName}
</select>
<select id="selectUserById" parameterType="Long" resultMap="SysUserResult">
<include refid="selectUserVo"/>
where u.user_id = #{userId}
</select>
<select id="checkUserNameUnique" parameterType="String" resultType="int">
select count(1) from sys_user where user_name = #{userName}
</select>
<select id="checkPhoneUnique" parameterType="String" resultMap="SysUserResult">
select user_id, phonenumber from sys_user where phonenumber = #{phonenumber}
</select>
<select id="checkEmailUnique" parameterType="String" resultMap="SysUserResult">
select user_id, email from sys_user where email = #{email}
</select>
<insert id="insertUser" parameterType="SysUser" useGeneratedKeys="true" keyProperty="userId">
insert into sys_user(
<if test="userId != null and userId != 0">user_id,</if>
<if test="deptId != null and deptId != 0">dept_id,</if>
<if test="userName != null and userName != ''">user_name,</if>
<if test="nickName != null and nickName != ''">nick_name,</if>
<if test="email != null and email != ''">email,</if>
<if test="avatar != null and avatar != ''">avatar,</if>
<if test="phonenumber != null and phonenumber != ''">phonenumber,</if>
<if test="sex != null and sex != ''">sex,</if>
<if test="password != null and password != ''">password,</if>
<if test="status != null and status != ''">status,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
<if test="remark != null and remark != ''">remark,</if>
create_time
)values(
<if test="userId != null and userId != ''">#{userId},</if>
<if test="deptId != null and deptId != ''">#{deptId},</if>
<if test="userName != null and userName != ''">#{userName},</if>
<if test="nickName != null and nickName != ''">#{nickName},</if>
<if test="email != null and email != ''">#{email},</if>
<if test="avatar != null and avatar != ''">#{avatar},</if>
<if test="phonenumber != null and phonenumber != ''">#{phonenumber},</if>
<if test="sex != null and sex != ''">#{sex},</if>
<if test="password != null and password != ''">#{password},</if>
<if test="status != null and status != ''">#{status},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
<if test="remark != null and remark != ''">#{remark},</if>
sysdate()
)
</insert>
<update id="updateUser" parameterType="SysUser">
update sys_user
<set>
<if test="deptId != null and deptId != 0">dept_id = #{deptId},</if>
<if test="userName != null and userName != ''">user_name = #{userName},</if>
<if test="nickName != null and nickName != ''">nick_name = #{nickName},</if>
<if test="email != null and email != ''">email = #{email},</if>
<if test="phonenumber != null and phonenumber != ''">phonenumber = #{phonenumber},</if>
<if test="sex != null and sex != ''">sex = #{sex},</if>
<if test="avatar != null and avatar != ''">avatar = #{avatar},</if>
<if test="password != null and password != ''">password = #{password},</if>
<if test="status != null and status != ''">status = #{status},</if>
<if test="loginIp != null and loginIp != ''">login_ip = #{loginIp},</if>
<if test="loginDate != null">login_date = #{loginDate},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
<if test="remark != null">remark = #{remark},</if>
update_time = sysdate()
</set>
where user_id = #{userId}
</update>
<update id="updateUserStatus" parameterType="SysUser">
update sys_user set status = #{status} where user_id = #{userId}
</update>
<update id="updateUserAvatar" parameterType="SysUser">
update sys_user set avatar = #{avatar} where user_name = #{userName}
</update>
<update id="resetUserPwd" parameterType="SysUser">
update sys_user set password = #{password} where user_name = #{userName}
</update>
<delete id="deleteUserById" parameterType="Long">
delete from sys_user where user_id = #{userId}
</delete>
<delete id="deleteUserByIds" parameterType="Long">
update sys_user set del_flag = '2' where user_id in
<foreach collection="array" item="userId" open="(" separator="," close=")">
#{userId}
</foreach>
</delete>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.uvaluation.project.system.mapper.SysUserMapper">
<resultMap type="SysUser" id="SysUserResult">
<id property="userId" column="user_id" />
<result property="deptId" column="dept_id" />
<result property="userName" column="user_name" />
<result property="nickName" column="nick_name" />
<result property="email" column="email" />
<result property="phonenumber" column="phonenumber" />
<result property="sex" column="sex" />
<result property="avatar" column="avatar" />
<result property="password" column="password" />
<result property="status" column="status" />
<result property="delFlag" column="del_flag" />
<result property="loginIp" column="login_ip" />
<result property="loginDate" column="login_date" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
<association property="dept" column="dept_id" javaType="SysDept" resultMap="deptResult" />
<collection property="roles" javaType="java.util.List" resultMap="RoleResult" />
</resultMap>
<resultMap id="deptResult" type="SysDept">
<id property="deptId" column="dept_id" />
<result property="parentId" column="parent_id" />
<result property="deptName" column="dept_name" />
<result property="orderNum" column="order_num" />
<result property="leader" column="leader" />
<result property="status" column="dept_status" />
</resultMap>
<resultMap id="RoleResult" type="SysRole">
<id property="roleId" column="role_id" />
<result property="roleName" column="role_name" />
<result property="roleKey" column="role_key" />
<result property="roleSort" column="role_sort" />
<result property="dataScope" column="data_scope" />
<result property="status" column="role_status" />
</resultMap>
<sql id="selectUserVo">
select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,
d.dept_id, d.parent_id, d.dept_name, d.order_num, d.leader, d.status as dept_status,
r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status
from sys_user u
left join sys_dept d on u.dept_id = d.dept_id
left join sys_user_role ur on u.user_id = ur.user_id
left join sys_role r on r.role_id = ur.role_id
</sql>
<select id="selectUserList" parameterType="SysUser" resultMap="SysUserResult">
select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader from sys_user u
left join sys_dept d on u.dept_id = d.dept_id
where u.del_flag = '0'
<if test="userName != null and userName != ''">
AND u.user_name like concat('%', #{userName}, '%')
</if>
<if test="status != null and status != ''">
AND u.status = #{status}
</if>
<if test="phonenumber != null and phonenumber != ''">
AND u.phonenumber like concat('%', #{phonenumber}, '%')
</if>
<if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
AND date_format(u.create_time,'%y%m%d') &gt;= date_format(#{beginTime},'%y%m%d')
</if>
<if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
AND date_format(u.create_time,'%y%m%d') &lt;= date_format(#{endTime},'%y%m%d')
</if>
<if test="deptId != null and deptId != 0">
AND (u.dept_id = #{deptId} OR u.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE FIND_IN_SET (#{deptId},ancestors) ))
</if>
<!-- 数据范围过滤 -->
${dataScope}
</select>
<select id="selectUserByUserName" parameterType="String" resultMap="SysUserResult">
<include refid="selectUserVo"/>
where u.user_name = #{userName}
</select>
<select id="selectUserById" parameterType="Long" resultMap="SysUserResult">
<include refid="selectUserVo"/>
where u.user_id = #{userId}
</select>
<select id="checkUserNameUnique" parameterType="String" resultType="int">
select count(1) from sys_user where user_name = #{userName}
</select>
<select id="checkPhoneUnique" parameterType="String" resultMap="SysUserResult">
select user_id, phonenumber from sys_user where phonenumber = #{phonenumber}
</select>
<select id="checkEmailUnique" parameterType="String" resultMap="SysUserResult">
select user_id, email from sys_user where email = #{email}
</select>
<insert id="insertUser" parameterType="SysUser" useGeneratedKeys="true" keyProperty="userId">
insert into sys_user(
<if test="userId != null and userId != 0">user_id,</if>
<if test="deptId != null and deptId != 0">dept_id,</if>
<if test="userName != null and userName != ''">user_name,</if>
<if test="nickName != null and nickName != ''">nick_name,</if>
<if test="email != null and email != ''">email,</if>
<if test="avatar != null and avatar != ''">avatar,</if>
<if test="phonenumber != null and phonenumber != ''">phonenumber,</if>
<if test="sex != null and sex != ''">sex,</if>
<if test="password != null and password != ''">password,</if>
<if test="status != null and status != ''">status,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
<if test="remark != null and remark != ''">remark,</if>
create_time
)values(
<if test="userId != null and userId != ''">#{userId},</if>
<if test="deptId != null and deptId != ''">#{deptId},</if>
<if test="userName != null and userName != ''">#{userName},</if>
<if test="nickName != null and nickName != ''">#{nickName},</if>
<if test="email != null and email != ''">#{email},</if>
<if test="avatar != null and avatar != ''">#{avatar},</if>
<if test="phonenumber != null and phonenumber != ''">#{phonenumber},</if>
<if test="sex != null and sex != ''">#{sex},</if>
<if test="password != null and password != ''">#{password},</if>
<if test="status != null and status != ''">#{status},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
<if test="remark != null and remark != ''">#{remark},</if>
sysdate()
)
</insert>
<update id="updateUser" parameterType="SysUser">
update sys_user
<set>
<if test="deptId != null and deptId != 0">dept_id = #{deptId},</if>
<if test="userName != null and userName != ''">user_name = #{userName},</if>
<if test="nickName != null and nickName != ''">nick_name = #{nickName},</if>
<if test="email != null and email != ''">email = #{email},</if>
<if test="phonenumber != null and phonenumber != ''">phonenumber = #{phonenumber},</if>
<if test="sex != null and sex != ''">sex = #{sex},</if>
<if test="avatar != null and avatar != ''">avatar = #{avatar},</if>
<if test="password != null and password != ''">password = #{password},</if>
<if test="status != null and status != ''">status = #{status},</if>
<if test="loginIp != null and loginIp != ''">login_ip = #{loginIp},</if>
<if test="loginDate != null">login_date = #{loginDate},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
<if test="remark != null">remark = #{remark},</if>
update_time = sysdate()
</set>
where user_id = #{userId}
</update>
<update id="updateUserStatus" parameterType="SysUser">
update sys_user set status = #{status} where user_id = #{userId}
</update>
<update id="updateUserAvatar" parameterType="SysUser">
update sys_user set avatar = #{avatar} where user_name = #{userName}
</update>
<update id="resetUserPwd" parameterType="SysUser">
update sys_user set password = #{password} where user_name = #{userName}
</update>
<delete id="deleteUserById" parameterType="Long">
delete from sys_user where user_id = #{userId}
</delete>
<delete id="deleteUserByIds" parameterType="Long">
update sys_user set del_flag = '2' where user_id in
<foreach collection="array" item="userId" open="(" separator="," close=")">
#{userId}
</foreach>
</delete>
</mapper>

View File

@ -1,34 +1,34 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.project.system.mapper.SysUserPostMapper">
<resultMap type="SysUserPost" id="SysUserPostResult">
<result property="userId" column="user_id" />
<result property="postId" column="post_id" />
</resultMap>
<delete id="deleteUserPostByUserId" parameterType="Long">
delete from sys_user_post where user_id=#{userId}
</delete>
<select id="countUserPostById" resultType="Integer">
select count(1) from sys_user_post where post_id=#{postId}
</select>
<delete id="deleteUserPost" parameterType="Long">
delete from sys_user_post where user_id in
<foreach collection="array" item="userId" open="(" separator="," close=")">
#{userId}
</foreach>
</delete>
<insert id="batchUserPost">
insert into sys_user_post(user_id, post_id) values
<foreach item="item" index="index" collection="list" separator=",">
(#{item.userId},#{item.postId})
</foreach>
</insert>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.uvaluation.project.system.mapper.SysUserPostMapper">
<resultMap type="SysUserPost" id="SysUserPostResult">
<result property="userId" column="user_id" />
<result property="postId" column="post_id" />
</resultMap>
<delete id="deleteUserPostByUserId" parameterType="Long">
delete from sys_user_post where user_id=#{userId}
</delete>
<select id="countUserPostById" resultType="Integer">
select count(1) from sys_user_post where post_id=#{postId}
</select>
<delete id="deleteUserPost" parameterType="Long">
delete from sys_user_post where user_id in
<foreach collection="array" item="userId" open="(" separator="," close=")">
#{userId}
</foreach>
</delete>
<insert id="batchUserPost">
insert into sys_user_post(user_id, post_id) values
<foreach item="item" index="index" collection="list" separator=",">
(#{item.userId},#{item.postId})
</foreach>
</insert>
</mapper>

View File

@ -1,44 +1,44 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.project.system.mapper.SysUserRoleMapper">
<resultMap type="SysUserRole" id="SysUserRoleResult">
<result property="userId" column="user_id" />
<result property="roleId" column="role_id" />
</resultMap>
<delete id="deleteUserRoleByUserId" parameterType="Long">
delete from sys_user_role where user_id=#{userId}
</delete>
<select id="countUserRoleByRoleId" resultType="Integer">
select count(1) from sys_user_role where role_id=#{roleId}
</select>
<delete id="deleteUserRole" parameterType="Long">
delete from sys_user_role where user_id in
<foreach collection="array" item="userId" open="(" separator="," close=")">
#{userId}
</foreach>
</delete>
<insert id="batchUserRole">
insert into sys_user_role(user_id, role_id) values
<foreach item="item" index="index" collection="list" separator=",">
(#{item.userId},#{item.roleId})
</foreach>
</insert>
<delete id="deleteUserRoleInfo" parameterType="SysUserRole">
delete from sys_user_role where user_id=#{userId} and role_id=#{roleId}
</delete>
<delete id="deleteUserRoleInfos">
delete from sys_user_role where role_id=#{roleId} and user_id in
<foreach collection="userIds" item="userId" open="(" separator="," close=")">
#{userId}
</foreach>
</delete>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.uvaluation.project.system.mapper.SysUserRoleMapper">
<resultMap type="SysUserRole" id="SysUserRoleResult">
<result property="userId" column="user_id" />
<result property="roleId" column="role_id" />
</resultMap>
<delete id="deleteUserRoleByUserId" parameterType="Long">
delete from sys_user_role where user_id=#{userId}
</delete>
<select id="countUserRoleByRoleId" resultType="Integer">
select count(1) from sys_user_role where role_id=#{roleId}
</select>
<delete id="deleteUserRole" parameterType="Long">
delete from sys_user_role where user_id in
<foreach collection="array" item="userId" open="(" separator="," close=")">
#{userId}
</foreach>
</delete>
<insert id="batchUserRole">
insert into sys_user_role(user_id, role_id) values
<foreach item="item" index="index" collection="list" separator=",">
(#{item.userId},#{item.roleId})
</foreach>
</insert>
<delete id="deleteUserRoleInfo" parameterType="SysUserRole">
delete from sys_user_role where user_id=#{userId} and role_id=#{roleId}
</delete>
<delete id="deleteUserRoleInfos">
delete from sys_user_role where role_id=#{roleId} and user_id in
<foreach collection="userIds" item="userId" open="(" separator="," close=")">
#{userId}
</foreach>
</delete>
</mapper>

View File

@ -2,13 +2,13 @@
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.project.system.mapper.UploadFileMapper">
<mapper namespace="com.uvaluation.project.system.mapper.UploadFileMapper">
<resultMap type="SysUserRole" id="SysUserRoleResult">
<result property="userId" column="user_id" />
<result property="roleId" column="role_id" />
</resultMap>
<insert id="insert" parameterType="com.ruoyi.project.system.domain.UploadFile">
<insert id="insert" parameterType="com.uvaluation.project.system.domain.UploadFile">
insert into sys_file(fk, save_file_name, file_name, module_name, create_by, create_time)
value (#{fk},#{saveFileName},#{fileName},#{moduleName},#{createBy},now());
</insert>
@ -17,7 +17,7 @@
delete from sys_file where id=#{id};
</delete>
<select id="getByFk" parameterType="com.ruoyi.project.system.domain.UploadFile">
<select id="getByFk" parameterType="com.uvaluation.project.system.domain.UploadFile">
select fk, save_file_name as saveFileName, file_name as fileName, module_name as moduleName, create_by as
createBy, create_time as createTime
from sys_file where fk=#{fk}

View File

@ -1,120 +1,120 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.project.tool.gen.mapper.GenTableColumnMapper">
<resultMap type="GenTableColumn" id="GenTableColumnResult">
<id property="columnId" column="column_id" />
<result property="tableId" column="table_id" />
<result property="columnName" column="column_name" />
<result property="columnComment" column="column_comment" />
<result property="columnType" column="column_type" />
<result property="javaType" column="java_type" />
<result property="javaField" column="java_field" />
<result property="isPk" column="is_pk" />
<result property="isIncrement" column="is_increment" />
<result property="isRequired" column="is_required" />
<result property="isInsert" column="is_insert" />
<result property="isEdit" column="is_edit" />
<result property="isList" column="is_list" />
<result property="isQuery" column="is_query" />
<result property="queryType" column="query_type" />
<result property="htmlType" column="html_type" />
<result property="dictType" column="dict_type" />
<result property="sort" column="sort" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectGenTableColumnVo">
select column_id, table_id, column_name, column_comment, column_type, java_type, java_field, is_pk, is_increment, is_required, is_insert, is_edit, is_list, is_query, query_type, html_type, dict_type, sort, create_by, create_time, update_by, update_time from gen_table_column
</sql>
<select id="selectGenTableColumnListByTableId" parameterType="Long" resultMap="GenTableColumnResult">
<include refid="selectGenTableColumnVo"/>
where table_id = #{tableId}
order by sort
</select>
<select id="selectDbTableColumnsByName" parameterType="String" resultMap="GenTableColumnResult">
select column_name, (case when (is_nullable = 'no' <![CDATA[ && ]]> column_key != 'PRI') then '1' else null end) as is_required, (case when column_key = 'PRI' then '1' else '0' end) as is_pk, ordinal_position as sort, column_comment, (case when extra = 'auto_increment' then '1' else '0' end) as is_increment, column_type
from information_schema.columns where table_schema = (select database()) and table_name = (#{tableName})
order by ordinal_position
</select>
<insert id="insertGenTableColumn" parameterType="GenTableColumn" useGeneratedKeys="true" keyProperty="columnId">
insert into gen_table_column (
<if test="tableId != null and tableId != ''">table_id,</if>
<if test="columnName != null and columnName != ''">column_name,</if>
<if test="columnComment != null and columnComment != ''">column_comment,</if>
<if test="columnType != null and columnType != ''">column_type,</if>
<if test="javaType != null and javaType != ''">java_type,</if>
<if test="javaField != null and javaField != ''">java_field,</if>
<if test="isPk != null and isPk != ''">is_pk,</if>
<if test="isIncrement != null and isIncrement != ''">is_increment,</if>
<if test="isRequired != null and isRequired != ''">is_required,</if>
<if test="isInsert != null and isInsert != ''">is_insert,</if>
<if test="isEdit != null and isEdit != ''">is_edit,</if>
<if test="isList != null and isList != ''">is_list,</if>
<if test="isQuery != null and isQuery != ''">is_query,</if>
<if test="queryType != null and queryType != ''">query_type,</if>
<if test="htmlType != null and htmlType != ''">html_type,</if>
<if test="dictType != null and dictType != ''">dict_type,</if>
<if test="sort != null">sort,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
create_time
)values(
<if test="tableId != null and tableId != ''">#{tableId},</if>
<if test="columnName != null and columnName != ''">#{columnName},</if>
<if test="columnComment != null and columnComment != ''">#{columnComment},</if>
<if test="columnType != null and columnType != ''">#{columnType},</if>
<if test="javaType != null and javaType != ''">#{javaType},</if>
<if test="javaField != null and javaField != ''">#{javaField},</if>
<if test="isPk != null and isPk != ''">#{isPk},</if>
<if test="isIncrement != null and isIncrement != ''">#{isIncrement},</if>
<if test="isRequired != null and isRequired != ''">#{isRequired},</if>
<if test="isInsert != null and isInsert != ''">#{isInsert},</if>
<if test="isEdit != null and isEdit != ''">#{isEdit},</if>
<if test="isList != null and isList != ''">#{isList},</if>
<if test="isQuery != null and isQuery != ''">#{isQuery},</if>
<if test="queryType != null and queryType != ''">#{queryType},</if>
<if test="htmlType != null and htmlType != ''">#{htmlType},</if>
<if test="dictType != null and dictType != ''">#{dictType},</if>
<if test="sort != null">#{sort},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
sysdate()
)
</insert>
<update id="updateGenTableColumn" parameterType="GenTableColumn">
update gen_table_column
<set>
column_comment = #{columnComment},
java_type = #{javaType},
java_field = #{javaField},
is_insert = #{isInsert},
is_edit = #{isEdit},
is_list = #{isList},
is_query = #{isQuery},
is_required = #{isRequired},
query_type = #{queryType},
html_type = #{htmlType},
dict_type = #{dictType},
sort = #{sort},
update_by = #{updateBy},
update_time = sysdate()
</set>
where column_id = #{columnId}
</update>
<delete id="deleteGenTableColumnByIds" parameterType="Long">
delete from gen_table_column where table_id in
<foreach collection="array" item="tableId" open="(" separator="," close=")">
#{tableId}
</foreach>
</delete>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.uvaluation.project.tool.gen.mapper.GenTableColumnMapper">
<resultMap type="GenTableColumn" id="GenTableColumnResult">
<id property="columnId" column="column_id" />
<result property="tableId" column="table_id" />
<result property="columnName" column="column_name" />
<result property="columnComment" column="column_comment" />
<result property="columnType" column="column_type" />
<result property="javaType" column="java_type" />
<result property="javaField" column="java_field" />
<result property="isPk" column="is_pk" />
<result property="isIncrement" column="is_increment" />
<result property="isRequired" column="is_required" />
<result property="isInsert" column="is_insert" />
<result property="isEdit" column="is_edit" />
<result property="isList" column="is_list" />
<result property="isQuery" column="is_query" />
<result property="queryType" column="query_type" />
<result property="htmlType" column="html_type" />
<result property="dictType" column="dict_type" />
<result property="sort" column="sort" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectGenTableColumnVo">
select column_id, table_id, column_name, column_comment, column_type, java_type, java_field, is_pk, is_increment, is_required, is_insert, is_edit, is_list, is_query, query_type, html_type, dict_type, sort, create_by, create_time, update_by, update_time from gen_table_column
</sql>
<select id="selectGenTableColumnListByTableId" parameterType="Long" resultMap="GenTableColumnResult">
<include refid="selectGenTableColumnVo"/>
where table_id = #{tableId}
order by sort
</select>
<select id="selectDbTableColumnsByName" parameterType="String" resultMap="GenTableColumnResult">
select column_name, (case when (is_nullable = 'no' <![CDATA[ && ]]> column_key != 'PRI') then '1' else null end) as is_required, (case when column_key = 'PRI' then '1' else '0' end) as is_pk, ordinal_position as sort, column_comment, (case when extra = 'auto_increment' then '1' else '0' end) as is_increment, column_type
from information_schema.columns where table_schema = (select database()) and table_name = (#{tableName})
order by ordinal_position
</select>
<insert id="insertGenTableColumn" parameterType="GenTableColumn" useGeneratedKeys="true" keyProperty="columnId">
insert into gen_table_column (
<if test="tableId != null and tableId != ''">table_id,</if>
<if test="columnName != null and columnName != ''">column_name,</if>
<if test="columnComment != null and columnComment != ''">column_comment,</if>
<if test="columnType != null and columnType != ''">column_type,</if>
<if test="javaType != null and javaType != ''">java_type,</if>
<if test="javaField != null and javaField != ''">java_field,</if>
<if test="isPk != null and isPk != ''">is_pk,</if>
<if test="isIncrement != null and isIncrement != ''">is_increment,</if>
<if test="isRequired != null and isRequired != ''">is_required,</if>
<if test="isInsert != null and isInsert != ''">is_insert,</if>
<if test="isEdit != null and isEdit != ''">is_edit,</if>
<if test="isList != null and isList != ''">is_list,</if>
<if test="isQuery != null and isQuery != ''">is_query,</if>
<if test="queryType != null and queryType != ''">query_type,</if>
<if test="htmlType != null and htmlType != ''">html_type,</if>
<if test="dictType != null and dictType != ''">dict_type,</if>
<if test="sort != null">sort,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
create_time
)values(
<if test="tableId != null and tableId != ''">#{tableId},</if>
<if test="columnName != null and columnName != ''">#{columnName},</if>
<if test="columnComment != null and columnComment != ''">#{columnComment},</if>
<if test="columnType != null and columnType != ''">#{columnType},</if>
<if test="javaType != null and javaType != ''">#{javaType},</if>
<if test="javaField != null and javaField != ''">#{javaField},</if>
<if test="isPk != null and isPk != ''">#{isPk},</if>
<if test="isIncrement != null and isIncrement != ''">#{isIncrement},</if>
<if test="isRequired != null and isRequired != ''">#{isRequired},</if>
<if test="isInsert != null and isInsert != ''">#{isInsert},</if>
<if test="isEdit != null and isEdit != ''">#{isEdit},</if>
<if test="isList != null and isList != ''">#{isList},</if>
<if test="isQuery != null and isQuery != ''">#{isQuery},</if>
<if test="queryType != null and queryType != ''">#{queryType},</if>
<if test="htmlType != null and htmlType != ''">#{htmlType},</if>
<if test="dictType != null and dictType != ''">#{dictType},</if>
<if test="sort != null">#{sort},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
sysdate()
)
</insert>
<update id="updateGenTableColumn" parameterType="GenTableColumn">
update gen_table_column
<set>
column_comment = #{columnComment},
java_type = #{javaType},
java_field = #{javaField},
is_insert = #{isInsert},
is_edit = #{isEdit},
is_list = #{isList},
is_query = #{isQuery},
is_required = #{isRequired},
query_type = #{queryType},
html_type = #{htmlType},
dict_type = #{dictType},
sort = #{sort},
update_by = #{updateBy},
update_time = sysdate()
</set>
where column_id = #{columnId}
</update>
<delete id="deleteGenTableColumnByIds" parameterType="Long">
delete from gen_table_column where table_id in
<foreach collection="array" item="tableId" open="(" separator="," close=")">
#{tableId}
</foreach>
</delete>
</mapper>

View File

@ -1,181 +1,181 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.project.tool.gen.mapper.GenTableMapper">
<resultMap type="GenTable" id="GenTableResult">
<id property="tableId" column="table_id" />
<result property="tableName" column="table_name" />
<result property="tableComment" column="table_comment" />
<result property="className" column="class_name" />
<result property="tplCategory" column="tpl_category" />
<result property="packageName" column="package_name" />
<result property="moduleName" column="module_name" />
<result property="businessName" column="business_name" />
<result property="functionName" column="function_name" />
<result property="functionAuthor" column="function_author" />
<result property="options" column="options" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
<collection property="columns" javaType="java.util.List" resultMap="GenTableColumnResult" />
</resultMap>
<resultMap type="GenTableColumn" id="GenTableColumnResult">
<id property="columnId" column="column_id" />
<result property="tableId" column="table_id" />
<result property="columnName" column="column_name" />
<result property="columnComment" column="column_comment" />
<result property="columnType" column="column_type" />
<result property="javaType" column="java_type" />
<result property="javaField" column="java_field" />
<result property="isPk" column="is_pk" />
<result property="isIncrement" column="is_increment" />
<result property="isRequired" column="is_required" />
<result property="isInsert" column="is_insert" />
<result property="isEdit" column="is_edit" />
<result property="isList" column="is_list" />
<result property="isQuery" column="is_query" />
<result property="queryType" column="query_type" />
<result property="htmlType" column="html_type" />
<result property="dictType" column="dict_type" />
<result property="sort" column="sort" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectGenTableVo">
select table_id, table_name, table_comment, class_name, tpl_category, package_name, module_name, business_name, function_name, function_author, options, create_by, create_time, update_by, update_time, remark from gen_table
</sql>
<select id="selectGenTableList" parameterType="GenTable" resultMap="GenTableResult">
<include refid="selectGenTableVo"/>
<where>
<if test="tableName != null and tableName != ''">
AND lower(table_name) like lower(concat('%', #{tableName}, '%'))
</if>
<if test="tableComment != null and tableComment != ''">
AND lower(table_comment) like lower(concat('%', #{tableComment}, '%'))
</if>
<!-- <if test="beginTime != null and beginTime != ''">开始时间检索 -->
<!-- AND date_format(create_time,'%y%m%d') &gt;= date_format(#{beginTime},'%y%m%d') -->
<!-- </if> -->
<!-- <if test="endTime != null and endTime != ''">结束时间检索 -->
<!-- AND date_format(create_time,'%y%m%d') &lt;= date_format(#{endTime},'%y%m%d') -->
<!-- </if> -->
</where>
</select>
<select id="selectDbTableList" parameterType="GenTable" resultMap="GenTableResult">
select table_name, table_comment, create_time, update_time from information_schema.tables
where table_schema = (select database())
AND table_name NOT LIKE 'qrtz_%' AND table_name NOT LIKE 'gen_%'
AND table_name NOT IN (select table_name from gen_table)
<if test="tableName != null and tableName != ''">
AND lower(table_name) like lower(concat('%', #{tableName}, '%'))
</if>
<if test="tableComment != null and tableComment != ''">
AND lower(table_comment) like lower(concat('%', #{tableComment}, '%'))
</if>
<if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
AND date_format(create_time,'%y%m%d') &gt;= date_format(#{beginTime},'%y%m%d')
</if>
<if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
AND date_format(create_time,'%y%m%d') &lt;= date_format(#{endTime},'%y%m%d')
</if>
</select>
<select id="selectDbTableListByNames" resultMap="GenTableResult">
select table_name, table_comment, create_time, update_time from information_schema.tables
where table_name NOT LIKE 'qrtz_%' and table_name NOT LIKE 'gen_%' and table_schema = (select database())
and table_name in
<foreach collection="array" item="name" open="(" separator="," close=")">
#{name}
</foreach>
</select>
<select id="selectTableByName" parameterType="String" resultMap="GenTableResult">
select table_name, table_comment, create_time, update_time from information_schema.tables
where table_comment <![CDATA[ <> ]]> '' and table_schema = (select database())
and table_name = #{tableName}
</select>
<select id="selectGenTableById" parameterType="Long" resultMap="GenTableResult">
SELECT t.table_id, t.table_name, t.table_comment, t.class_name, t.tpl_category, t.package_name, t.module_name, t.business_name, t.function_name, t.function_author, t.options, t.remark,
c.column_id, c.column_name, c.column_comment, c.column_type, c.java_type, c.java_field, c.is_pk, c.is_increment, c.is_required, c.is_insert, c.is_edit, c.is_list, c.is_query, c.query_type, c.html_type, c.dict_type, c.sort
FROM gen_table t
LEFT JOIN gen_table_column c ON t.table_id = c.table_id
where t.table_id = #{tableId} order by c.sort
</select>
<select id="selectGenTableByName" parameterType="String" resultMap="GenTableResult">
SELECT t.table_id, t.table_name, t.table_comment, t.class_name, t.tpl_category, t.package_name, t.module_name, t.business_name, t.function_name, t.function_author, t.options, t.remark,
c.column_id, c.column_name, c.column_comment, c.column_type, c.java_type, c.java_field, c.is_pk, c.is_increment, c.is_required, c.is_insert, c.is_edit, c.is_list, c.is_query, c.query_type, c.html_type, c.dict_type, c.sort
FROM gen_table t
LEFT JOIN gen_table_column c ON t.table_id = c.table_id
where t.table_name = #{tableName} order by c.sort
</select>
<insert id="insertGenTable" parameterType="GenTable" useGeneratedKeys="true" keyProperty="tableId">
insert into gen_table (
<if test="tableName != null">table_name,</if>
<if test="tableComment != null and tableComment != ''">table_comment,</if>
<if test="className != null and className != ''">class_name,</if>
<if test="tplCategory != null and tplCategory != ''">tpl_category,</if>
<if test="packageName != null and packageName != ''">package_name,</if>
<if test="moduleName != null and moduleName != ''">module_name,</if>
<if test="businessName != null and businessName != ''">business_name,</if>
<if test="functionName != null and functionName != ''">function_name,</if>
<if test="functionAuthor != null and functionAuthor != ''">function_author,</if>
<if test="remark != null and remark != ''">remark,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
create_time
)values(
<if test="tableName != null">#{tableName},</if>
<if test="tableComment != null and tableComment != ''">#{tableComment},</if>
<if test="className != null and className != ''">#{className},</if>
<if test="tplCategory != null and tplCategory != ''">#{tplCategory},</if>
<if test="packageName != null and packageName != ''">#{packageName},</if>
<if test="moduleName != null and moduleName != ''">#{moduleName},</if>
<if test="businessName != null and businessName != ''">#{businessName},</if>
<if test="functionName != null and functionName != ''">#{functionName},</if>
<if test="functionAuthor != null and functionAuthor != ''">#{functionAuthor},</if>
<if test="remark != null and remark != ''">#{remark},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
sysdate()
)
</insert>
<update id="updateGenTable" parameterType="GenTable">
update gen_table
<set>
<if test="tableName != null">table_name = #{tableName},</if>
<if test="tableComment != null and tableComment != ''">table_comment = #{tableComment},</if>
<if test="className != null and className != ''">class_name = #{className},</if>
<if test="functionAuthor != null and functionAuthor != ''">function_author = #{functionAuthor},</if>
<if test="tplCategory != null and tplCategory != ''">tpl_category = #{tplCategory},</if>
<if test="packageName != null and packageName != ''">package_name = #{packageName},</if>
<if test="moduleName != null and moduleName != ''">module_name = #{moduleName},</if>
<if test="businessName != null and businessName != ''">business_name = #{businessName},</if>
<if test="functionName != null and functionName != ''">function_name = #{functionName},</if>
<if test="options != null and options != ''">options = #{options},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
<if test="remark != null">remark = #{remark},</if>
update_time = sysdate()
</set>
where table_id = #{tableId}
</update>
<delete id="deleteGenTableByIds" parameterType="Long">
delete from gen_table where table_id in
<foreach collection="array" item="tableId" open="(" separator="," close=")">
#{tableId}
</foreach>
</delete>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.uvaluation.project.tool.gen.mapper.GenTableMapper">
<resultMap type="GenTable" id="GenTableResult">
<id property="tableId" column="table_id" />
<result property="tableName" column="table_name" />
<result property="tableComment" column="table_comment" />
<result property="className" column="class_name" />
<result property="tplCategory" column="tpl_category" />
<result property="packageName" column="package_name" />
<result property="moduleName" column="module_name" />
<result property="businessName" column="business_name" />
<result property="functionName" column="function_name" />
<result property="functionAuthor" column="function_author" />
<result property="options" column="options" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
<collection property="columns" javaType="java.util.List" resultMap="GenTableColumnResult" />
</resultMap>
<resultMap type="GenTableColumn" id="GenTableColumnResult">
<id property="columnId" column="column_id" />
<result property="tableId" column="table_id" />
<result property="columnName" column="column_name" />
<result property="columnComment" column="column_comment" />
<result property="columnType" column="column_type" />
<result property="javaType" column="java_type" />
<result property="javaField" column="java_field" />
<result property="isPk" column="is_pk" />
<result property="isIncrement" column="is_increment" />
<result property="isRequired" column="is_required" />
<result property="isInsert" column="is_insert" />
<result property="isEdit" column="is_edit" />
<result property="isList" column="is_list" />
<result property="isQuery" column="is_query" />
<result property="queryType" column="query_type" />
<result property="htmlType" column="html_type" />
<result property="dictType" column="dict_type" />
<result property="sort" column="sort" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectGenTableVo">
select table_id, table_name, table_comment, class_name, tpl_category, package_name, module_name, business_name, function_name, function_author, options, create_by, create_time, update_by, update_time, remark from gen_table
</sql>
<select id="selectGenTableList" parameterType="GenTable" resultMap="GenTableResult">
<include refid="selectGenTableVo"/>
<where>
<if test="tableName != null and tableName != ''">
AND lower(table_name) like lower(concat('%', #{tableName}, '%'))
</if>
<if test="tableComment != null and tableComment != ''">
AND lower(table_comment) like lower(concat('%', #{tableComment}, '%'))
</if>
<!-- <if test="beginTime != null and beginTime != ''">开始时间检索 -->
<!-- AND date_format(create_time,'%y%m%d') &gt;= date_format(#{beginTime},'%y%m%d') -->
<!-- </if> -->
<!-- <if test="endTime != null and endTime != ''">结束时间检索 -->
<!-- AND date_format(create_time,'%y%m%d') &lt;= date_format(#{endTime},'%y%m%d') -->
<!-- </if> -->
</where>
</select>
<select id="selectDbTableList" parameterType="GenTable" resultMap="GenTableResult">
select table_name, table_comment, create_time, update_time from information_schema.tables
where table_schema = (select database())
AND table_name NOT LIKE 'qrtz_%' AND table_name NOT LIKE 'gen_%'
AND table_name NOT IN (select table_name from gen_table)
<if test="tableName != null and tableName != ''">
AND lower(table_name) like lower(concat('%', #{tableName}, '%'))
</if>
<if test="tableComment != null and tableComment != ''">
AND lower(table_comment) like lower(concat('%', #{tableComment}, '%'))
</if>
<if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
AND date_format(create_time,'%y%m%d') &gt;= date_format(#{beginTime},'%y%m%d')
</if>
<if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
AND date_format(create_time,'%y%m%d') &lt;= date_format(#{endTime},'%y%m%d')
</if>
</select>
<select id="selectDbTableListByNames" resultMap="GenTableResult">
select table_name, table_comment, create_time, update_time from information_schema.tables
where table_name NOT LIKE 'qrtz_%' and table_name NOT LIKE 'gen_%' and table_schema = (select database())
and table_name in
<foreach collection="array" item="name" open="(" separator="," close=")">
#{name}
</foreach>
</select>
<select id="selectTableByName" parameterType="String" resultMap="GenTableResult">
select table_name, table_comment, create_time, update_time from information_schema.tables
where table_comment <![CDATA[ <> ]]> '' and table_schema = (select database())
and table_name = #{tableName}
</select>
<select id="selectGenTableById" parameterType="Long" resultMap="GenTableResult">
SELECT t.table_id, t.table_name, t.table_comment, t.class_name, t.tpl_category, t.package_name, t.module_name, t.business_name, t.function_name, t.function_author, t.options, t.remark,
c.column_id, c.column_name, c.column_comment, c.column_type, c.java_type, c.java_field, c.is_pk, c.is_increment, c.is_required, c.is_insert, c.is_edit, c.is_list, c.is_query, c.query_type, c.html_type, c.dict_type, c.sort
FROM gen_table t
LEFT JOIN gen_table_column c ON t.table_id = c.table_id
where t.table_id = #{tableId} order by c.sort
</select>
<select id="selectGenTableByName" parameterType="String" resultMap="GenTableResult">
SELECT t.table_id, t.table_name, t.table_comment, t.class_name, t.tpl_category, t.package_name, t.module_name, t.business_name, t.function_name, t.function_author, t.options, t.remark,
c.column_id, c.column_name, c.column_comment, c.column_type, c.java_type, c.java_field, c.is_pk, c.is_increment, c.is_required, c.is_insert, c.is_edit, c.is_list, c.is_query, c.query_type, c.html_type, c.dict_type, c.sort
FROM gen_table t
LEFT JOIN gen_table_column c ON t.table_id = c.table_id
where t.table_name = #{tableName} order by c.sort
</select>
<insert id="insertGenTable" parameterType="GenTable" useGeneratedKeys="true" keyProperty="tableId">
insert into gen_table (
<if test="tableName != null">table_name,</if>
<if test="tableComment != null and tableComment != ''">table_comment,</if>
<if test="className != null and className != ''">class_name,</if>
<if test="tplCategory != null and tplCategory != ''">tpl_category,</if>
<if test="packageName != null and packageName != ''">package_name,</if>
<if test="moduleName != null and moduleName != ''">module_name,</if>
<if test="businessName != null and businessName != ''">business_name,</if>
<if test="functionName != null and functionName != ''">function_name,</if>
<if test="functionAuthor != null and functionAuthor != ''">function_author,</if>
<if test="remark != null and remark != ''">remark,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
create_time
)values(
<if test="tableName != null">#{tableName},</if>
<if test="tableComment != null and tableComment != ''">#{tableComment},</if>
<if test="className != null and className != ''">#{className},</if>
<if test="tplCategory != null and tplCategory != ''">#{tplCategory},</if>
<if test="packageName != null and packageName != ''">#{packageName},</if>
<if test="moduleName != null and moduleName != ''">#{moduleName},</if>
<if test="businessName != null and businessName != ''">#{businessName},</if>
<if test="functionName != null and functionName != ''">#{functionName},</if>
<if test="functionAuthor != null and functionAuthor != ''">#{functionAuthor},</if>
<if test="remark != null and remark != ''">#{remark},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
sysdate()
)
</insert>
<update id="updateGenTable" parameterType="GenTable">
update gen_table
<set>
<if test="tableName != null">table_name = #{tableName},</if>
<if test="tableComment != null and tableComment != ''">table_comment = #{tableComment},</if>
<if test="className != null and className != ''">class_name = #{className},</if>
<if test="functionAuthor != null and functionAuthor != ''">function_author = #{functionAuthor},</if>
<if test="tplCategory != null and tplCategory != ''">tpl_category = #{tplCategory},</if>
<if test="packageName != null and packageName != ''">package_name = #{packageName},</if>
<if test="moduleName != null and moduleName != ''">module_name = #{moduleName},</if>
<if test="businessName != null and businessName != ''">business_name = #{businessName},</if>
<if test="functionName != null and functionName != ''">function_name = #{functionName},</if>
<if test="options != null and options != ''">options = #{options},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
<if test="remark != null">remark = #{remark},</if>
update_time = sysdate()
</set>
where table_id = #{tableId}
</update>
<delete id="deleteGenTableByIds" parameterType="Long">
delete from gen_table where table_id in
<foreach collection="array" item="tableId" open="(" separator="," close=")">
#{tableId}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,327 @@
truncate table ODS_HOUSINGCASEDEAL_RENT_#yearMonth#;
---
select StringSub
, cast(row_number() over (order by charindex(StringSub, '零|一|二|三|四|五|六|七|八|九|十|')) - 1 as varchar) as SID
into #tmp
from StringSplit('零|一|二|三|四|五|六|七|八|九|十|', '|');
create table #HousingCaseListAdj
(
case_id varchar(32) not null
, HouseholdsID_SRC nvarchar(64) primary key
, ProjectID_SRC nvarchar(64) not null
, ProjectID nvarchar(64)
, BuildingID nvarchar(64)
, RentType tinyint
, Room tinyint
, Hall tinyint
, Bashroom tinyint
, Area decimal(18, 2)
, Towards nvarchar(64)
, UpperFloorSum nvarchar(32)
, UpperFloorNum nvarchar(32)
, Decoration nvarchar(64)
, PriceTotal decimal(18, 2) not null
, PriceUnit decimal(18, 2) not null
, PriceDateIn date
, PriceDateOut date
, CaseName nvarchar(512)
);
declare @HouseholdsID_SRC nvarchar(64)
, @CaseName nvarchar(512)
, @ProjectID nvarchar(64)
, @BuildingID nvarchar(64)
, @roomtype nvarchar(50)
, @UpperFloorSum nvarchar(32)
, @area decimal(28, 2)
, @towards nvarchar(50)
, @decora nvarchar(64)
, @price decimal(28, 2)
, @listDate date
, @dueDate date
, @case_id varchar(32);
declare @RentType tinyint
, @RoomOri nvarchar(32)
, @HallOri nvarchar(32)
, @BashroomOri nvarchar(32)
, @Room tinyint
, @Hall tinyint
, @Bashroom tinyint
, @priceunit decimal(28, 2);
declare Record2Insert cursor for
select case_id
, case_contract_no
, case_community_name
, case_opening_date
, case_closing_date
, case_rent_price
, case_area
, case_total_floor
, case_toward
, case_apartment_layout
, case_decoration
, clean_community_id
, clean_building_id
from ODS_HOUSINGCASEDEAL_RENT_#yearMonth#_RAW;
open Record2Insert;
fetch next from Record2Insert
into @case_id
, @HouseholdsID_SRC
, @CaseName
, @listDate
, @dueDate
, @price
, @area
, @UpperFloorSum
, @towards
, @roomtype
, @decora
, @ProjectID
, @BuildingID;
set nocount on; --
while @@fetch_status = 0
begin
begin
--
set @RoomOri = case
when charindex('', @roomtype, 1) <> 0 then
substring(@roomtype, charindex('', @roomtype, 1) - 1, 1)
end;
set @HallOri = case
when charindex('', @roomtype, 1) <> 0 then
substring(@roomtype, charindex('', @roomtype, 1) - 1, 1)
end;
set @BashroomOri = case
when charindex('', @roomtype, 1) <> 0 then
substring(@roomtype, charindex('', @roomtype, 1) - 1, 1)
end;
select @Room = SID
from #tmp
where (StringSub = @RoomOri)
or (SID = @RoomOri);
select @Hall = SID
from #tmp
where (StringSub = @HallOri)
or (SID = @HallOri);
select @Bashroom = SID
from #tmp
where (StringSub = @BashroomOri)
or (SID = @BashroomOri);
--
set @RentType = case
when @area <= 20 then
3 --
when @area <= 30
and @Room >= 2 then
3
else
2
end; --
--
set @area = case
when @area <> 0 then
@area
end;
--
set @priceunit = @price * 1.0 / isnull(@area, 1.0);
--
insert into #HousingCaseListAdj
values
(@case_id, @HouseholdsID_SRC, '-1', @ProjectID, @BuildingID, @RentType, @Room, @Hall, @Bashroom, @area
, @towards, @UpperFloorSum, null, @decora, @price, @priceunit, @listDate, @dueDate, @CaseName);
end;
fetch next from Record2Insert
into @case_id
, @HouseholdsID_SRC
, @CaseName
, @listDate
, @dueDate
, @price
, @area
, @UpperFloorSum
, @towards
, @roomtype
, @decora
, @ProjectID
, @BuildingID;
end;
close Record2Insert;
deallocate Record2Insert;
set nocount off;
drop table #tmp;
/*************案例标准化*************/
create table #HousingCaseListSTD
(
case_id varchar(32)
, HouseholdsID_SRC nvarchar(64)
, ProjectID_SRC nvarchar(64)
, ProjectID nvarchar(64)
, BuildingID nvarchar(64)
, AreaCoff decimal(7, 4)
, TowardsCoff decimal(7, 4)
, FloorCoff decimal(7, 4)
, DecorationRng int
, YearCoff decimal(7, 4)
, BuildingCoff decimal(7, 4)
, RoomTypeCoff decimal(7, 4)
, PriceUnit decimal(18, 2) not null
, PriceScatterRent decimal(18, 2) --
, PriceEntireRent decimal(18, 2) --
, PriceShareRent0 decimal(18, 2) --
, PriceShareRent decimal(18, 2) --
);
insert into #HousingCaseListSTD
select a.case_id
, A.HouseholdsID_SRC
, A.ProjectID_SRC
, A.ProjectID
, null
, D.CoefficientA * A.Area + D.CoefficientB as AreaCoff
, E.Coefficient as TowardsCoff
, F.Coefficient as FloorCoff
, G.Coefficient as DecorationRng
, null as YearCoff
, null BuildingCoff
, J.Coefficient as RoomTypeCoff
, A.PriceUnit
, (A.PriceUnit - isnull(G.Coefficient, 0)) * 1.0 / isnull(D.CoefficientA * A.Area + D.CoefficientB, 1)
/ isnull(E.Coefficient, 1) / isnull(F.Coefficient, 1) / isnull(J.Coefficient, 1) PriceScatterRent
, (A.PriceUnit - isnull(G.Coefficient, 0)) * 1.0 / isnull(D.CoefficientA * A.Area + D.CoefficientB, 1)
/ isnull(E.Coefficient, 1) / isnull(F.Coefficient, 1) / isnull(J.Coefficient, 1) + isnull(G.Coefficient, 0) PriceEntireRent
, A.PriceTotal * 1.0 / isnull(F.Coefficient, 1) / isnull(E.Coefficient, 1) as PriceShareRent0
, case
when A.Hall = 0 then
A.PriceTotal * A.Room * 1.0 / isnull(F.Coefficient, 1) / isnull(E.Coefficient, 1)
else
A.PriceTotal * (A.Room + A.Hall - 1) * 1.0 / isnull(F.Coefficient, 1) / isnull(E.Coefficient, 1)
end as PriceShareRent
from #HousingCaseListAdj A
left join
(select projectid,ProjectLevel from obpm_LianCheng_Data.dbo.V_RESIDENCE_COMMUNITY) C
on A.ProjectID = C.projectid
left join
(
select ProjectLevel
, UpperKey
, LowerKey
, CoefficientA
, CoefficientB
from DIM_PARAMETERS
where CoffType = '面积修正(租金)'
and ProjectType = '公寓'
) D --
on C.ProjectLevel = D.ProjectLevel
and
(
A.Area > D.LowerKey
and A.Area <= D.UpperKey
)
left join
(
select SingleKey
, Coefficient
from DIM_PARAMETERS
where CoffType = '朝向(租金)'
and ProjectType = '公寓'
) E --
on A.Towards = E.SingleKey
left join
(
select UpperKey
, LowerKey
, Elevator
, Coefficient
from DIM_PARAMETERS
where CoffType = '楼层(租金)'
and ProjectType = '公寓'
) F --
on F.Elevator is null
and A.UpperFloorSum = F.UpperKey
and A.UpperFloorNum = F.LowerKey
left join
(
select SingleKey
, Coefficient
from DIM_PARAMETERS
where CoffType = '室内装修(租金)'
and ProjectType = '公寓'
) G --
on A.Decoration = G.SingleKey
left join
(
select Coefficient
, UpperKey
, LowerKey
from DIM_PARAMETERS
where CoffType = '室加厅修正(租金)'
and ProjectType = '公寓'
) J --
on A.Room = J.UpperKey
and A.Hall = J.LowerKey;
/**新建成交案例表**/
-- 20200330表结构修改ODS_HOUSINGCASEDEAL_RENT_202003 新增字段BuildingID, UrlHouseholds, UrlProjects, CaseName
insert into ODS_HOUSINGCASEDEAL_RENT_#yearMonth#
select a.case_id
, A.HouseholdsID_SRC
, A.ProjectID_SRC
, A.ProjectID
, A.BuildingID
, A.RentType
, A.Room
, A.Hall
, A.Bashroom
, A.Area
, A.Towards
, A.UpperFloorSum
, A.UpperFloorNum
, null Elevator
, A.Decoration
, null as Year
, B.AreaCoff
, B.TowardsCoff
, B.FloorCoff
, B.DecorationRng
, B.YearCoff
, B.BuildingCoff
, B.RoomTypeCoff
, A.PriceTotal
, A.PriceUnit
, B.PriceScatterRent
, B.PriceEntireRent
, B.PriceShareRent0
, B.PriceShareRent
, null
, null
, null
, null
, 4 as Status
, null
, null
, null
, null
, null
, null
, null
, A.PriceTotal PriceTotalIn
, A.PriceTotal PriceTotalOut
, A.PriceDateIn
, A.PriceDateOut
, '链家'
, null
, null
, CaseName
from #HousingCaseListAdj A
left join #HousingCaseListSTD B
on A.HouseholdsID_SRC = B.HouseholdsID_SRC;
drop table #HousingCaseListAdj
, #HousingCaseListSTD;

View File

@ -0,0 +1,777 @@
truncate table DW_HOUSINGCASE_RENT_COMM_#yearMonth#;
truncate table DWA_PROJECTBASEPRICE_RENT_IMDT_#yearMonth#;
/******************************租金案例整合***********************************/
insert into dbo.DW_HOUSINGCASE_RENT_COMM_#yearMonth#
(
HouseholdsID_SRC
, ProjectID_SRC
, ProjectID
, BuildingID
, RentType
, Room
, Hall
, Bashroom
, Area
, Towards
, UpperFloorSum
, UpperFloorNum
, Elevator
, Decoration
, Year
, AreaCoff
, TowardsCoff
, FloorCoff
, DecorationRng
, YearCoff
, BuildingCoff
, RoomTypeCoff
, PriceTotal
, PriceUnit
, PriceScatterRent
, PriceEntireRent
, PriceShareRent0
, PriceShareRent
, Visited_Num
, First_Visit_Time
, Visited_Num_15
, Visited_Num_30
, Status
, AdjustedValue
, AdjustedPst
, AdjustedCumValue
, AdjustedCumPst
, AdjustedCumValueAbs
, AdjustedCumPstAbs
, AdjustedCumNum
, PriceTotalIn
, PriceTotalOut
, PriceDateIn
, PriceDateOut
, Origin
, UrlHouseholds
, UrlProjects
, CaseName
, CaseType
)
select HouseholdsID_SRC
, ProjectID_SRC
, ProjectID
, BuildingID
, RentType
, Room
, Hall
, Bashroom
, Area
, Towards
, UpperFloorSum
, UpperFloorNum
, Elevator
, Decoration
, Year
, AreaCoff
, TowardsCoff
, FloorCoff
, DecorationRng
, YearCoff
, BuildingCoff
, RoomTypeCoff
, PriceTotal
, PriceUnit
, PriceScatterRent
, PriceEntireRent
, PriceShareRent0
, PriceShareRent
, Visited_Num
, First_Visit_Time
, Visited_Num_15
, Visited_Num_30
, Status
, AdjustedValue
, AdjustedPst
, AdjustedCumValue
, AdjustedCumPst
, AdjustedCumValueAbs
, AdjustedCumPstAbs
, AdjustedCumNum
, PriceTotalIn
, PriceTotalOut
, PriceDateIn
, PriceDateOut
, Origin
, UrlHouseholds
, UrlProjects
, CaseName
, cast(1 as tinyint) as CaseType
from ODS_HOUSINGCASELISTED_RENT_#yearMonth#
where Status in ( 1, 2, 3, 4 );
insert into dbo.DW_HOUSINGCASE_RENT_COMM_#yearMonth#
(
HouseholdsID_SRC
, ProjectID_SRC
, ProjectID
, BuildingID
, RentType
, Room
, Hall
, Bashroom
, Area
, Towards
, UpperFloorSum
, UpperFloorNum
, Elevator
, Decoration
, Year
, AreaCoff
, TowardsCoff
, FloorCoff
, DecorationRng
, YearCoff
, BuildingCoff
, RoomTypeCoff
, PriceTotal
, PriceUnit
, PriceScatterRent
, PriceEntireRent
, PriceShareRent0
, PriceShareRent
, Visited_Num
, First_Visit_Time
, Visited_Num_15
, Visited_Num_30
, Status
, AdjustedValue
, AdjustedPst
, AdjustedCumValue
, AdjustedCumPst
, AdjustedCumValueAbs
, AdjustedCumPstAbs
, AdjustedCumNum
, PriceTotalIn
, PriceTotalOut
, PriceDateIn
, PriceDateOut
, Origin
, UrlHouseholds
, UrlProjects
, CaseName
, CaseType
)
select HouseholdsID_SRC
, ProjectID_SRC
, ProjectID
, BuildingID
, RentType
, Room
, Hall
, Bashroom
, Area
, Towards
, UpperFloorSum
, UpperFloorNum
, Elevator
, Decoration
, Year
, AreaCoff
, TowardsCoff
, FloorCoff
, DecorationRng
, YearCoff
, BuildingCoff
, RoomTypeCoff
, PriceTotal
, PriceUnit
, PriceScatterRent
, PriceEntireRent
, PriceShareRent0
, PriceShareRent
, Visited_Num
, First_Visit_Time
, Visited_Num_15
, Visited_Num_30
, Status
, AdjustedValue
, AdjustedPst
, AdjustedCumValue
, AdjustedCumPst
, AdjustedCumValueAbs
, AdjustedCumPstAbs
, AdjustedCumNum
, PriceTotalIn
, PriceTotalOut
, PriceDateIn
, PriceDateOut
, Origin
, UrlHouseholds
, UrlProjects
, CaseName
, cast(0 as tinyint) as CaseType
from ODS_HOUSINGCASEDEAL_RENT_#lastYearMonth#;
--
update a
set a.RentPrice_1 = b.RentPrice, a.Range = PriceScatterRent*1.0/b.RentPrice-1
from DW_HOUSINGCASE_RENT_COMM_#yearMonth# a
left join ODS_PROJECT_RENT_PRICE_INFO_#lastYearMonth# b
on a.ProjectID = b.ProjectID
where b.Status=1;
--1-2-3- RangeFlag依赖分组比49
update DW_HOUSINGCASE_RENT_COMM_#yearMonth#
set RangeFlag = case when RentType=2 and abs(Range)<=0.15 then 20
when RentType=2 and abs(Range)>0.6 then 27
when RentType=2 and abs(Range)>0.3 then 26
when RentType=2 and abs(Range)>0.15 then 23
when RentType=2 then 29
when RentType=1 and Range>=-0.3 and Range<=0.6 then 30
when RentType=1 and Range>=-0.6 and Range<-0.3 then 36
when RentType=1 and abs(Range)>0.6 then 37
when RentType=1 then 39
when RentType=3 then 49 end;
/******************************小区基价计算中间表***********************************/
-----20191205:BUG修复CaseType=0 and RangeFlag in (20,23) and Range<-0.1 then -0.1
----
create table #DWA_PROJECTBASEPRICE_IMDT_STEP_1
(
ProjectID nvarchar(32) primary key
, ProjectName nvarchar(1024)
, ProjectAddr nvarchar(1024)
, County nvarchar(512)
, Block nvarchar(512)
, Loop nvarchar(512)
, IsIndxGen tinyint
, IsPstCalc tinyint
, StatusRun tinyint
, RentPrice_1 decimal(18, 2)
, PriceScatterRent decimal(18, 2)
, PriceDealMean_1 decimal(18, 2)
, PriceDealMax_1 decimal(18, 2)
, SumDeal_1 int --2023
, PriceDeal_1_ToAI_Pst decimal(18, 6)
, PriceDealMean decimal(18, 2) --
, PriceDealMax decimal(18, 2)
, SumDeal int --
, PriceDeal_ToAI_Pst decimal(18, 6) --
, PriceDeal_ToLst_Pst decimal(18, 6) --
, PriceCaseOff decimal(18, 2)
, PriceCaseOff_ToLst_Pst decimal(18, 6) --
, PriceListedMin decimal(18, 2) --
, PriceLstMn_ToAI_Pst decimal(18, 6) --
, PriceCase1_ToAI_Pst decimal(18, 6) --
, PriceCase2_ToAI_Pst decimal(18, 6) --
, PriceCase1_ToLst_Pst decimal(18, 6) --
, PriceCase2_ToLst_Pst decimal(18, 6) --
, PriceCase1 decimal(18, 2) --
, PriceCase1AdjPst decimal(18, 6) --
, PriceCase1Adj_0 decimal(18, 6) --1
, SumCase1 int --
, PriceCase2 decimal(18, 2) --
, PriceCase2AdjPst decimal(18, 6) --
, PriceCase2Adj_0 decimal(18, 6) --链家2中调价幅度非零的个数
, SumCase2 int
);
with DW_HOUSINGCASE_RENT_COMM_M as (
SELECT ProjectID, PriceUnit, PriceScatterRent, Status, AdjustedValue,
CASE WHEN CaseType=1 and Status in (1,2) and RangeFlag in (20,23) and AdjustedPst>0.06 then 0.06
WHEN CaseType=1 and Status in (1,2) and RangeFlag in (20,23) and AdjustedPst<-0.06 then -0.06
ELSE AdjustedPst END AS AdjustedPst,
CaseType, RentPrice_1,
CASE WHEN CaseType=1 and Status<>4 and RangeFlag in (20,23) and Range>0.1 then 0.1 --±10%±10%
WHEN CaseType=1 and Status<>4 and RangeFlag in (20,23) and Range<-0.1 then -0.1
WHEN CaseType=0 and RangeFlag in (20,23) and Range>0.1 then 0.1
WHEN CaseType=0 and RangeFlag in (20,23) and Range<-0.1 then -0.1
ELSE Range END AS Range, RangeFlag
from DW_HOUSINGCASE_RENT_COMM_#yearMonth#
),
DW_HOUSINGCASE_RENT_COMM_M_1 as (
SELECT ProjectID, PriceUnit, PriceScatterRent, Status, AdjustedValue,
CASE WHEN CaseType=1 and Status in (1,2) and RangeFlag in (20,23) and AdjustedPst>0.06 then 0.06
WHEN CaseType=1 and Status in (1,2) and RangeFlag in (20,23) and AdjustedPst<-0.06 then -0.06
ELSE AdjustedPst END AS AdjustedPst,
CaseType, RentPrice_1,
CASE WHEN CaseType=1 and Status<>4 and RangeFlag in (20,23) and Range>0.1 then 0.1
WHEN CaseType=1 and Status<>4 and RangeFlag in (20,23) and Range<-0.1 then -0.1
WHEN CaseType=0 and RangeFlag in (20,23) and Range>0.1 then 0.1
WHEN CaseType=0 and RangeFlag in (20,23) and Range<-0.1 then -0.1
ELSE Range END AS Range, RangeFlag
from DW_HOUSINGCASE_RENT_COMM_#lastYearMonth#
)
insert into #DWA_PROJECTBASEPRICE_IMDT_STEP_1
select a.ProjectID, a.ProjectName, a.ProjectAddr, a.County, a.Block, a.Loop, a.IsIndxGen, a.IsPstCalc, a.StatusRun,
d.RentPrice as RentPrice_1, b.PriceScatterRent,
c.PriceDealMean_1, c.PriceDealMax_1, c.SumDeal_1, c.PriceDeal_1_ToAI_Pst,
b.PriceDealMean, b.PriceDealMax, b.SumDeal, b.PriceDeal_ToAI_Pst, (b.PriceDealMean - c.PriceDealMean_1)*1.0/c.PriceDealMean_1 as PriceDeal_ToLst_Pst,
b.PriceCaseOff, case when e.PriceCaseOff<>0 then b.PriceCaseOff*1.0/e.PriceCaseOff - 1 end as PriceCaseOff_ToLst_Pst,
b.PriceListedMin, b.PriceLstMn_ToAI_Pst, b.PriceCase1_ToAI_Pst, b.PriceCase2_ToAI_Pst,
(b.PriceCase1 - c.PriceCase1_1)*1.0/c.PriceCase1_1 as PriceCase1_ToLst_Pst,
(b.PriceCase2 - c.PriceCase2_1)*1.0/c.PriceCase2_1 as PriceCase2_ToLst_Pst,
b.PriceCase1, b.PriceCase1AdjPst, b.PriceCase1Adj_0, b.SumCase1, b.PriceCase2, b.PriceCase2AdjPst, b.PriceCase2Adj_0, b.SumCase2
from obpm_LianCheng_Data.dbo.V_RESIDENCE_COMMUNITY a
left join (
select ProjectID, avg(RentPrice_1) as RentPrice_1,
avg(case when ((CaseType=1 and Status<>4) or CaseType=0) and RangeFlag in (20,23) then PriceScatterRent end) as PriceScatterRent,
avg(case when CaseType=0 and RangeFlag in (20,23) then PriceScatterRent end) as PriceDealMean,
max(case when CaseType=0 and RangeFlag in (20,23) then PriceScatterRent end) as PriceDealMax,
count(case when CaseType=0 and RangeFlag in (20,23) then 1 end) as SumDeal,
avg(case when CaseType=0 and RangeFlag in (20,23) then Range end) as PriceDeal_ToAI_Pst,
avg(case when CaseType=1 and RangeFlag in (20,23) and Status=4 then PriceScatterRent end) as PriceCaseOff,
min(case when CaseType=1 and Status<>4 and RangeFlag in (20,23) then PriceScatterRent end) as PriceListedMin,
min(case when CaseType=1 and Status<>4 and RangeFlag in (20,23) then Range end) as PriceLstMn_ToAI_Pst,
avg(case when CaseType=1 and Status<>4 and RangeFlag in (20,23) then PriceScatterRent end) as PriceCase1,
count(case when CaseType=1 and Status<>4 and RangeFlag in (20,23) then 1 end) as SumCase1,
avg(case when CaseType=1 and Status<>4 and RangeFlag in (20,23) then Range end) as PriceCase1_ToAI_Pst,
avg(case when CaseType=1 and Status in (1,2) and RangeFlag in (20,23) then AdjustedPst end) as PriceCase1AdjPst,
count(case when CaseType=1 and Status in (1,2) and RangeFlag in (20,23) and AdjustedPst<>0 then 1 end) as PriceCase1Adj_0,
avg(case when CaseType=1 and Status<>4 and RangeFlag in (20) then PriceScatterRent end) as PriceCase2,
count(case when CaseType=1 and Status<>4 and RangeFlag in (20) then 1 end) as SumCase2,
avg(case when CaseType=1 and Status<>4 and RangeFlag in (20) then Range end) as PriceCase2_ToAI_Pst,
avg(case when CaseType=1 and Status in (1,2) and RangeFlag in (20) then AdjustedPst end) as PriceCase2AdjPst ,
count(case when CaseType=1 and Status in (1,2) and RangeFlag in (20) and AdjustedPst<>0 then 1 end) as PriceCase2Adj_0
from DW_HOUSINGCASE_RENT_COMM_M group by ProjectID
) b on a.ProjectID = b.ProjectID
left join (
select ProjectID,
avg(case when CaseType=0 and RangeFlag in (20,23) then PriceScatterRent end) as PriceDealMean_1,
max(case when CaseType=0 and RangeFlag in (20,23) then PriceScatterRent end) as PriceDealMax_1,
count(case when CaseType=0 and RangeFlag in (20,23) then 1 end) as SumDeal_1,
avg(case when CaseType=0 and RangeFlag in (20,23) then Range end) as PriceDeal_1_ToAI_Pst,
avg(case when CaseType=1 and Status<>4 and RangeFlag in (20,23) then PriceScatterRent end) as PriceCase1_1,
avg(case when CaseType=1 and Status<>4 and RangeFlag in (20) then PriceScatterRent end) as PriceCase2_1
from DW_HOUSINGCASE_RENT_COMM_M_1 group by ProjectID
) c on a.ProjectID = c.ProjectID
left join ODS_PROJECT_RENT_PRICE_INFO_#lastYearMonth# d
on a.ProjectID = d.ProjectID and d.Status=1
left join DWA_PROJECTBASEPRICE_RENT_IMDT_#lastYearMonth# e
on a.ProjectID = e.ProjectID;
----
create table #DWA_PROJECTBASEPRICE_IMDT_STEP_2
(
ProjectID nvarchar(32) primary key
, VOPPBT nvarchar(16) ---
, VOPPB decimal(18, 6) ---
);
-----8111
WITH DataUnPivot AS(
select projectid, tp, CAST(vl AS DECIMAL(18,6)) vl
from (
select projectid, PriceCase1_ToAI_Pst, PriceCase1_ToLst_Pst, PriceCase1AdjPst
from #DWA_PROJECTBASEPRICE_IMDT_STEP_1 where PriceScatterRent is not null
)t unpivot (vl for tp in (PriceCase1_ToAI_Pst, PriceCase1_ToLst_Pst, PriceCase1AdjPst)) up
)
SELECT A.ProjectID,
CASE WHEN (PriceCase1_ToAI_Pst>0 AND PriceCase1_ToLst_Pst>0 AND PriceCase1AdjPst>0) THEN MIN_LISTED
WHEN (PriceCase1_ToAI_Pst>0 AND PriceCase1_ToLst_Pst>0 AND PriceCase1AdjPst=0) THEN MDN_LISTED*1.0/4
WHEN (PriceCase1_ToAI_Pst>0 AND PriceCase1_ToLst_Pst>0 AND PriceCase1AdjPst<0) THEN MDN_LISTED*1.0/4
WHEN (PriceCase1_ToAI_Pst>0 AND PriceCase1_ToLst_Pst=0 AND PriceCase1AdjPst>0) THEN MDN_LISTED*1.0/4
WHEN (PriceCase1_ToAI_Pst>0 AND PriceCase1_ToLst_Pst=0 AND PriceCase1AdjPst=0) THEN NULL
WHEN (PriceCase1_ToAI_Pst>0 AND PriceCase1_ToLst_Pst=0 AND PriceCase1AdjPst<0) THEN NULL
WHEN (PriceCase1_ToAI_Pst>0 AND PriceCase1_ToLst_Pst<0 AND PriceCase1AdjPst>0) THEN MDN_LISTED*1.0/4
WHEN (PriceCase1_ToAI_Pst>0 AND PriceCase1_ToLst_Pst<0 AND PriceCase1AdjPst=0) THEN NULL
WHEN (PriceCase1_ToAI_Pst>0 AND PriceCase1_ToLst_Pst<0 AND PriceCase1AdjPst<0) THEN MDN_LISTED
WHEN (PriceCase1_ToAI_Pst=0 AND PriceCase1_ToLst_Pst>0 AND PriceCase1AdjPst>0) THEN MDN_LISTED*1.0/4
WHEN (PriceCase1_ToAI_Pst=0 AND PriceCase1_ToLst_Pst>0 AND PriceCase1AdjPst=0) THEN MDN_LISTED*1.0/4
WHEN (PriceCase1_ToAI_Pst=0 AND PriceCase1_ToLst_Pst>0 AND PriceCase1AdjPst<0) THEN NULL
WHEN (PriceCase1_ToAI_Pst=0 AND PriceCase1_ToLst_Pst=0 AND PriceCase1AdjPst>0) THEN NULL
WHEN (PriceCase1_ToAI_Pst=0 AND PriceCase1_ToLst_Pst=0 AND PriceCase1AdjPst=0) THEN NULL
WHEN (PriceCase1_ToAI_Pst=0 AND PriceCase1_ToLst_Pst=0 AND PriceCase1AdjPst<0) THEN MIN_LISTED*1.0/3
WHEN (PriceCase1_ToAI_Pst=0 AND PriceCase1_ToLst_Pst<0 AND PriceCase1AdjPst>0) THEN NULL
WHEN (PriceCase1_ToAI_Pst=0 AND PriceCase1_ToLst_Pst<0 AND PriceCase1AdjPst=0) THEN NULL
WHEN (PriceCase1_ToAI_Pst=0 AND PriceCase1_ToLst_Pst<0 AND PriceCase1AdjPst<0) THEN MDN_LISTED
WHEN (PriceCase1_ToAI_Pst<0 AND PriceCase1_ToLst_Pst>0 AND PriceCase1AdjPst>0) THEN NULL
WHEN (PriceCase1_ToAI_Pst<0 AND PriceCase1_ToLst_Pst>0 AND PriceCase1AdjPst=0) THEN NULL
WHEN (PriceCase1_ToAI_Pst<0 AND PriceCase1_ToLst_Pst>0 AND PriceCase1AdjPst<0) THEN MDN_LISTED
WHEN (PriceCase1_ToAI_Pst<0 AND PriceCase1_ToLst_Pst=0 AND PriceCase1AdjPst>0) THEN NULL
WHEN (PriceCase1_ToAI_Pst<0 AND PriceCase1_ToLst_Pst=0 AND PriceCase1AdjPst=0) THEN NULL
WHEN (PriceCase1_ToAI_Pst<0 AND PriceCase1_ToLst_Pst=0 AND PriceCase1AdjPst<0) THEN MDN_LISTED
WHEN (PriceCase1_ToAI_Pst<0 AND PriceCase1_ToLst_Pst<0 AND PriceCase1AdjPst>0) THEN MDN_LISTED
WHEN (PriceCase1_ToAI_Pst<0 AND PriceCase1_ToLst_Pst<0 AND PriceCase1AdjPst=0) THEN MDN_LISTED
WHEN (PriceCase1_ToAI_Pst<0 AND PriceCase1_ToLst_Pst<0 AND PriceCase1AdjPst<0) THEN MDN_LISTED
END AS VOPP_8
INTO #Price_VOPP_8
FROM #DWA_PROJECTBASEPRICE_IMDT_STEP_1 A
LEFT JOIN (
select projectid, min(vl) as MIN_LISTED, avg(MDN) as MDN_LISTED
from (
select a.*, PERCENTILE_CONT(0.5) within group(order by vl)over(partition by projectid) as MDN --
from DataUnPivot a
)t
group by projectid
)B ON A.ProjectID = B.ProjectID;
----
WITH DWA_PROJECTBASEPRICE_IMDT_STEP_1_T AS(
select a.*, cast(PriceDealMean_1*1.0/RentPrice_1-1 as decimal(18,6)) as PriceDeal_1_ToAI_0_Pst,
cast(case when PriceDeal_ToLst_Pst>=0.06 then 0.06
when PriceDeal_ToLst_Pst<=-0.06 then -0.06
else PriceDeal_ToLst_Pst end as decimal(18,6)) as PriceDeal_ToLst_Pst_
from #DWA_PROJECTBASEPRICE_IMDT_STEP_1 a
),
DataUnPivot(projectid, tp, vl) AS(
select projectid, tp, CAST(vl AS DECIMAL(18,6)) vl
from (
select projectid, PriceCase1AdjPst, PriceCase2AdjPst, PriceCase1_ToAI_Pst, PriceCase2_ToAI_Pst, PriceLstMn_ToAI_Pst, PriceCaseOff_ToLst_Pst,
PriceDeal_ToAI_Pst, PriceCase1_ToLst_Pst, PriceCase2_ToLst_Pst, PriceDeal_ToLst_Pst_, PriceDeal_1_ToAI_0_Pst, PriceCase1Adj_0, PriceCase2Adj_0
from DWA_PROJECTBASEPRICE_IMDT_STEP_1_T
)t unpivot (vl for tp in (PriceCase1AdjPst, PriceCase2AdjPst, PriceCase1_ToAI_Pst, PriceCase2_ToAI_Pst, PriceLstMn_ToAI_Pst, PriceCaseOff_ToLst_Pst,
PriceDeal_ToAI_Pst, PriceCase1_ToLst_Pst, PriceCase2_ToLst_Pst, PriceDeal_ToLst_Pst_, PriceDeal_1_ToAI_0_Pst, PriceCase1Adj_0, PriceCase2Adj_0))up
)
INSERT INTO #DWA_PROJECTBASEPRICE_IMDT_STEP_2
SELECT A.ProjectID,
CASE WHEN B.VOPP_1 IS NOT NULL AND (B.Adj1<>0 OR B.Adj2 <> 0) THEN '1'
WHEN D.VOPP_3 IS NOT NULL THEN '3'
WHEN D.VOPP_4 IS NOT NULL THEN '4'
WHEN B.VOPP_2 IS NOT NULL THEN '2'
WHEN B.VOPP_5 IS NOT NULL THEN '5'
WHEN B.VOPP_6 IS NOT NULL THEN '6'
WHEN C.VOPP_8 IS NOT NULL THEN '8'
WHEN ABS(PriceDeal_ToLst_Pst)<=0.06 THEN '9'
ELSE NULL END AS VOPPBT,
CASE WHEN B.VOPP_1 IS NOT NULL AND (B.Adj1<>0 OR B.Adj2 <> 0) THEN B.VOPP_1
WHEN D.VOPP_3 IS NOT NULL THEN D.VOPP_3
WHEN D.VOPP_4 IS NOT NULL THEN D.VOPP_4
WHEN B.VOPP_2 IS NOT NULL THEN B.VOPP_2
WHEN B.VOPP_5 IS NOT NULL THEN B.VOPP_5
WHEN B.VOPP_6 >=0.06 THEN 0.06
WHEN B.VOPP_6 IS NOT NULL THEN B.VOPP_6
WHEN C.VOPP_8 IS NOT NULL THEN C.VOPP_8
WHEN ABS(PriceDeal_ToLst_Pst)<=0.06 THEN E.MDN_DUAL
ELSE NULL END AS VOPPB
FROM #DWA_PROJECTBASEPRICE_IMDT_STEP_1 A
LEFT JOIN (
select projectid,
avg(case when tp in ('PriceCase1AdjPst', 'PriceCase2AdjPst') then vl end) as VOPP_1,
avg(case when tp in ('PriceCase1_ToLst_Pst', 'PriceCase2_ToLst_Pst') and abs(vl)<=0.06 then vl end) as VOPP_2,
avg(case when tp in ('PriceLstMn_ToAI_Pst', 'PriceDeal_ToAI_Pst') then vl end) as VOPP_5,
avg(case when tp in ('PriceCaseOff_ToLst_Pst', 'PriceLstMn_ToAI_Pst') and vl>0 then vl end) as VOPP_6,
sum(case when tp in ('PriceCase1Adj_0') then vl end) as Adj1, --0000
sum(case when tp in ('PriceCase2Adj_0') then vl end) as Adj2
from DataUnPivot group by projectid
) B
ON A.ProjectID = B.ProjectID
LEFT JOIN #Price_VOPP_8 C
ON A.ProjectID = C.ProjectID
LEFT JOIN (
select ProjectID,
case when abs(PriceCase2_ToLst_Pst)<=0.06 and PriceCase1_ToLst_Pst>0.06 then (0.06+PriceCase2_ToLst_Pst)*1.0/2
when abs(PriceCase2_ToLst_Pst)<=0.06 and PriceCase1_ToLst_Pst<-0.06 then (-0.06+PriceCase2_ToLst_Pst)*1.0/2 end as VOPP_3,
case when abs(PriceCase1_ToLst_Pst)<=0.06 and PriceCase2_ToLst_Pst>0.06 then (0.06+PriceCase1_ToLst_Pst)*1.0/2
when abs(PriceCase1_ToLst_Pst)<=0.06 and PriceCase2_ToLst_Pst<-0.06 then (-0.06+PriceCase1_ToLst_Pst)*1.0/2 end as VOPP_4
from #DWA_PROJECTBASEPRICE_IMDT_STEP_1
)D ON A.ProjectID = D.ProjectID
LEFT JOIN (
select projectid, min(vl) as MIN_DUAL, avg(MDN) as MDN_DUAL
from (
select a.*, PERCENTILE_CONT(0.5) within group(order by vl)over(partition by projectid) as MDN --
from DataUnPivot a where TP IN ('PriceDeal_ToLst_Pst_', 'PriceDeal_ToAI_Pst', 'PriceDeal_1_ToAI_0_Pst')
)t
group by projectid
)E ON A.ProjectID = E.ProjectID;
----
DELETE FROM #DWA_PROJECTBASEPRICE_IMDT_STEP_2
WHERE VOPPBT IS NULL;
----0.06±0.06
UPDATE #DWA_PROJECTBASEPRICE_IMDT_STEP_2
SET VOPPB=0.06 WHERE VOPPB>0.06;
UPDATE #DWA_PROJECTBASEPRICE_IMDT_STEP_2
SET VOPPB=-0.06 WHERE VOPPB<-0.06;
DROP TABLE #Price_VOPP_8
----
create table #DWA_PROJECTBASEPRICE_IMDT_STEP_3
(
ProjectID nvarchar(32) primary key
, BindProjID int
, Bind_Proj_Pst decimal(18, 6)
, Bind_Block_Class nvarchar(128)
, Bind_Block_Class_Pst decimal(18, 6)
, Bind_Block_Plevel nvarchar(128)
, Bind_Block_Plevel_Pst decimal(18, 6)
, Bind_Block_PType nvarchar(128)
, Bind_Block_PType_Pst decimal(18, 6)
, Bind_County_PType nvarchar(128)
, Bind_County_PType_Pst decimal(18, 6)
, Bind_MixProject_PType nvarchar(128)
, Bind_MixProject_Pst decimal(18, 6)
, VOPPAT int
, VOPPA decimal(18, 6)
);
SELECT A.ProjectID, A.Block, A.County, A.ProjectLevel, A.ProjectTypeDtl, A.MixProjMainID, A.BindClassID, A.BindProjID, B.VOPPB AS Bind_Proj_Pst,
CASE WHEN C.ProjectID IS NOT NULL THEN C.VOPPBT
WHEN B.ProjectID IS NOT NULL THEN 8505 END AS VOPPAT,
CASE WHEN C.ProjectID IS NOT NULL THEN C.VOPPB
WHEN B.ProjectID IS NOT NULL THEN B.VOPPB END AS VOPPA
INTO #TempBindProjID
FROM obpm_LianCheng_Data.dbo.V_RESIDENCE_COMMUNITY A
LEFT JOIN #DWA_PROJECTBASEPRICE_IMDT_STEP_2 B
ON A.BindProjID = B.ProjectID
LEFT JOIN #DWA_PROJECTBASEPRICE_IMDT_STEP_2 C
ON A.ProjectID = C.ProjectID;
-- 2.板块+绑定
SELECT A.ProjectID, A.Block, A.County, A.ProjectLevel, A.ProjectTypeDtl, A.MixProjMainID, A.BindClassID, A.BindProjID, A.Bind_Proj_Pst,
A.Block +A.BindClassID as Bind_Block_Class, B.Bind_Block_Class_Pst,
CASE WHEN A.VOPPAT IS NOT NULL THEN A.VOPPAT
WHEN B.Bind_Block_Class IS NOT NULL THEN 8501 END AS VOPPAT,
CASE WHEN A.VOPPA IS NOT NULL THEN A.VOPPA
WHEN B.Bind_Block_Class IS NOT NULL THEN B.Bind_Block_Class_Pst END AS VOPPA
INTO #Temp_Bind_Block_Class
FROM #TempBindProjID A
LEFT JOIN (
SELECT Block+BindClassID AS Bind_Block_Class, AVG(VOPPA) AS Bind_Block_Class_Pst
FROM #TempBindProjID GROUP BY Block+BindClassID
) B
ON A.Block +A.BindClassID = B.Bind_Block_Class AND B.Bind_Block_Class_Pst IS NOT null;
-- 3.板块+物业档次
SELECT A.ProjectID, A.Block, A.County, A.ProjectLevel, A.ProjectTypeDtl, A.MixProjMainID, A.BindClassID, A.BindProjID, A.Bind_Proj_Pst,
A.Bind_Block_Class, A.Bind_Block_Class_Pst, A.Block +A.ProjectLevel as Bind_Block_Plevel, B.Bind_Block_Plevel_Pst,
CASE WHEN A.VOPPAT IS NOT NULL THEN A.VOPPAT
WHEN B.Bind_Block_Plevel IS NOT NULL THEN 8502 END AS VOPPAT,
CASE WHEN A.VOPPA IS NOT NULL THEN A.VOPPA
WHEN B.Bind_Block_Plevel IS NOT NULL THEN B.Bind_Block_Plevel_Pst END AS VOPPA
INTO #Temp_Bind_Block_Plevel
FROM #Temp_Bind_Block_Class A
LEFT JOIN (
SELECT Block+ProjectLevel AS Bind_Block_Plevel, AVG(VOPPA) AS Bind_Block_Plevel_Pst
FROM #Temp_Bind_Block_Class GROUP BY Block+ProjectLevel
) B
ON A.Block +A.ProjectLevel = B.Bind_Block_Plevel AND B.Bind_Block_Plevel_Pst IS NOT NULL
-- 4.板块+物业类型
SELECT A.ProjectID, A.Block, A.County, A.ProjectLevel, A.ProjectTypeDtl, A.MixProjMainID, A.BindClassID, A.BindProjID, A.Bind_Proj_Pst,
A.Bind_Block_Class, A.Bind_Block_Class_Pst, A.Bind_Block_Plevel, A.Bind_Block_Plevel_Pst,
A.Block+A.ProjectTypeDtl as Bind_Block_PType, B.Bind_Block_PType_Pst,
CASE WHEN A.VOPPAT IS NOT NULL THEN A.VOPPAT
WHEN B.Bind_Block_PType IS NOT NULL THEN 8503 END AS VOPPAT,
CASE WHEN A.VOPPA IS NOT NULL THEN A.VOPPA
WHEN B.Bind_Block_PType IS NOT NULL THEN B.Bind_Block_PType_Pst END AS VOPPA
INTO #Temp_Bind_Block_PType
FROM #Temp_Bind_Block_Plevel A
LEFT JOIN (
SELECT Block+ProjectTypeDtl AS Bind_Block_PType, AVG(VOPPA) AS Bind_Block_PType_Pst
FROM #Temp_Bind_Block_Plevel GROUP BY Block+ProjectTypeDtl
) B
ON A.Block+A.ProjectTypeDtl = B.Bind_Block_PType AND B.Bind_Block_PType_Pst IS NOT NULL
-- 5.区域+物业类型
SELECT A.ProjectID, A.Block, A.County, A.ProjectLevel, A.ProjectTypeDtl, A.MixProjMainID, A.BindClassID, A.BindProjID, A.Bind_Proj_Pst,
A.Bind_Block_Class, A.Bind_Block_Class_Pst, A.Bind_Block_Plevel, A.Bind_Block_Plevel_Pst,
A.Bind_Block_PType, A.Bind_Block_PType_Pst, A.County +A.ProjectTypeDtl as Bind_County_PType, B.Bind_County_PType_Pst,
CASE WHEN A.VOPPAT IS NOT NULL THEN A.VOPPAT
WHEN B.Bind_County_PType IS NOT NULL THEN 8504 END AS VOPPAT,
CASE WHEN A.VOPPA IS NOT NULL THEN A.VOPPA
WHEN B.Bind_County_PType IS NOT NULL THEN B.Bind_County_PType_Pst END AS VOPPA
INTO #Temp_Bind_County_PType
FROM #Temp_Bind_Block_PType A
LEFT JOIN (
SELECT County+ProjectTypeDtl AS Bind_County_PType, AVG(VOPPA) AS Bind_County_PType_Pst
FROM #Temp_Bind_Block_PType GROUP BY County+ProjectTypeDtl
) B
ON A.County +A.ProjectTypeDtl = B.Bind_County_PType AND B.Bind_County_PType_Pst IS NOT null;
-- 6.混合小区处理
SELECT A.ProjectID, A.Block, A.County, A.ProjectLevel, A.ProjectTypeDtl, A.MixProjMainID, A.BindClassID, A.BindProjID, A.Bind_Proj_Pst,
A.Bind_Block_Class, A.Bind_Block_Class_Pst, A.Bind_Block_Plevel, A.Bind_Block_Plevel_Pst,
A.Bind_Block_PType, A.Bind_Block_PType_Pst, A.Bind_County_PType, A.Bind_County_PType_Pst,
CASE WHEN A.MixProjMainID IS NOT NULL AND ISNULL(A.VOPPA,0) <> ISNULL(B.VOPPA,0) THEN B.ProjectID END AS Bind_MixProject_PType,
CASE WHEN A.MixProjMainID IS NOT NULL AND ISNULL(A.VOPPA,0) <> ISNULL(B.VOPPA,0) THEN B.VOPPA END AS Bind_MixProject_Pst,
CASE WHEN A.MixProjMainID IS NOT NULL AND ISNULL(A.VOPPA,0) <> ISNULL(B.VOPPA,0) THEN 8505 ELSE A.VOPPAT END AS VOPPAT,
CASE WHEN A.MixProjMainID IS NOT NULL AND ISNULL(A.VOPPA,0) <> ISNULL(B.VOPPA,0) THEN B.VOPPA ELSE A.VOPPA END AS VOPPA
INTO #Temp_Bind_MixProject
FROM #Temp_Bind_County_PType A
LEFT JOIN #Temp_Bind_County_PType B
ON A.MixProjMainID = B.ProjectID;
-- (11-39 ; 8505 ID平均值; 8506ID; 8501+; 8502+; 8503+; 8504+; 8505)
INSERT INTO #DWA_PROJECTBASEPRICE_IMDT_STEP_3
SELECT ProjectID, BindProjID, Bind_Proj_Pst,
Bind_Block_Class, Bind_Block_Class_Pst, Bind_Block_Plevel, Bind_Block_Plevel_Pst,
Bind_Block_PType, Bind_Block_PType_Pst, Bind_County_PType, Bind_County_PType_Pst, Bind_MixProject_PType, Bind_MixProject_Pst, VOPPAT, VOPPA
FROM #Temp_Bind_MixProject
DROP TABLE #TempBindProjID
DROP TABLE #Temp_Bind_Block_Class
DROP TABLE #Temp_Bind_Block_Plevel
DROP TABLE #Temp_Bind_Block_PType
DROP TABLE #Temp_Bind_County_PType
DROP TABLE #Temp_Bind_MixProject
----
insert into dbo.DWA_PROJECTBASEPRICE_RENT_IMDT_#yearMonth#
(ProjectID
,ProjectName
,ProjectAddr
,County
,Block
,Loop
,IsIndxGen
,IsPstCalc
,StatusRun
,PropertyType
,ProjectType
,ProjectTypeDtl
,ProjectLevel
,PropertyDevPeriod
,BindClassID
,MainCoff_Rent
,RentPriceDft
,MainRentPriceDft
,RentPrice_1
,PriceDealMean_1
,PriceDealMax_1
,SumDeal_1
,PriceDeal_1_ToAI_Pst
,PriceDealMean
,PriceDealMax
,SumDeal
,PriceDeal_ToAI_Pst
,PriceDeal_ToLst_Pst
,PriceCaseOff
,PriceCaseOff_ToLst_Pst
,PriceListedMin
,PriceLstMn_ToAI_Pst
,PriceCase1_ToAI_Pst
,PriceCase2_ToAI_Pst
,PriceCase1_ToLst_Pst
,PriceCase2_ToLst_Pst
,PriceCase1
,PriceCase1AdjPst
,SumCase1
,PriceCase2
,PriceCase2AdjPst
,SumCase2
,VOPPBT
,VOPPB
,BindProjID
,Bind_Proj_Pst
,Bind_Block_Class
,Bind_Block_Class_Pst
,Bind_Block_Plevel
,Bind_Block_Plevel_Pst
,Bind_Block_PType
,Bind_Block_Ptype_Pst
,Bind_County_PType
,Bind_County_Ptype_Pst
,Bind_MixProject_PType
,Bind_MixProject_Pst
,VOPPAT
,VOPPA
)
select A.ProjectID
, A.ProjectName
, A.ProjectAddr
, A.County
, A.Block
, A.Loop
, A.IsIndxGen
, A.IsPstCalc
, A.StatusRun
, D.propertyType
, D.ProjectType
, D.ProjectTypeDtl
, D.ProjectLevel
, D.PropertyDevPeriod
, D.BindClassID
, isnull(D.MainCoff_Rent, 1)
, A.RentPrice_1 * (1 + isnull(C.VOPPA, 0)) as RentPriceDft
, A.RentPrice_1 * (1 + isnull(C.VOPPA, 0)) * isnull(D.MainCoff_Rent, 1) as MainRentPriceDft
, A.RentPrice_1
, A.PriceDealMean_1
, A.PriceDealMax_1
, A.SumDeal_1
, A.PriceDeal_1_ToAI_Pst
, A.PriceDealMean
, A.PriceDealMax
, A.SumDeal
, A.PriceDeal_ToAI_Pst
, A.PriceDeal_ToLst_Pst
, A.PriceCaseOff
, A.PriceCaseOff_ToLst_Pst
, A.PriceListedMin
, A.PriceLstMn_ToAI_Pst
, A.PriceCase1_ToAI_Pst
, A.PriceCase2_ToAI_Pst
, A.PriceCase1_ToLst_Pst
, A.PriceCase2_ToLst_Pst
, A.PriceCase1
, A.PriceCase1AdjPst
, A.SumCase1
, A.PriceCase2
, A.PriceCase2AdjPst
, A.SumCase2
, B.VOPPBT
, B.VOPPB
, C.BindProjID
, C.Bind_Proj_Pst
, C.Bind_Block_Class
, C.Bind_Block_Class_Pst
, C.Bind_Block_Plevel
, C.Bind_Block_Plevel_Pst
, C.Bind_Block_PType
, C.Bind_Block_PType_Pst
, C.Bind_County_PType
, C.Bind_County_PType_Pst
, C.Bind_MixProject_PType
, C.Bind_MixProject_Pst
, case
when C.VOPPAT is null
and A.RentPrice_1 is not null then
9999
else
C.VOPPAT
end as VOPPAT
, case
when C.VOPPA is null
and A.RentPrice_1 is not null then
0
else
C.VOPPA
end as VOPPA
from #DWA_PROJECTBASEPRICE_IMDT_STEP_1 A
left join #DWA_PROJECTBASEPRICE_IMDT_STEP_2 B
on A.ProjectID = B.ProjectID
left join #DWA_PROJECTBASEPRICE_IMDT_STEP_3 C
on A.ProjectID = C.ProjectID
left join obpm_LianCheng_Data.dbo.V_RESIDENCE_COMMUNITY D
on A.ProjectID = D.projectid;
---
--
UPDATE A
SET A.RentPrice = B.RentPriceDft, A.EntireRentRatio = A.PriceEntireRent*1.0/B.RentPriceDft,
A.ShareRentRatio = A.PriceShareRent*1.0/B.RentPriceDft/90
FROM DW_HOUSINGCASE_RENT_COMM_#yearMonth# A
LEFT JOIN DWA_PROJECTBASEPRICE_RENT_IMDT_#yearMonth# B
ON A.ProjectID = B.ProjectID;
UPDATE DW_HOUSINGCASE_RENT_COMM_#yearMonth#
SET RangeFlag = CASE WHEN ShareRentRatio>=0.8 AND ShareRentRatio<=1.7 THEN 40
WHEN ShareRentRatio<0.8 THEN 46
WHEN ShareRentRatio>1.7 THEN 47
ELSE 49 END
WHERE RentType=3;
DROP TABLE #DWA_PROJECTBASEPRICE_IMDT_STEP_1
DROP TABLE #DWA_PROJECTBASEPRICE_IMDT_STEP_2
DROP TABLE #DWA_PROJECTBASEPRICE_IMDT_STEP_3

View File

@ -1,17 +1,17 @@
/***********************小区租金价格计算************************/
WITH STP AS(
SELECT A.ProjectID, 2 AS PriceType, B.BasePrice AS BasePrice_1, A.RentPriceDft as RentPrice, A.MainRentPriceDft as MainRentPrice,
A.SumCase1, A.VOPPAT, A.VOPPA,
A.SumCase1, A.VOPPAT, A.VOPPA,
CASE WHEN C.ProjectLevel = '工房1' THEN A.RentPriceDft*(1+24*0.012)*1.0/(1.0*(1+0.011*1.8))
WHEN C.ProjectLevel = '工房2' THEN A.RentPriceDft*(1+26*0.012)*1.0/(1.0*(1+0.011*1.8))
END AS GF_1Room,
CASE WHEN C.ProjectLevel = '工房1' THEN A.RentPriceDft*(1+16*0.012)*1.0/(1.0*(1+0.011*1.8))
WHEN C.ProjectLevel = '工房2' THEN A.RentPriceDft*(1+16*0.012)*1.0/(1.0*(1+0.011*1.8))
END AS GF_2Room,
END AS GF_2Room,
CASE WHEN C.ProjectLevel = '低端公寓1' THEN A.RentPriceDft*1.0*(1+0.011*3.3)/(1.0*(1+0.011*1.8))
WHEN C.ProjectLevel IN ('中端公寓','低端公寓2') THEN A.RentPriceDft*1.0*(1+0.011*3.3)/(1.0*(1+0.011*1.8))
WHEN C.ProjectLevel IN ('高端公寓','超高端公寓') THEN A.RentPriceDft*(1+5*0.012)*(1+0.011*3.3)/((1.0+0.011*1.8))
END AS GY_2Room,
END AS GY_2Room,
CASE WHEN C.ProjectLevel = '低端公寓1' THEN A.RentPriceDft*(1-3*0.012)*(1+0.011*4.25)/(1*(1+0.011*1.8))
WHEN C.ProjectLevel = '低端公寓2' THEN A.RentPriceDft*(1-4*0.012)*(1+0.011*4.25)/(1*(1+0.011*1.8))
WHEN C.ProjectLevel = '中端公寓' THEN A.RentPriceDft*(1-3*0.012)*(1+0.011*4.25)/(1*(1+0.011*1.8))
@ -20,19 +20,19 @@ WITH STP AS(
FROM DWA_PROJECTBASEPRICE_RENT_IMDT_#yearMonth# A
LEFT JOIN ODS_PROJECT_PRICE_INFO_#lastYearMonth# B
ON A.ProjectID = B.ProjectID AND B.STATUS = 1
LEFT JOIN ResidenceCommunity C
ON A.ProjectID = C.CommunityId;
LEFT JOIN obpm_LianCheng_Data.dbo.ResidenceCommunity C
ON A.ProjectID = C.CommunityId
)
INSERT INTO ODS_PROJECT_RENT_PRICE_INFO_#yearMonth#
SELECT A.ProjectID, A.PriceType, A.BasePrice_1, A.RentPrice, A.SumCase1, A.VOPPAT, A.VOPPA, A.GF_1Room, A.GF_2Room, A.GY_2Room, A.GY_3Room,
A.GF_1Room*35 AS One_Room,
CASE WHEN A.GF_2Room IS NOT NULL THEN A.GF_2Room*50 ELSE GY_2Room*90 END AS Two_Room,
A.GF_1Room*35 AS One_Room,
CASE WHEN A.GF_2Room IS NOT NULL THEN A.GF_2Room*50 ELSE GY_2Room*90 END AS Two_Room,
A.GY_3Room*105 AS Three_Three_Room, B.EntireRentRatio, B.EntireRentNum,
B.ShareRentRatio, B.ShareRentNum, A.RentPrice*12/A.BasePrice_1 AS SaleRentRatio, CONVERT(DATE,NULL) AS ModifyDate,
1 AS Status, NULL AdjEvd
FROM STP A
LEFT JOIN (
SELECT ProjectID,
SELECT ProjectID,
AVG(CASE WHEN RangeFlag = 30 THEN EntireRentRatio END) AS EntireRentRatio,
SUM(CASE WHEN RangeFlag = 30 THEN 1 END) AS EntireRentNum,
AVG(CASE WHEN RangeFlag = 40 THEN ShareRentRatio END) AS ShareRentRatio,
@ -41,11 +41,9 @@ LEFT JOIN (
GROUP BY ProjectID
) B ON A.ProjectID = B.ProjectID;
drop table #InfoChg;
drop table #InfoChgCurr;
---
/*******************租金价格修改数据***********************/
--
---
select a.ProjectID, a.RentPrice, a.RentPrice_1, a.VOPPAT, a.VOPPA, GETDATE() AS ModifyDate,
case when b.ProjectID is not null and isnull(a.RentPrice,0) <> isnull(b.RentPrice,0) then 1 else 0 end as RentPriceChg,
case when b.ProjectID is not null and isnull(a.VOPPAT,'') <> isnull(b.VOPPAT,'') then 1 else 0 end as VOPPATChg, -- 指当期价格涨跌幅类型字段变化
@ -57,15 +55,13 @@ left join ODS_PROJECT_RENT_PRICE_INFO_#yearMonth# b
on a.ProjectID = b.ProjectID and b.status=1 and (
isnull(a.RentPrice,0) <> isnull(b.RentPrice,0) or
isnull(a.VOPPAT,'') <> isnull(b.VOPPAT,'') or
isnull(a.VOPPA,0) <> isnull(b.VOPPA,0))
isnull(a.VOPPA,0) <> isnull(b.VOPPA,0))
left join ODS_PROJECT_RENT_PRICE_INFO_#lastYearMonth# c
on a.ProjectID = c.ProjectID and c.status=1 and isnull(a.RentPrice_1,0) <> isnull(c.RentPrice,0)
where b.ProjectID is not null or c.ProjectID is not null;
----
select a.ProjectID, a.PriceType, a.BasePrice_1, b.RentPrice, a.SumCase1, b.VOPPAT, b.VOPPA,
a.GF_1Room*b.RentPrice/a.RentPrice as GF_1Room,
select a.ProjectID, a.PriceType, a.BasePrice_1, b.RentPrice, a.SumCase1, b.VOPPAT, b.VOPPA,
a.GF_1Room*b.RentPrice/a.RentPrice as GF_1Room,
a.GF_2Room*b.RentPrice/a.RentPrice as GF_2Room,
a.GY_2Room*b.RentPrice/a.RentPrice as GY_2Room,
a.GY_3Room*b.RentPrice/a.RentPrice as GY_3Room,
@ -73,13 +69,13 @@ select a.ProjectID, a.PriceType, a.BasePrice_1, b.RentPrice, a.SumCase1, b.VOPPA
a.Two_Room*b.RentPrice/a.RentPrice as Two_Room,
a.Three_Room*b.RentPrice/a.RentPrice as Three_Room,
a.EntireRentRatio*b.RentPrice/a.RentPrice as EntireRentRatio,
a.EntireRentNum,
a.EntireRentNum,
a.ShareRentRatio*b.RentPrice/a.RentPrice as ShareRentRatio,
a.ShareRentNum,
a.ShareRentNum,
a.SaleRentRatio*b.RentPrice/a.RentPrice as SaleRentRatio,
b.ModifyDate, 1 as Status,
case when RentPriceChg=0 then '' else 'RentPriceChg|' end +
case when VOPPATChg=0 then '' else 'VOPPATChg|' end +
b.ModifyDate, 1 as Status,
case when RentPriceChg=0 then '' else 'RentPriceChg|' end +
case when VOPPATChg=0 then '' else 'VOPPATChg|' end +
case when VOPPAChg=0 then '' else 'VOPPAChg|' end as AdjEvd
into #InfoChgCurr
from ODS_PROJECT_RENT_PRICE_INFO_#yearMonth# a
@ -95,13 +91,11 @@ on a.ProjectID = b.ProjectID
where b.ProjectID is not null and a.status=1;
insert into ODS_PROJECT_RENT_PRICE_INFO_#yearMonth#
select * from #InfoChgCurr
select * from #InfoChgCurr;
----
-----BUG修复使
-----
select a.ProjectID, a.PriceType, a.BasePrice_1, b.RentPrice_1, a.SumCase1, a.VOPPAT, a.VOPPA,
a.GF_1Room*b.RentPrice_1/a.RentPrice as GF_1Room,
select a.ProjectID, a.PriceType, a.BasePrice_1, b.RentPrice_1, a.SumCase1, a.VOPPAT, a.VOPPA,
a.GF_1Room*b.RentPrice_1/a.RentPrice as GF_1Room,
a.GF_2Room*b.RentPrice_1/a.RentPrice as GF_2Room,
a.GY_2Room*b.RentPrice_1/a.RentPrice as GY_2Room,
a.GY_3Room*b.RentPrice_1/a.RentPrice as GY_3Room,
@ -109,11 +103,11 @@ select a.ProjectID, a.PriceType, a.BasePrice_1, b.RentPrice_1, a.SumCase1, a.VOP
a.Two_Room*b.RentPrice_1/a.RentPrice as Two_Room,
a.Three_Room*b.RentPrice_1/a.RentPrice as Three_Room,
a.EntireRentRatio*b.RentPrice_1/a.RentPrice as EntireRentRatio,
a.EntireRentNum,
a.EntireRentNum,
a.ShareRentRatio*b.RentPrice_1/a.RentPrice as ShareRentRatio,
a.ShareRentNum,
a.ShareRentNum,
a.SaleRentRatio*b.RentPrice_1/a.RentPrice as SaleRentRatio,
b.ModifyDate, 1 as Status,
b.ModifyDate, 1 as Status,
'RentPrice_1Chg|' as AdjEvd
into #InfoChgLst
from ODS_PROJECT_RENT_PRICE_INFO_#lastYearMonth# a
@ -131,40 +125,9 @@ where b.ProjectID is not null and a.status=1;
insert into ODS_PROJECT_RENT_PRICE_INFO_#lastYearMonth#
select * from #InfoChgLst;
drop table #InfoChg, #InfoChgCurr, #InfoChgLst;
drop table #InfoChg, #InfoChgCurr, #InfoChgLst
--
WITH STP AS(
SELECT A.ProjectID, 2 AS PriceType, NULL AS BasePrice_1, A.RentPrice, A.MainRentPrice,
NULL SumCase1, A.VOPPAT, A.VOPPA,
CASE WHEN C.ProjectLevel = '工房1' THEN A.RentPrice*(1+24*0.012)*1.0/(1.0*(1+0.011*1.8))
WHEN C.ProjectLevel = '工房2' THEN A.RentPrice*(1+26*0.012)*1.0/(1.0*(1+0.011*1.8))
END AS GF_1Room,
CASE WHEN C.ProjectLevel = '工房1' THEN A.RentPrice*(1+16*0.012)*1.0/(1.0*(1+0.011*1.8))
WHEN C.ProjectLevel = '工房2' THEN A.RentPrice*(1+16*0.012)*1.0/(1.0*(1+0.011*1.8))
END AS GF_2Room,
CASE WHEN C.ProjectLevel = '低端公寓1' THEN A.RentPrice*1.0*(1+0.011*3.3)/(1.0*(1+0.011*1.8))
WHEN C.ProjectLevel IN ('中端公寓','低端公寓2') THEN A.RentPrice*1.0*(1+0.011*3.3)/(1.0*(1+0.011*1.8))
WHEN C.ProjectLevel IN ('高端公寓','超高端公寓') THEN A.RentPrice*(1+5*0.012)*(1+0.011*3.3)/((1.0+0.011*1.8))
END AS GY_2Room,
CASE WHEN C.ProjectLevel = '低端公寓1' THEN A.RentPrice*(1-3*0.012)*(1+0.011*4.25)/(1*(1+0.011*1.8))
WHEN C.ProjectLevel = '低端公寓2' THEN A.RentPrice*(1-4*0.012)*(1+0.011*4.25)/(1*(1+0.011*1.8))
WHEN C.ProjectLevel = '中端公寓' THEN A.RentPrice*(1-3*0.012)*(1+0.011*4.25)/(1*(1+0.011*1.8))
WHEN B.ProjectLevel IN ('高端公寓','超高端公寓') THEN A.RentPrice*(1+4*0.012)*(1+0.011*4.25)/((1+0.011*1.8))
END AS GY_3Room
FROM DWA_PROJECTBASEPRICE_RENT_MANU_#yearMonth# A
LEFT JOIN ResidenceCommunity C
ON A.ProjectID = C.CommunityId
WHERE C.CommunityId IS NULL
)
INSERT INTO ODS_PROJECT_RENT_PRICE_INFO_#yearMonth#
SELECT A.ProjectID, A.PriceType, A.BasePrice_1, A.RentPrice, A.SumCase1, A.VOPPAT, A.VOPPA, A.GF_1Room, A.GF_2Room, A.GY_2Room, A.GY_3Room,
A.GF_1Room*35 AS One_Room, A.GF_2Room*50 AS Two_Room, A.GY_3Room*105 AS Three_Three_Room, NULL EntireRentRatio, NULL EntireRentNum,
NULL ShareRentRatio, NULL ShareRentNum, NULL SaleRentRatio, GETDATE() AS ModifyDate,
1 AS Status, 'NewAdded' AdjEvd
FROM STP A
-- 更新上月价格
update a
set a.ITEM_MAINAREAPRICE = b.RentPrice
from obpm_LianCheng_Data.dbo.TLK_基价信息 a
@ -227,7 +190,6 @@ select newid()
from dbo.ODS_PROJECT_RENT_PRICE_INFO_#yearMonth#
where Status = 1;
insert into obpm_LianCheng_Data.dbo.T_DOCUMENT
(
ID
@ -266,4 +228,4 @@ from obpm_LianCheng_Data.dbo.TLK_基价信息 a
on a.ID = b.ID
where a.ITEM_VALUEPOINT = '#priceDate#'
and a.ITEM_PROJECTTYPE = '1'
and a.ITEM_PRICETYPE = '2';
and a.ITEM_PRICETYPE = '2';

View File

@ -1,114 +1,114 @@
package ${packageName}.controller;
import java.util.List;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
import ${packageName}.domain.${ClassName};
import ${packageName}.service.I${ClassName}Service;
import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.common.utils.poi.ExcelUtil;
#if($table.crud)
import com.ruoyi.framework.web.page.TableDataInfo;
#elseif($table.tree)
#end
/**
* ${functionName}Controller
*
* @author ${author}
* @date ${datetime}
*/
@RestController
@RequestMapping("/${moduleName}/${businessName}")
public class ${ClassName}Controller extends BaseController
{
@Autowired
private I${ClassName}Service ${className}Service;
/**
* 查询${functionName}列表
*/
@PreAuthorize("@ss.hasPermi('${permissionPrefix}:list')")
@GetMapping("/list")
#if($table.crud)
public TableDataInfo list(${ClassName} ${className})
{
startPage();
List<${ClassName}> list = ${className}Service.select${ClassName}List(${className});
return getDataTable(list);
}
#elseif($table.tree)
public AjaxResult list(${ClassName} ${className})
{
List<${ClassName}> list = ${className}Service.select${ClassName}List(${className});
return AjaxResult.success(list);
}
#end
/**
* 导出${functionName}列表
*/
@PreAuthorize("@ss.hasPermi('${permissionPrefix}:export')")
@Log(title = "${functionName}", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(${ClassName} ${className})
{
List<${ClassName}> list = ${className}Service.select${ClassName}List(${className});
ExcelUtil<${ClassName}> util = new ExcelUtil<${ClassName}>(${ClassName}.class);
return util.exportExcel(list, "${businessName}");
}
/**
* 获取${functionName}详细信息
*/
@PreAuthorize("@ss.hasPermi('${permissionPrefix}:query')")
@GetMapping(value = "/{${pkColumn.javaField}}")
public AjaxResult getInfo(@PathVariable("${pkColumn.javaField}") ${pkColumn.javaType} ${pkColumn.javaField})
{
return AjaxResult.success(${className}Service.select${ClassName}ById(${pkColumn.javaField}));
}
/**
* 新增${functionName}
*/
@PreAuthorize("@ss.hasPermi('${permissionPrefix}:add')")
@Log(title = "${functionName}", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody ${ClassName} ${className})
{
return toAjax(${className}Service.insert${ClassName}(${className}));
}
/**
* 修改${functionName}
*/
@PreAuthorize("@ss.hasPermi('${permissionPrefix}:edit')")
@Log(title = "${functionName}", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody ${ClassName} ${className})
{
return toAjax(${className}Service.update${ClassName}(${className}));
}
/**
* 删除${functionName}
*/
@PreAuthorize("@ss.hasPermi('${permissionPrefix}:remove')")
@Log(title = "${functionName}", businessType = BusinessType.DELETE)
@DeleteMapping("/{${pkColumn.javaField}s}")
public AjaxResult remove(@PathVariable ${pkColumn.javaType}[] ${pkColumn.javaField}s)
{
return toAjax(${className}Service.delete${ClassName}ByIds(${pkColumn.javaField}s));
}
}
package ${packageName}.controller;
import java.util.List;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.uvaluation.framework.aspectj.lang.annotation.Log;
import com.uvaluation.framework.aspectj.lang.enums.BusinessType;
import ${packageName}.domain.${ClassName};
import ${packageName}.service.I${ClassName}Service;
import com.uvaluation.framework.web.controller.BaseController;
import com.uvaluation.framework.web.domain.AjaxResult;
import com.uvaluation.common.utils.poi.ExcelUtil;
#if($table.crud)
import com.uvaluation.framework.web.page.TableDataInfo;
#elseif($table.tree)
#end
/**
* ${functionName}Controller
*
* @author ${author}
* @date ${datetime}
*/
@RestController
@RequestMapping("/${moduleName}/${businessName}")
public class ${ClassName}Controller extends BaseController
{
@Autowired
private I${ClassName}Service ${className}Service;
/**
* 查询${functionName}列表
*/
@PreAuthorize("@ss.hasPermi('${permissionPrefix}:list')")
@GetMapping("/list")
#if($table.crud)
public TableDataInfo list(${ClassName} ${className})
{
startPage();
List<${ClassName}> list = ${className}Service.select${ClassName}List(${className});
return getDataTable(list);
}
#elseif($table.tree)
public AjaxResult list(${ClassName} ${className})
{
List<${ClassName}> list = ${className}Service.select${ClassName}List(${className});
return AjaxResult.success(list);
}
#end
/**
* 导出${functionName}列表
*/
@PreAuthorize("@ss.hasPermi('${permissionPrefix}:export')")
@Log(title = "${functionName}", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(${ClassName} ${className})
{
List<${ClassName}> list = ${className}Service.select${ClassName}List(${className});
ExcelUtil<${ClassName}> util = new ExcelUtil<${ClassName}>(${ClassName}.class);
return util.exportExcel(list, "${businessName}");
}
/**
* 获取${functionName}详细信息
*/
@PreAuthorize("@ss.hasPermi('${permissionPrefix}:query')")
@GetMapping(value = "/{${pkColumn.javaField}}")
public AjaxResult getInfo(@PathVariable("${pkColumn.javaField}") ${pkColumn.javaType} ${pkColumn.javaField})
{
return AjaxResult.success(${className}Service.select${ClassName}ById(${pkColumn.javaField}));
}
/**
* 新增${functionName}
*/
@PreAuthorize("@ss.hasPermi('${permissionPrefix}:add')")
@Log(title = "${functionName}", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody ${ClassName} ${className})
{
return toAjax(${className}Service.insert${ClassName}(${className}));
}
/**
* 修改${functionName}
*/
@PreAuthorize("@ss.hasPermi('${permissionPrefix}:edit')")
@Log(title = "${functionName}", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody ${ClassName} ${className})
{
return toAjax(${className}Service.update${ClassName}(${className}));
}
/**
* 删除${functionName}
*/
@PreAuthorize("@ss.hasPermi('${permissionPrefix}:remove')")
@Log(title = "${functionName}", businessType = BusinessType.DELETE)
@DeleteMapping("/{${pkColumn.javaField}s}")
public AjaxResult remove(@PathVariable ${pkColumn.javaType}[] ${pkColumn.javaField}s)
{
return toAjax(${className}Service.delete${ClassName}ByIds(${pkColumn.javaField}s));
}
}

View File

@ -1,85 +1,81 @@
package ${packageName}.domain;
#foreach ($import in $importList)
import ${import};
#end
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.framework.aspectj.lang.annotation.Excel;
#if($table.crud)
import com.ruoyi.framework.web.domain.BaseEntity;
#elseif($table.tree)
import com.ruoyi.framework.web.domain.TreeEntity;
#end
/**
* ${functionName}对象 ${tableName}
*
* @author ${author}
* @date ${datetime}
*/
#if($table.crud)
#set($Entity="BaseEntity")
#elseif($table.tree)
#set($Entity="TreeEntity")
#end
public class ${ClassName} extends ${Entity}
{
private static final long serialVersionUID = 1L;
#foreach ($column in $columns)
#if(!$table.isSuperColumn($column.javaField))
/** $column.columnComment */
#if($column.list)
#set($parentheseIndex=$column.columnComment.indexOf(""))
#if($parentheseIndex != -1)
#set($comment=$column.columnComment.substring(0, $parentheseIndex))
#else
#set($comment=$column.columnComment)
#end
#if($parentheseIndex != -1)
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
#elseif($column.javaType == 'Date')
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "${comment}", width = 30, dateFormat = "yyyy-MM-dd")
#else
@Excel(name = "${comment}")
#end
#end
private $column.javaType $column.javaField;
#end
#end
#foreach ($column in $columns)
#if(!$table.isSuperColumn($column.javaField))
#if($column.javaField.length() > 2 && $column.javaField.substring(1,2).matches("[A-Z]"))
#set($AttrName=$column.javaField)
#else
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
#end
public void set${AttrName}($column.javaType $column.javaField)
{
this.$column.javaField = $column.javaField;
}
public $column.javaType get${AttrName}()
{
return $column.javaField;
}
#end
#end
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
#foreach ($column in $columns)
#if($column.javaField.length() > 2 && $column.javaField.substring(1,2).matches("[A-Z]"))
#set($AttrName=$column.javaField)
#else
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
#end
.append("${column.javaField}", get${AttrName}())
#end
.toString();
}
}
package ${packageName}.domain;
#foreach ($import in $importList)
import ${import};
#end
import com.uvaluation.framework.aspectj.lang.annotation.Excel;
#if($table.crud)
#elseif($table.tree)
#end
/**
* ${functionName}对象 ${tableName}
*
* @author ${author}
* @date ${datetime}
*/
#if($table.crud)
#set($Entity="BaseEntity")
#elseif($table.tree)
#set($Entity="TreeEntity")
#end
public class ${ClassName} extends ${Entity}
{
private static final long serialVersionUID = 1L;
#foreach ($column in $columns)
#if(!$table.isSuperColumn($column.javaField))
/** $column.columnComment */
#if($column.list)
#set($parentheseIndex=$column.columnComment.indexOf(""))
#if($parentheseIndex != -1)
#set($comment=$column.columnComment.substring(0, $parentheseIndex))
#else
#set($comment=$column.columnComment)
#end
#if($parentheseIndex != -1)
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
#elseif($column.javaType == 'Date')
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "${comment}", width = 30, dateFormat = "yyyy-MM-dd")
#else
@Excel(name = "${comment}")
#end
#end
private $column.javaType $column.javaField;
#end
#end
#foreach ($column in $columns)
#if(!$table.isSuperColumn($column.javaField))
#if($column.javaField.length() > 2 && $column.javaField.substring(1,2).matches("[A-Z]"))
#set($AttrName=$column.javaField)
#else
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
#end
public void set${AttrName}($column.javaType $column.javaField)
{
this.$column.javaField = $column.javaField;
}
public $column.javaType get${AttrName}()
{
return $column.javaField;
}
#end
#end
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
#foreach ($column in $columns)
#if($column.javaField.length() > 2 && $column.javaField.substring(1,2).matches("[A-Z]"))
#set($AttrName=$column.javaField)
#else
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
#end
.append("${column.javaField}", get${AttrName}())
#end
.toString();
}
}

View File

@ -1,109 +1,109 @@
package ${packageName}.service.impl;
import java.util.List;
#foreach ($column in $columns)
#if($column.javaField == 'createTime' || $column.javaField == 'updateTime')
import com.ruoyi.common.utils.DateUtils;
#break
#end
#end
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import ${packageName}.mapper.${ClassName}Mapper;
import ${packageName}.domain.${ClassName};
import ${packageName}.service.I${ClassName}Service;
/**
* ${functionName}Service业务层处理
*
* @author ${author}
* @date ${datetime}
*/
@Service
public class ${ClassName}ServiceImpl implements I${ClassName}Service
{
@Autowired
private ${ClassName}Mapper ${className}Mapper;
/**
* 查询${functionName}
*
* @param ${pkColumn.javaField} ${functionName}ID
* @return ${functionName}
*/
@Override
public ${ClassName} select${ClassName}ById(${pkColumn.javaType} ${pkColumn.javaField})
{
return ${className}Mapper.select${ClassName}ById(${pkColumn.javaField});
}
/**
* 查询${functionName}列表
*
* @param ${className} ${functionName}
* @return ${functionName}
*/
@Override
public List<${ClassName}> select${ClassName}List(${ClassName} ${className})
{
return ${className}Mapper.select${ClassName}List(${className});
}
/**
* 新增${functionName}
*
* @param ${className} ${functionName}
* @return 结果
*/
@Override
public int insert${ClassName}(${ClassName} ${className})
{
#foreach ($column in $columns)
#if($column.javaField == 'createTime')
${className}.setCreateTime(DateUtils.getNowDate());
#end
#end
return ${className}Mapper.insert${ClassName}(${className});
}
/**
* 修改${functionName}
*
* @param ${className} ${functionName}
* @return 结果
*/
@Override
public int update${ClassName}(${ClassName} ${className})
{
#foreach ($column in $columns)
#if($column.javaField == 'updateTime')
${className}.setUpdateTime(DateUtils.getNowDate());
#end
#end
return ${className}Mapper.update${ClassName}(${className});
}
/**
* 批量删除${functionName}
*
* @param ${pkColumn.javaField}s 需要删除的${functionName}ID
* @return 结果
*/
@Override
public int delete${ClassName}ByIds(${pkColumn.javaType}[] ${pkColumn.javaField}s)
{
return ${className}Mapper.delete${ClassName}ByIds(${pkColumn.javaField}s);
}
/**
* 删除${functionName}信息
*
* @param ${pkColumn.javaField} ${functionName}ID
* @return 结果
*/
@Override
public int delete${ClassName}ById(${pkColumn.javaType} ${pkColumn.javaField})
{
return ${className}Mapper.delete${ClassName}ById(${pkColumn.javaField});
}
}
package ${packageName}.service.impl;
import java.util.List;
#foreach ($column in $columns)
#if($column.javaField == 'createTime' || $column.javaField == 'updateTime')
import com.uvaluation.common.utils.DateUtils;
#break
#end
#end
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import ${packageName}.mapper.${ClassName}Mapper;
import ${packageName}.domain.${ClassName};
import ${packageName}.service.I${ClassName}Service;
/**
* ${functionName}Service业务层处理
*
* @author ${author}
* @date ${datetime}
*/
@Service
public class ${ClassName}ServiceImpl implements I${ClassName}Service
{
@Autowired
private ${ClassName}Mapper ${className}Mapper;
/**
* 查询${functionName}
*
* @param ${pkColumn.javaField} ${functionName}ID
* @return ${functionName}
*/
@Override
public ${ClassName} select${ClassName}ById(${pkColumn.javaType} ${pkColumn.javaField})
{
return ${className}Mapper.select${ClassName}ById(${pkColumn.javaField});
}
/**
* 查询${functionName}列表
*
* @param ${className} ${functionName}
* @return ${functionName}
*/
@Override
public List<${ClassName}> select${ClassName}List(${ClassName} ${className})
{
return ${className}Mapper.select${ClassName}List(${className});
}
/**
* 新增${functionName}
*
* @param ${className} ${functionName}
* @return 结果
*/
@Override
public int insert${ClassName}(${ClassName} ${className})
{
#foreach ($column in $columns)
#if($column.javaField == 'createTime')
${className}.setCreateTime(DateUtils.getNowDate());
#end
#end
return ${className}Mapper.insert${ClassName}(${className});
}
/**
* 修改${functionName}
*
* @param ${className} ${functionName}
* @return 结果
*/
@Override
public int update${ClassName}(${ClassName} ${className})
{
#foreach ($column in $columns)
#if($column.javaField == 'updateTime')
${className}.setUpdateTime(DateUtils.getNowDate());
#end
#end
return ${className}Mapper.update${ClassName}(${className});
}
/**
* 批量删除${functionName}
*
* @param ${pkColumn.javaField}s 需要删除的${functionName}ID
* @return 结果
*/
@Override
public int delete${ClassName}ByIds(${pkColumn.javaType}[] ${pkColumn.javaField}s)
{
return ${className}Mapper.delete${ClassName}ByIds(${pkColumn.javaField}s);
}
/**
* 删除${functionName}信息
*
* @param ${pkColumn.javaField} ${functionName}ID
* @return 结果
*/
@Override
public int delete${ClassName}ById(${pkColumn.javaType} ${pkColumn.javaField})
{
return ${className}Mapper.delete${ClassName}ById(${pkColumn.javaField});
}
}