Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
D
data-server
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
licc
data-server
Commits
bdac358f
Commit
bdac358f
authored
Mar 09, 2021
by
licc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
edit sql
parent
fca5cfba
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
18 deletions
+14
-18
ProgressPrizeMapper.xml
...-mapper/src/main/resources/mapper/ProgressPrizeMapper.xml
+14
-18
No files found.
wisenergy-mapper/src/main/resources/mapper/ProgressPrizeMapper.xml
View file @
bdac358f
...
...
@@ -21,7 +21,7 @@
</sql>
<sql
id=
"cols_exclude_id"
>
user_id,
year_month,growth_rate
,award_money,create_time,update_time
user_id,
`year_month`,`growth_rate`
,award_money,create_time,update_time
</sql>
<sql
id=
"vals"
>
...
...
@@ -30,8 +30,8 @@
<sql
id=
"updateCondition"
>
<if
test=
"userId != null"
>
user_id = #{userId},
</if>
<if
test=
"yearMonth != null"
>
year_month
= #{yearMonth},
</if>
<if
test=
"growthRate != null"
>
growth_rate
=#{growthRate},
</if>
<if
test=
"yearMonth != null"
>
`year_month`
= #{yearMonth},
</if>
<if
test=
"growthRate != null"
>
`growth_rate`
=#{growthRate},
</if>
<if
test=
"awardMoney != null"
>
award_money =#{awardMoney},
</if>
update_time =now()
</sql>
...
...
@@ -39,8 +39,8 @@
<sql
id=
"criteria"
>
<if
test=
"id != null"
>
id = #{id}
</if>
<if
test=
"userId != null"
>
and user_id = #{userId}
</if>
<if
test=
"yearMonth != null"
>
and
year_month
= #{yearMonth}
</if>
<if
test=
"growthRate != null"
>
and
growth_rate
=#{growthRate}
</if>
<if
test=
"yearMonth != null"
>
and
`year_month`
= #{yearMonth}
</if>
<if
test=
"growthRate != null"
>
and
`growth_rate`
=#{growthRate}
</if>
<if
test=
"awardMoney != null"
>
and award_money =#{awardMoney}
</if>
<if
test=
"createTime != null"
>
and create_time
>
= #{createTime}
</if>
<if
test=
"updateTime != null"
>
and #{updateTime}
>
= update_time
</if>
...
...
@@ -80,24 +80,20 @@
<where>
<if
test=
"yearMonth != null"
>
AND(
YEAR(
year_month
) = YEAR(#{yearMonth})
AND MONTH(
year_month
) = MONTH(#{yearMonth}))
YEAR(
`year_month`
) = YEAR(#{yearMonth})
AND MONTH(
`year_month`
) = MONTH(#{yearMonth}))
</if>
</where>
</select>
<select
id=
"getByTime"
resultType=
"cn.wisenergy.model.vo.ProgressPrizeVo"
>
select p.user_id as userId,p.growth_rate as growthRate, p.award_money as awardMoney
from progress_prize p,user_info u
<where>
p.user_id=u.user_id
<if
test=
"yearMonth != null"
>
AND(
YEAR(p.year_month) = YEAR(#{yearMonth})
AND MONTH(p.year_month) = MONTH(#{yearMonth}))
</if>
order by p.growth_rate desc,u.create_time desc
</where>
select p.user_id as userId,p.`growth_rate` as growthRate, p.award_money as awardMoney
from
progress_prize p ,user_info u
where
p.user_id=u.user_id
and p.`year_month` = #{yearMonth}
order by p.`growth_rate` desc,u.create_time desc
</select>
</mapper>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment