Initial commit
This commit is contained in:
+28
@@ -0,0 +1,28 @@
|
||||
<?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.user.mapper.ApiAnnouncementMapper">
|
||||
|
||||
<select id="getAnnouncementList" parameterType="Long" resultType="com.ruoyi.domain.other.TtAnnouncement">
|
||||
SELECT
|
||||
ta.*,
|
||||
CASE WHEN tar.user_id IS NOT NULL THEN 1 ELSE 0 END AS `read`
|
||||
FROM tt_announcement ta
|
||||
LEFT JOIN tt_announcement_read AS tar ON ta.announcement_id = tar.announcement_id AND tar.user_id = #{userId}
|
||||
ORDER BY ta.create_time DESC
|
||||
</select>
|
||||
|
||||
<select id="getAnnouncementByAnnouncementId" parameterType="Integer" resultType="com.ruoyi.domain.other.TtAnnouncement">
|
||||
SELECT * FROM tt_announcement WHERE announcement_id = #{announcementId}
|
||||
</select>
|
||||
|
||||
<select id="countUnreadAnnouncement" parameterType="Long" resultType="int">
|
||||
SELECT
|
||||
COUNT(ta.announcement_id)
|
||||
FROM tt_announcement ta
|
||||
LEFT JOIN tt_announcement_read AS tar ON ta.announcement_id = tar.announcement_id AND tar.user_id = #{userId}
|
||||
WHERE
|
||||
tar.user_id IS NULL
|
||||
</select>
|
||||
</mapper>
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
<?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.user.mapper.ApiAnnouncementReadMapper">
|
||||
|
||||
<select id="countAnnouncementRead" resultType="int">
|
||||
SELECT COUNT(*) FROM tt_announcement_read WHERE announcement_id = #{announcementId} AND user_id = #{userId}
|
||||
</select>
|
||||
|
||||
<insert id="addAnnouncementRead">
|
||||
INSERT INTO tt_announcement_read(announcement_id, user_id) VALUES (#{announcementId}, #{userId})
|
||||
</insert>
|
||||
</mapper>
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
<?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.user.mapper.ApiMessageMapper">
|
||||
|
||||
<select id="getMessageList" resultType="com.ruoyi.domain.vo.ApiMessageDataVO">
|
||||
SELECT
|
||||
tms.id,
|
||||
tm.message,
|
||||
tms.`status`,
|
||||
tms.send_time,
|
||||
tms.reading_time
|
||||
FROM tt_message_send tms
|
||||
LEFT JOIN tt_message tm ON tms.message_id = tm.id
|
||||
<where>
|
||||
<if test="id != null"> AND tms.id = #{id} </if>
|
||||
AND tms.rec_id = #{userId} AND tms.`status` != '2'
|
||||
</where>
|
||||
ORDER BY tms.`status` ASC,tms.send_time DESC
|
||||
</select>
|
||||
</mapper>
|
||||
+51
@@ -0,0 +1,51 @@
|
||||
<?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.user.mapper.ApiNoticeMapper">
|
||||
|
||||
<select id="getNoticeList" parameterType="Long" resultType="com.ruoyi.user.model.vo.ApiNoticeVO">
|
||||
SELECT * FROM tt_notice WHERE user_id = #{userId}
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
|
||||
<select id="getNoticeByNoticeId" resultType="com.ruoyi.user.model.vo.ApiNoticeVO">
|
||||
SELECT * FROM tt_notice WHERE user_id = #{userId} AND notice_id = #{noticeId}
|
||||
</select>
|
||||
|
||||
<select id="countUnreadNotice" parameterType="Long" resultType="int">
|
||||
SELECT COUNT(notice_id) FROM tt_notice WHERE `read` = 0 AND user_id = #{userId}
|
||||
</select>
|
||||
|
||||
<insert id="addNotice" parameterType="com.ruoyi.domain.other.TtNotice">
|
||||
insert into tt_notice
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="userId != null">user_id,</if>
|
||||
<if test="title != null and title != ''">title,</if>
|
||||
<if test="content != null and content != ''">content,</if>
|
||||
<if test="read != null">`read`,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="userId != null">#{userId},</if>
|
||||
<if test="title != null and title != ''">#{title},</if>
|
||||
<if test="content != null and content != ''">#{content},</if>
|
||||
<if test="read != null">#{read},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="editNotice" parameterType="com.ruoyi.domain.other.TtNotice">
|
||||
update tt_notice
|
||||
<trim prefix="set" suffixOverrides=",">
|
||||
<if test="title != null and title != ''">title = #{title},</if>
|
||||
<if test="content != null and content != ''">content = #{content},</if>
|
||||
<if test="read != null">`read` = #{read},</if>
|
||||
</trim>
|
||||
where notice_id = #{noticeId}
|
||||
</update>
|
||||
|
||||
<delete id="removeNoticeByNoticeId" parameterType="Integer">
|
||||
delete from tt_notice where notice_id = #{noticeId}
|
||||
</delete>
|
||||
</mapper>
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
<?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.user.mapper.ApiShoppingMapper">
|
||||
|
||||
<select id="list" resultType="com.ruoyi.domain.vo.ApiShoppingDataVO">
|
||||
SELECT
|
||||
tto.id,
|
||||
tto.name itemName,
|
||||
tto.use_price * #{exchangePriceRatio} AS use_price,
|
||||
tto.image_url,
|
||||
tto.item_id,
|
||||
tto.short_name,
|
||||
tto.type,
|
||||
tto.type_name,
|
||||
tto.quality,
|
||||
tto.quality_name,
|
||||
tto.rarity,
|
||||
tto.rarity_name,
|
||||
tto.rarity_color,
|
||||
tto.exterior,
|
||||
tto.exterior_name
|
||||
FROM tt_ornament tto
|
||||
<where>
|
||||
<if test="shoppingBody.itemName != null">and tto.name LIKE CONCAT('%',#{shoppingBody.itemName},'%')</if>
|
||||
<if test="shoppingBody.type != null">and tto.type = #{shoppingBody.type}</if>
|
||||
<if test="shoppingBody.quality != null">and tto.quality = #{shoppingBody.quality}</if>
|
||||
<if test="shoppingBody.rarity != null">and tto.rarity = #{shoppingBody.rarity}</if>
|
||||
<if test="shoppingBody.exterior != null">and tto.exterior = #{shoppingBody.exterior}</if>
|
||||
<if test="shoppingBody.maxPrice != null">and tto.use_price * #{exchangePriceRatio} BETWEEN
|
||||
#{shoppingBody.minPrice} AND #{shoppingBody.maxPrice}
|
||||
</if>
|
||||
and is_putaway = '0'
|
||||
</where>
|
||||
<if test="shoppingBody.sortBy == 0">ORDER BY tto.use_price DESC</if>
|
||||
<if test="shoppingBody.sortBy == 1">ORDER BY tto.use_price ASC</if>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
+74
@@ -0,0 +1,74 @@
|
||||
<?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.user.mapper.ApiTaskCenterMapper">
|
||||
|
||||
<select id="selectApiTaskCenterVOList" parameterType="Integer" resultType="com.ruoyi.user.model.vo.ApiTaskCenterVO">
|
||||
SELECT
|
||||
tc.task_id, tc.task_name, tc.description,
|
||||
-- 领取条件(0不满足 1满足)
|
||||
CASE WHEN tcu.user_id IS NULL THEN '0' ELSE '1' END AS status,
|
||||
tcu.claimed
|
||||
FROM
|
||||
tt_task_center AS tc
|
||||
LEFT JOIN
|
||||
tt_task_center_user AS tcu ON tc.task_id = tcu.task_id AND tcu.user_id = #{userId}
|
||||
WHERE
|
||||
tc.status = 1
|
||||
</select>
|
||||
|
||||
<select id="getYesterdayExpenditure" resultType="com.ruoyi.user.model.dto.YesterdayExpenditureDTO">
|
||||
SELECT
|
||||
user_id AS userId,
|
||||
SUM(ABS(total)) AS totalRecharge
|
||||
FROM
|
||||
tt_user_blend_ercash
|
||||
WHERE
|
||||
type = 0
|
||||
AND create_time >= CURDATE() - INTERVAL 1 DAY
|
||||
AND create_time < CURDATE()
|
||||
AND total IS NOT NULL
|
||||
AND total != 0.00
|
||||
GROUP BY
|
||||
user_id
|
||||
</select>
|
||||
|
||||
<select id="selectCreditByTaskIdAndUserId" resultType="java.math.BigDecimal">
|
||||
SELECT credit FROM tt_task_center_user WHERE task_id = #{taskId} AND user_id = #{userId}
|
||||
</select>
|
||||
|
||||
<select id="selectTtTaskCenterUserByTaskIdAndUserId" resultType="com.ruoyi.user.model.TtTaskCenterUser">
|
||||
SELECT * FROM tt_task_center_user WHERE task_id = #{taskId} AND user_id = #{userId}
|
||||
</select>
|
||||
|
||||
<insert id="insertYesterdayExpenditureBonusPoints">
|
||||
INSERT INTO tt_task_center_user (task_id, user_id, credit)
|
||||
VALUES
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(#{item.taskId}, #{item.userId}, #{item.credit})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<delete id="deleteYesterdayExpenditureBonusPoints" parameterType="Integer">
|
||||
DELETE FROM tt_task_center_user WHERE task_id = 1
|
||||
</delete>
|
||||
|
||||
<delete id="markAsClaimedByUserIdAndType">
|
||||
UPDATE tt_task_center_user SET claimed = 1 WHERE user_id = #{userId} AND type = #{type}
|
||||
</delete>
|
||||
|
||||
<insert id="insertTaskCenterRecord" parameterType="com.ruoyi.user.model.TtTaskCenterUser">
|
||||
insert into tt_task_center_user
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="taskId != null">task_id,</if>
|
||||
<if test="userId != null">user_id,</if>
|
||||
<if test="credit != null">credit,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="taskId != null">#{taskId},</if>
|
||||
<if test="userId != null">#{userId},</if>
|
||||
<if test="credit != null">#{credit},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
</mapper>
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
<?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.user.mapper.ApiUserBlendErcashMapper">
|
||||
|
||||
<select id="getRechargeRankingByDate" parameterType="String" resultType="com.ruoyi.user.model.vo.ApiRechargeRankingVO">
|
||||
SELECT
|
||||
@rank := @rank + 1 AS ranking,
|
||||
t.*
|
||||
FROM (
|
||||
SELECT
|
||||
tube.user_id,
|
||||
ABS(SUM(tube.total)) AS total_recharge,
|
||||
ABS(SUM(amount)) AS amount,
|
||||
ABS(SUM(credits)) AS credits,
|
||||
tu.nick_name,
|
||||
tu.avatar
|
||||
FROM
|
||||
tt_user_blend_ercash AS tube
|
||||
LEFT JOIN
|
||||
tt_user tu ON tube.user_id = tu.user_id
|
||||
WHERE
|
||||
tube.type = 0
|
||||
AND DATE(tube.create_time) = #{date}
|
||||
GROUP BY
|
||||
tube.user_id
|
||||
ORDER BY
|
||||
total_recharge DESC
|
||||
LIMIT 10
|
||||
) t, (SELECT @rank := 0) r;
|
||||
</select>
|
||||
</mapper>
|
||||
+82
@@ -0,0 +1,82 @@
|
||||
<?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.user.mapper.ApiUserPackSackMapper">
|
||||
|
||||
<select id="getPackSack" resultType="com.ruoyi.domain.vo.UserPackSackDataVO">
|
||||
SELECT tbr.id,
|
||||
tbr.ornament_id,
|
||||
tbr.ornaments_price,
|
||||
tto.name,
|
||||
tto.short_name,
|
||||
tto.image_url,
|
||||
tto.exterior_name,
|
||||
tbr.ornaments_level_id,
|
||||
tol.level_img
|
||||
FROM tt_box_records tbr
|
||||
LEFT JOIN tt_ornament tto ON tbr.ornament_id = tto.id
|
||||
LEFT JOIN tt_ornaments_level tol ON tbr.ornaments_level_id = tol.id
|
||||
WHERE
|
||||
tbr.holder_user_id = #{userId}
|
||||
AND
|
||||
tbr.`status` = '0'
|
||||
and
|
||||
tbr.`is_show` = 1
|
||||
ORDER BY tbr.create_time DESC
|
||||
</select>
|
||||
|
||||
<select id="clientPackSack" resultType="com.ruoyi.domain.vo.UserPackSackDataVO">
|
||||
SELECT tbr.id,
|
||||
tbr.ornament_id,
|
||||
tbr.ornaments_price,
|
||||
tto.name,
|
||||
tto.short_name,
|
||||
tto.image_url,
|
||||
tto.exterior_name,
|
||||
tbr.ornaments_level_id,
|
||||
tol.level_img
|
||||
FROM tt_box_records tbr
|
||||
LEFT JOIN tt_ornament tto ON tbr.ornament_id = tto.id
|
||||
LEFT JOIN tt_ornaments_level tol ON tbr.ornaments_level_id = tol.id
|
||||
<where>
|
||||
<if test="uidList.size > 0">
|
||||
and tbr.holder_user_id in
|
||||
<foreach collection="uidList" item="uid" open="(" separator="," close=")">
|
||||
#{uid}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="statusList.size > 0">
|
||||
and tbr.status in
|
||||
<foreach collection="statusList" item="sta" open="(" separator="," close=")">
|
||||
#{sta}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="beginTime != null and endTime != null">
|
||||
and tbr.create_time between #{beginTime} and #{endTime}
|
||||
</if>
|
||||
<if test="name != null">
|
||||
and tto.name like CONCAT("%",#{name},"%")
|
||||
</if>
|
||||
</where>
|
||||
<if test="orderByFie == 1">order by tbr.create_time</if>
|
||||
<if test="orderByFie == 2">order by tbr.ornaments_price</if>
|
||||
<if test="orderByType == 1"> asc</if>
|
||||
<if test="orderByType == 2"> desc</if>
|
||||
limit #{limit}, #{size}
|
||||
</select>
|
||||
|
||||
<select id="packSackGlobalData" resultType="com.ruoyi.domain.vo.client.PackSackGlobalData">
|
||||
|
||||
SELECT
|
||||
count(tbr.id) as totalOrnamentNumber,
|
||||
sum(tbr.ornaments_price) as totalOrnamentPrice
|
||||
FROM tt_box_records tbr
|
||||
<where>
|
||||
and tbr.holder_user_id = #{userId}
|
||||
and tbr.status = 0
|
||||
</where>
|
||||
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user