first commit

This commit is contained in:
GYJ
2024-12-02 10:29:28 +08:00
commit 03cd33b658
485 changed files with 63600 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
<?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.sqx.modules.app.dao.AppDao">
<select id="selectNewApp" resultType="com.sqx.modules.app.entity.App">
select * from app order by version desc
</select>
</mapper>

View File

@@ -0,0 +1,15 @@
<?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.sqx.modules.app.dao.MsgDao">
<select id="findByPhone" resultType="com.sqx.modules.app.entity.Msg">
select * from msg where phone=#{phone}
</select>
<select id="findByPhoneAndCode" resultType="com.sqx.modules.app.entity.Msg">
select * from msg where phone=#{phone} and code=#{msg}
</select>
</mapper>

View File

@@ -0,0 +1,338 @@
<?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.sqx.modules.app.dao.UserDao">
<select id="selectUserPage" resultType="com.sqx.modules.app.entity.UserEntity">
select u.*,v.is_vip as member,v.end_time as endTime,v.vip_type as vipType,
s.username as sysUserName
from tb_user u
left join user_vip v on v.user_id=u.user_id
left join sys_user s on s.qd_code=u.qd_code
where s.sys_user_id is null
<if test="vipType!=null">
and v.vip_type = #{vipType}
</if>
<if test="search!=null and search!=''">
and (u.user_id=#{search} or u.phone = #{search} or u.user_name =#{search} )
</if>
<if test="sysUserName!=null and sysUserName!=''">
and s.username like concat('%',#{sysUserName},'%')
</if>
<if test="userName!=null and userName!=''">
and u.user_name like concat('%',#{userName},'%')
</if>
<if test="sex!=null and sex!=0">
and u.sex=#{sex}
</if>
<if test="platform!=null and platform!=''">
and u.platform=#{platform}
</if>
<if test="sysPhone!=null and sysPhone!=''">
and u.sys_phone=#{sysPhone}
</if>
<if test="status!=null and status!=0">
and u.status=#{status}
</if>
<if test="member!=null and member!=-1 and member!=1">
and v.is_vip=#{member}
</if>
<if test="member!=null and member==1">
and (v.is_vip=1 or v.is_vip is null)
</if>
<if test="inviterCode!=null and inviterCode!=''">
and u.inviter_code like concat("%",#{inviterCode},"%")
</if>
<if test="invitationCode!=null and invitationCode!=''">
and u.invitation_code like concat("%",#{invitationCode},"%")
</if>
<if test="qdCode!=null and qdCode!=''">
and u.qd_code =#{qdCode}
</if>
<if test="startTime!=null and startTime!='' and endTime!=null and endTime!=''">
and date_format(u.create_time,'%Y-%m-%d') BETWEEN #{startTime} and #{endTime}
</if>
<if test="startTime!=null and startTime!='' and (endTime==null or endTime=='')">
and date_format(u.create_time,'%Y-%m-%d') &gt;= #{startTime}
</if>
<if test="endTime!=null and endTime!='' and (startTime==null or startTime=='')">
and date_format(u.create_time,'%Y-%m-%d') &lt;= #{endTime}
</if>
order by create_time desc
</select>
<select id="userListExcel" resultType="com.sqx.modules.app.entity.UserEntity">
select * from tb_user u
<where>
<if test="userEntity.phone!=null and userEntity.phone!=''">
and u.phone like concat("%",#{userEntity.phone},"%")
</if>
<if test="userEntity.userName!=null and userEntity.userName!=''">
and u.user_name like concat("%",#{userEntity.userName},"%")
</if>
<if test="userEntity.invitationCode!=null and userEntity.invitationCode!=''">
and u.invitation_code like concat("%",#{userEntity.invitationCode},"%")
</if>
<if test="userEntity.inviterCode!=null and userEntity.inviterCode!=''">
and u.inviter_code like concat("%",#{userEntity.inviterCode},"%")
</if>
<if test="userEntity.platform!=null and userEntity.platform!=''">
and u.platform = #{userEntity.platform}
</if>
<if test="startTime!=null and startTime!='' and endTime!=null and endTime!=''">
and date_format(u.create_time,'%Y-%m-%d') BETWEEN #{startTime} and #{endTime}
</if>
<if test="startTime!=null and startTime!='' and (endTime==null or endTime=='')">
and date_format(u.create_time,'%Y-%m-%d') &gt;= #{startTime}
</if>
<if test="endTime!=null and endTime!='' and (startTime==null or startTime=='')">
and date_format(u.create_time,'%Y-%m-%d') &lt;= #{endTime}
</if>
</where>
</select>
<select id="queryInviterCount" resultType="int">
select count(*) from tb_user
where inviter_code=#{inviterCode}
</select>
<select id="queryUserCount" resultType="int">
select count(*)from tb_user where 1=1
<if test="type==1">
and date_format(create_time,'%Y-%m-%d')=date_format(#{date},'%Y-%m-%d')
</if>
<if test="type==2">
and date_format(create_time,'%Y-%m')=date_format(#{date},'%Y-%m')
</if>
<if test="type==3">
and date_format(create_time,'%Y')=date_format(#{date},'%Y')
</if>
<if test="platform!=null">
and platform=#{platform}
</if>
<if test="qdCode!=null">
and qd_code=#{qdCode}
</if>
</select>
<select id="queryPayMoney" resultType="Double">
select sum(p.money) from pay_details p
left join tb_user u on u.user_id=p.user_id
where p.`state`=1
<if test="type==1">
and date_format(p.create_time,'%Y-%m-%d')=date_format(#{date},'%Y-%m-%d')
</if>
<if test="type==2">
and date_format(p.create_time,'%Y-%m')=date_format(#{date},'%Y-%m')
</if>
<if test="type==3">
and date_format(p.create_time,'%Y')=date_format(#{date},'%Y')
</if>
<if test="qdCode!=null">
and u.qd_code=#{qdCode}
</if>
</select>
<select id="queryCourseOrder" resultType="com.sqx.modules.app.response.CourseOrderResponse">
select * from (
select c.course_id as courseId,sum(o.pay_money) as 'coursemoney' ,count(*) as 'coursenum',any_value(c.title) as 'coursename'
from orders o
left join course c on o.course_id=c.course_id
where o.status=1 and o.orders_type=1
<if test="sysUserId!=null">
and sys_user_id=#{sysUserId}
</if>
<if test="type==1">
and date_format(o.create_time,'%Y-%m-%d')=date_format(#{date},'%Y-%m-%d')
</if>
<if test="type==2">
and date_format(o.create_time,'%Y-%m')=date_format(#{date},'%Y-%m')
</if>
<if test="type==3">
and date_format(o.create_time,'%Y')=date_format(#{date},'%Y')
</if>
group by c.course_id
) a
order by a.coursenum desc
</select>
<select id="userMessage" resultType="int">
select count(*) from tb_user t
left join user_vip v on t.user_id=v.user_id where v.is_vip=2
<if test="type==1">
and date_format(t.create_time,'%Y-%m-%d')=date_format(#{date},'%Y-%m-%d')
</if>
<if test="type==2">
and date_format(t.create_time,'%Y-%m')=date_format(#{date},'%Y-%m')
</if>
<if test="type==3">
and date_format(t.create_time,'%Y')=date_format(#{date},'%Y')
</if>
<if test="qdCode!=null">
and t.qd_code=#{qdCode}
</if>
<if test="vipType!=null">
and v.vip_type=#{vipType}
</if>
</select>
<insert id="insertUser" parameterType="com.sqx.modules.app.entity.UserEntity" useGeneratedKeys="true" keyProperty="userId">
INSERT INTO tb_user
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="null != userName and '' != userName">
user_name,
</if>
<if test="null != phone and '' != phone">
phone,
</if>
<if test="null != avatar and '' != avatar">
avatar,
</if>
<if test="null != sex and '' != sex">
sex,
</if>
<if test="null != openId and '' != openId">
open_id,
</if>
<if test="null != wxOpenId and '' != wxOpenId">
wx_open_id,
</if>
<if test="null != password and '' != password">
password,
</if>
<if test="null != createTime and '' != createTime">
create_time,
</if>
<if test="null != updateTime and '' != updateTime">
update_time,
</if>
<if test="null != appleId and '' != appleId">
apple_id,
</if>
<if test="null != sysPhone and '' != sysPhone">
sys_phone,
</if>
<if test="null != status and '' != status">
status,
</if>
<if test="null != platform and '' != platform">
platform,
</if>
<if test="null != jifen and '' != jifen">
jifen,
</if>
<if test="null != invitationCode and '' != invitationCode">
invitation_code,
</if>
<if test="null != inviterCode and '' != inviterCode">
inviter_code,
</if>
<if test="null != clientid and '' != clientid">
clientid,
</if>
<if test="null != zhiFuBaoName and '' != zhiFuBaoName">
zhi_fu_bao_name,
</if>
<if test="null != zhiFuBao and '' != zhiFuBao">
zhi_fu_bao,
</if>
<if test="null != wxId and '' != wxId">
wx_id
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="null != userName and '' != userName">
#{userName},
</if>
<if test="null != phone and '' != phone">
#{phone},
</if>
<if test="null != avatar and '' != avatar">
#{avatar},
</if>
<if test="null != sex and '' != sex">
#{sex},
</if>
<if test="null != openId and '' != openId">
#{openId},
</if>
<if test="null != wxOpenId and '' != wxOpenId">
#{wxOpenId},
</if>
<if test="null != password and '' != password">
#{password},
</if>
<if test="null != createTime and '' != createTime">
#{createTime},
</if>
<if test="null != updateTime and '' != updateTime">
#{updateTime},
</if>
<if test="null != appleId and '' != appleId">
#{appleId},
</if>
<if test="null != sysPhone and '' != sysPhone">
#{sysPhone},
</if>
<if test="null != status and '' != status">
#{status},
</if>
<if test="null != platform and '' != platform">
#{platform},
</if>
<if test="null != jifen and '' != jifen">
#{jifen},
</if>
<if test="null != invitationCode and '' != invitationCode">
#{invitationCode},
</if>
<if test="null != inviterCode and '' != inviterCode">
#{inviterCode},
</if>
<if test="null != clientid and '' != clientid">
#{clientid},
</if>
<if test="null != zhiFuBaoName and '' != zhiFuBaoName">
#{zhiFuBaoName},
</if>
<if test="null != zhiFuBao and '' != zhiFuBao">
#{zhiFuBao},
</if>
<if test="null != wxId and '' != wxId">
#{wxId}
</if>
</trim>
</insert>
<select id="selectInviteUserList" resultType="com.sqx.modules.app.entity.UserEntity">
select *,(select count(*) from tb_user u1 where u1.inviter_code=u.invitation_code) as counts,
(select ifnull(sum(money),0.00) from invite i where i.user_id=u.user_id) as money
from tb_user u
where 1=1
<if test="userName!=null and userName!=''">
and user_name like concat('%',#{userName},'%')
</if>
<if test="phone!=null and phone!=''">
and phone like concat('%',#{phone},'%')
</if>
order by money desc,counts desc
</select>
<select id="selectUserOnLineCount" resultType="Integer">
select count(*) from tb_user where now()&lt;=DATE_ADD(on_line_time, INTERVAL 10 MINUTE )
<if test="qdCode!=null">
and qd_code=#{qdCode}
</if>
</select>
<update id="updateUserClientIdIsNull">
update tb_user
set clientid=''
where clientid = #{clientid}
</update>
</mapper>

View File

@@ -0,0 +1,30 @@
<?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.sqx.modules.app.dao.UserMoneyDao">
<update id="updateMayMoney">
update user_money set
<if test="type==1">
money=money+#{money}
</if>
<if test="type==2">
money=money-#{money}
</if>
where user_id=#{userId}
</update>
<update id="updateSysMoney">
update user_money set
<if test="type==1">
money=money+#{money}
</if>
<if test="type==2">
money=money-#{money}
</if>
where sys_user_id=#{sysUserId}
</update>
</mapper>

View File

@@ -0,0 +1,8 @@
<?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.sqx.modules.app.dao.UserMoneyDetailsDao">
<select id="monthIncome" resultType="Double">
select sum(money) from user_money_details where user_id=#{userId} and classify=4 and type=2 and state=2 and date_format(create_time,'%Y-%m')=date_format(#{date},'%Y-%m')
</select>
</mapper>

View File

@@ -0,0 +1,11 @@
<?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.sqx.modules.app.dao.UserVipDao">
<update id="updateUserVipByEndTime">
update user_vip set is_vip=1 where is_vip=2 and date_format(end_time,'%Y-%m-%d %H:%i:%S')&lt;=date_format(now(),'%Y-%m-%d %H:%i:%S')
</update>
</mapper>

View File

@@ -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.sqx.modules.banner.dao.ActivityDao">
<select id="selectByState" resultType="com.sqx.modules.banner.entity.Activity">
select * from activity where state=#{state} order by id desc
</select>
</mapper>

View File

@@ -0,0 +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.sqx.modules.banner.dao.BannerDao">
<select id="selectList" resultType="com.sqx.modules.banner.entity.Banner">
select * from banner
where classify=#{classify} and `state`=1
order by `sort` desc
</select>
<select id="selectLists" resultType="com.sqx.modules.banner.entity.Banner">
select * from banner
where classify=#{classify}
order by `sort` desc
</select>
<select id="selectBannerPage" resultType="com.sqx.modules.banner.entity.Banner">
select * from banner
where classify=#{classify}
order by `sort` desc
</select>
</mapper>

View File

@@ -0,0 +1,17 @@
<?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.sqx.modules.common.dao.CommonInfoDao">
<select id="findByCondition" resultType="com.sqx.modules.common.entity.CommonInfo">
select * from common_info where condition_from=#{condition}
</select>
<select id="findOne" resultType="com.sqx.modules.common.entity.CommonInfo">
select * from common_info where `type`=#{type}
</select>
</mapper>

View File

@@ -0,0 +1,26 @@
<?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.sqx.modules.course.dao.CourseClassificationDao">
<select id="selectCourseClassificationPage" resultType="com.sqx.modules.course.entity.CourseClassification">
select * from course_classification where 1=1 and is_delete=0
<if test ='null != classificationName'>
and classification_name LIKE CONCAT('%', #{classificationName}, '%')
</if>
order by sort
</select>
<select id="selectCourseClassificationList" resultType="com.sqx.modules.course.entity.CourseClassification">
select * from course_classification where 1=1 and is_delete=0
<if test ='null != classificationName'>
and classification_name LIKE CONCAT('%', #{classificationName}, '%')
</if>
order by sort
</select>
<update id="updateDelete">
update course_classification set is_delete=1 where classification_id=#{id}
</update>
<select id="queryClassification" resultType="com.sqx.modules.course.response.ClassificationResponse">
select classification_id ,classification_name from course_classification where is_delete=0;
</select>
</mapper>

View File

@@ -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.sqx.modules.course.dao.CourseCollectDao">
<select id="selectCourseByCollect" resultType="com.sqx.modules.course.entity.Course">
SELECT
MAX( u.update_time ) AS produceEndTime,
c.*,
(
SELECT
d.course_details_name
FROM
course_collect cc
LEFT JOIN course_details d ON cc.course_details_id = d.course_details_id
WHERE
d.course_id = u.course_id
AND cc.classify = 3 and cc.user_id=#{userId}
ORDER BY
cc.update_time DESC
LIMIT 1
) AS courseDetailsName,
(
SELECT
d.course_details_id
FROM
course_collect cc
LEFT JOIN course_details d ON cc.course_details_id = d.course_details_id
WHERE
d.course_id = u.course_id
AND cc.classify = 3 and cc.user_id=#{userId}
ORDER BY
cc.update_time DESC
LIMIT 1
) AS courseDetailsId,
( SELECT count(*) FROM course_details d WHERE d.course_id = c.course_id ) AS courseDetailsCount
FROM
course_collect u
LEFT JOIN course c ON u.course_id = c.course_id
WHERE
u.user_id = #{userId}
AND c.course_id IS NOT NULL
AND u.classify = #{classify}
GROUP BY
u.course_id
ORDER BY
produceEndTime DESC
</select>
</mapper>

View File

@@ -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.sqx.modules.course.dao.CourseCommentDao">
<update id="updateCourseComment">
<if test='1 == type'>
update course_comment set goods_num=goods_num+1 where course_comment_id=#{courseCommentId}
</if>
<if test='0 == type'>
update course_comment set goods_num=goods_num-1 where course_comment_id=#{courseCommentId}
</if>
</update>
<!--
查询该短剧的所有评论
返回结果 用户名称 用户图像 评论时间 评论内容 点赞数量
-->
<select id="selectCourseComment" resultType="com.sqx.modules.course.entity.CourseComment">
select c.course_comment_id,c.content,c.create_time,c.goods_num,
u.user_name as userName,u.avatar,c.user_id,
(select count(*) from comment_good g where g.course_comment_id=c.course_comment_id and user_id=#{userId}) as isGood
from course_comment c ,tb_user u where u.user_id=c.user_id
and c.course_id =#{courseId}
order by c.create_time desc
</select>
<!--
删除评论点赞的关联关系
-->
<delete id="deleteCommentGood">
delete from comment_good where course_comment_id=#{courseCommentId}
</delete>
<select id="selectCourseCommentByUserId" resultType="Map">
select cc.course_comment_id as courseCommentId,cc.goods_num as goodsNum,cc.content,cc.create_time,c.title,c.title_img as titleImg from course_comment cc
left join course c on c.course_id=cc.course_id
where cc.user_id=#{userId}
order by create_time desc
</select>
</mapper>

View File

@@ -0,0 +1,281 @@
<?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.sqx.modules.course.dao.CourseDao">
<update id="updateDelete">
update course
set is_delete=1
where course_id = #{id}
</update>
<select id="selectCourse" resultType="Map">
SELECT
c.classify_id as classifyId,
c.course_id as courseId,
c.course_label as courseLabel,
c.create_time createTime,
c.details,
c.img,
c.banner_img as bannerImg,
c.status,
c.is_delete as isDelete,
c.msg_type msgType,
c.msg_url as msgUrl,
c.pay_num as payNum,
c.price,
c.is_over as isOver,
c.title,
c.is_price as isPrice,
c.title_img as titleImg,
c.update_time as updateTime,
cc.classification_name as classificationName,
c.course_type as courseType,
c.banner_id as bannerId,
b.name as bannerName,
c.view_counts as viewCounts,
c.dy_img_id as dyImgId,
c.dy_course_id as dyCourseId,
c.wx_course_id as wxCourseId,
c.wx_show as wxShow,
c.dy_show as dyShow,
c.sort,
(select sum(good_num) from course_details d where d.course_id=c.course_id ) as goodNum,
(select count(*) from course_details d where d.course_id=c.course_id ) as courseDetailsCount,
<if test="userId!=null">
(
SELECT
cc.course_details_id
FROM
course_collect cc
WHERE
cc.course_id = c.course_id
AND cc.classify = 3
and cc.user_id = #{userId}
ORDER BY
cc.update_time desc
LIMIT 1
) AS courseDetailsId,
</if>
<if test="userId==null">
null AS courseDetailsName,
null AS courseDetailsId,
</if>
(select count(*) from course_collect d where d.course_id=c.course_id
and date_format(create_time,'%Y-%m-%d')>=date_format(#{startTime},'%Y-%m-%d') and
date_format(create_time,'%Y-%m-%d')&lt;=date_format(#{endTime},'%Y-%m-%d') ) as weekGoodNum,
(select count(*) from course_details cd where c.course_id=cd.course_id and cd.good=1 ) as isRecommend
FROM
course AS c
LEFT JOIN course_classification AS cc ON c.classify_id = cc.classification_id
left join banner as b on b.id=c.banner_id
WHERE
1 = 1
AND c.is_delete = 0
<if test='null != wxShow and wxShow==1'>
and c.wx_show = #{wxShow}
</if>
<if test='null != wxShow and wxShow==2'>
and (c.wx_show = #{wxShow} or c.wx_show is null)
</if>
<if test='null != dyShow and dyShow==1'>
and c.dy_show = #{dyShow}
</if>
<if test='null != dyShow and dyShow==2'>
and (c.dy_show = #{dyShow} or c.dy_show is null)
</if>
<if test='null != title'>
and c.title LIKE CONCAT('%', #{title}, '%')
</if>
<if test='null!= classifyId and classifyId!=0'>
and c.classify_id = #{classifyId}
</if>
<if test='null!= bannerId and bannerId!=0'>
and c.banner_id = #{bannerId}
</if>
<if test="classifyId==0">
and c.is_recommend=1
</if>
<if test="over!=null">
and c.is_over=#{over}
</if>
<if test="isRecommend!=null and isRecommend!=-1">
and c.course_id in (select course_id from course_details where good=1)
</if>
<if test="status!=null and status!=0">
and c.status=#{status}
</if>
<if test="isPrice!=null">
and c.is_price=#{isPrice}
</if>
<if test="wxCourse!=null">
and c.wx_course_id is not null
</if>
<if test="dyCourse!=null">
and c.dy_status=4
</if>
<if test="sort==null">
order by c.sort asc
</if>
<if test="sort!=null and sort==1">
order by goodNum desc
</if>
<if test="sort!=null and sort==2">
order by weekGoodNum desc
</if>
</select>
<select id="selectCourseAdmin" resultType="Map">
SELECT
c.classify_id as classifyId,
c.course_id as courseId,
c.course_label as courseLabel,
c.course_label_ids as courseLabelIds,
c.create_time createTime,
c.details,
c.img,
c.banner_img as bannerImg,
c.status,
c.is_delete as isDelete,
c.msg_type msgType,
c.msg_url as msgUrl,
c.pay_num as payNum,
c.price,
c.is_over as isOver,
c.title,
c.is_price as isPrice,
c.title_img as titleImg,
c.update_time as updateTime,
cc.classification_name as classificationName,
c.course_type as courseType,
c.banner_id as bannerId,
b.name as bannerName,
c.view_counts as viewCounts,
c.dy_img_id as dyImgId,
c.dy_course_id as dyCourseId,
c.dy_status as dyStatus,
c.dy_status_content as dyStatusContent,
c.dy_version as dyVersion,
c.license_num as licenseNum,
c.registration_num as registrationNum,
c.ordinary_record_num as ordinaryRecordNum,
c.key_record_num as keyRecordNum,
c.wx_course_id as wxCourseId,
c.wx_show as wxShow,
c.dy_show as dyShow,
c.sort,
c.`duration`,
c.`production_organisation` as productionOrganisation,
c.`director`,
c.`producer`,
c.`actor`,
c.`summary`,
c.`cost_distribution_uri` as costDistributionUri,
c.`assurance_uri` as assuranceUri,
c.`playlet_production_cost` as playletProductionCost,
c.`qualification_type` as qualificationType,
c.`registration_number` as registrationNumber,
c.`qualification_certificate_material_id` as qualificationCertificateMaterialId,
c.`cost_of_production` as costOfProduction,
c.`cost_commitment_letter_material_id` as costCommitmentLetterMaterialId,
c.`wx_course_status` as wxCourseStatus,
(select count(*) from course_details where dy_url_status in (1,3) or dy_url_status=null) as dyUrlStatus,
(select sum(o.pay_money) from orders o where o.course_id=c.course_id and o.status=1) as payMoney,
(select sum(good_num) from course_details d where d.course_id=c.course_id ) as goodNum,
(select count(*) from course_details d where d.course_id=c.course_id ) as courseDetailsCount,
(select count(*) from course_collect d where d.course_id=c.course_id
and date_format(create_time,'%Y-%m-%d')>=date_format(#{startTime},'%Y-%m-%d') and
date_format(create_time,'%Y-%m-%d')&lt;=date_format(#{endTime},'%Y-%m-%d') ) as weekGoodNum,
(select count(*) from course_details cd where c.course_id=cd.course_id and cd.good=1 ) as isRecommend
FROM
course AS c
LEFT JOIN course_classification AS cc ON c.classify_id = cc.classification_id
left join banner as b on b.id=c.banner_id
WHERE
1 = 1
AND c.is_delete = 0
<if test='null != wxShow and wxShow==1'>
and c.wx_show = #{wxShow}
</if>
<if test='null != wxShow and wxShow==2'>
and (c.wx_show = #{wxShow} or c.wx_show is null)
</if>
<if test='null != dyShow and dyShow==1'>
and c.dy_show = #{dyShow}
</if>
<if test='null != dyShow and dyShow==2'>
and (c.dy_show = #{dyShow} or c.dy_show is null)
</if>
<if test='null != title'>
and c.title LIKE CONCAT('%', #{title}, '%')
</if>
<if test='null!= classifyId and classifyId!=0'>
and c.classify_id = #{classifyId}
</if>
<if test='null!= bannerId and bannerId!=0'>
and c.banner_id = #{bannerId}
</if>
<if test="classifyId==0">
and c.is_recommend=1
</if>
<if test="over!=null and over==1">
and c.is_over=1
</if>
<if test="over!=null and over==2">
and (c.is_over is null or c.is_over=2)
</if>
<if test="isRecommend!=null and isRecommend!=-1">
and c.course_id in (select course_id from course_details where good=1)
</if>
<if test="status!=null and status!=0">
and c.status=#{status}
</if>
<if test="isPrice!=null">
and c.is_price=#{isPrice}
</if>
<if test="wxCourse!=null">
and c.wx_course_id is not null
</if>
<if test="dyCourse!=null">
and c.dy_status=4
</if>
<if test="sort==null">
order by c.sort asc,c.create_time desc
</if>
<if test="sort!=null and sort==1">
order by goodNum desc
</if>
<if test="sort!=null and sort==2">
order by weekGoodNum desc
</if>
</select>
<select id="selectCourseTitle" resultType="Map">
SELECT
c.classify_id as classifyId,
c.course_id as courseId,
c.course_label as courseLabel,
c.create_time createTime,
c.details,
c.img,
c.banner_img as bannerImg,
c.is_delete as isDelete,
c.msg_type msgType,
c.msg_url as msgUrl,
c.pay_num as payNum,
c.price,
c.status,
c.title,
c.title_img as titleImg,
c.update_time as updateTime
FROM
course c
WHERE
c.is_delete = 0 and c.status=1
<if test='null != title'>
and c.title LIKE #{title}
</if>
order by create_time desc
</select>
</mapper>

View File

@@ -0,0 +1,63 @@
<?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.sqx.modules.course.dao.CourseDetailsDao">
<!--查找指定短剧的目录 按照顺序数字升序-->
<select id="findByCourseId" resultType="com.sqx.modules.course.entity.CourseDetails">
select c.*,
(select count(*) from course_collect cc where cc.user_id=#{userId} and cc.course_details_id=c.course_details_id and cc.classify=2) as isGood
from course_details c where c.course_id=#{id} order by c.sort asc
</select>
<select id="selectCoursePageByCourseId" resultType="com.sqx.modules.course.entity.CourseDetails">
select * from course_details where course_id=#{id}
<if test="good!=null and good==1">
and good=#{good}
</if>
<if test="good!=null and good==2">
and (good=#{good} or good is null)
</if>
order by sort asc
</select>
<select id="findByCourseIdNotUrl" resultType="com.sqx.modules.course.entity.CourseDetails">
select c.course_details_id as courseDetailsId,c.course_id as courseId,c.wx_course_details_id as wxCourseDetailsId,
c.course_details_name as courseDetailsName,c.create_time as createTime,
c.dy_episode_id as dyEpisodeId,c.advertising,
(select count(*) from course_collect cc where cc.user_id=#{userId} and cc.course_details_id=c.course_details_id and cc.classify=2) as isGood,
c.title_img as titleImg,c.content,c.good_num as goodNum,c.price,if(is_price!=1,c.video_url,'') as videoUrl
from course_details c
where c.course_id=#{id} order by c.sort asc
</select>
<delete id="deleteCourseDetails" parameterType="String">
DELETE FROM course_details WHERE course_details_id IN
<foreach collection="array" item="ids" open="(" separator="," close=")">
#{ids}
</foreach>
</delete>
<select id="selectCourseDetailsList" resultType="com.sqx.modules.course.entity.CourseDetails">
select cd.*,
MD5( `course_details_id` ) AS `uid`
from course_details cd
left join course c on c.course_id=cd.course_id
where c.course_id is not null and c.is_delete=0 and cd.good=1
<if test='null != wxShow and wxShow==1'>
and c.wx_show = #{wxShow}
</if>
<if test='null != wxShow and wxShow==2'>
and (c.wx_show = #{wxShow} or c.wx_show is null)
</if>
<if test='null != dyShow and dyShow==1'>
and c.dy_show = #{dyShow}
</if>
<if test='null != dyShow and dyShow==2'>
and (c.dy_show = #{dyShow} or c.dy_show is null)
</if>
order by SUBSTR(uid, #{randomNum}, 6)
</select>
</mapper>

View File

@@ -0,0 +1,47 @@
<?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.sqx.modules.course.dao.CourseUserDao">
<select id="selectLatelyCourse" resultType="com.sqx.modules.course.entity.Course">
select c.*,(select count(*) from course_user cu where cu.course_id=u.course_id) as courseCount,
(select group_concat(avatar) from
(SELECT tu.avatar,course_id FROM course_user o
left join tb_user tu on tu.user_id=o.user_id
GROUP BY course_id,tu.avatar
limit 3
) a where a.course_id=u.course_id ) as avatar from course_user u
left join course c on u.course_id=c.course_id
where u.user_id=#{userId} and c.is_delete=0 order by update_time desc
</select>
<select id="selectCourseByCourseUser" resultType="com.sqx.modules.course.entity.Course">
select c.*,(select count(*) from course_user cu where cu.course_id=u.course_id) as courseCount,
(select group_concat(avatar) from
(SELECT tu.avatar,course_id FROM course_user o
left join tb_user tu on tu.user_id=o.user_id
GROUP BY course_id,tu.avatar
limit 3
) a where a.course_id=u.course_id ) as avatar
from course_user u
left join course c on u.course_id=c.course_id
where u.user_id=#{userId} and c.is_delete=0
order by u.create_time desc
</select>
<select id="selectCourseUser" resultType="com.sqx.modules.course.entity.CourseUser">
select * from course_user u where u.user_id=#{userId} and u.course_id=#{id} and u.classify=1
</select>
<select id="selectCourseUserList" resultType="com.sqx.modules.course.entity.CourseUser">
select * from course_user u where u.user_id=#{userId} and u.course_id=#{id} and u.classify=2
</select>
<update id="updateCourseTime">
update course_user set update_time =#{courseUser.updateTime}
</update>
<delete id="deleteCourseUserByVipUser">
delete from course_user where order_id in (select orders_id from orders where user_id= #{userId} and pay_way=5 and status=1)
</delete>
</mapper>

View File

@@ -0,0 +1,18 @@
<?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.sqx.modules.integral.dao.UserIntegralDao">
<update id="updateIntegral">
update user_integral set
<if test="type==1">
integral_num=integral_num+#{num}
</if>
<if test="type==2">
integral_num=integral_num-#{num}
</if>
where user_id=#{userId}
</update>
</mapper>

View File

@@ -0,0 +1,12 @@
<?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.sqx.modules.integral.dao.UserIntegralDetailsDao">
<select id="selectUserIntegralDetailsByUserId" resultType="com.sqx.modules.integral.entity.UserIntegralDetails">
select * from user_integral_details where user_id=#{userId} and
str_to_date(create_time,'%Y-%m-%d')=str_to_date( #{time},'%Y-%m-%d')
and classify=1
</select>
</mapper>

View File

@@ -0,0 +1,108 @@
<?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.sqx.modules.invite.dao.InviteDao">
<select id="selectInviteList" resultType="com.sqx.modules.invite.entity.Invite">
select * from invite
where user_id=#{userId}
<if test="state!=null">
and state=#{state}
</if>
</select>
<select id="selectInviteUser" resultType="Map">
select u.user_id as userId,u.user_name as userName,u.avatar as avatar,i.create_time as createTime,ifnull(i.money,0.00) as money,i.user_type as userType
from invite i
left join tb_user u on u.user_id=i.invitee_user_id
where i.user_id=#{userId}
<if test="state!=null">
and i.state=#{state}
</if>
<if test="userType!=null">
and i.user_type=#{userType}
</if>
and u.user_id is not null
</select>
<select id="sumInviteMoney" resultType="Double">
select sum(money) from invite where state=1
<if test="flag!=null and flag==1">
and date_format(create_time,'%Y-%m-%d')=date_format(#{time},'%Y-%m-%d')
</if>
<if test="flag!=null and flag==2">
and date_format(create_time,'%Y-%m')=date_format(#{time},'%Y-%m')
</if>
<if test="flag!=null and flag==3">
and date_format(create_time,'%Y')=date_format(#{time},'%Y')
</if>
</select>
<select id="selectInviteCount" resultType="Integer">
select count(*) from invite
where user_id=#{userId}
<if test="state!=null">
and state=#{state}
</if>
</select>
<select id="selectInviteSum" resultType="Double">
select sum(money) from invite
where user_id=#{userId}
<if test="state!=null">
and state=#{state}
</if>
</select>
<select id="selectInviteByUser" resultType="com.sqx.modules.invite.entity.Invite">
select * from invite where user_id=#{userId} and invitee_user_id=#{inviteeUserId}
<if test="userType!=null and userType==1">
and (user_type=1 or user_type is null)
</if>
<if test="userType!=null and userType==2">
and user_type=2
</if>
</select>
<select id="selectInviteByUserIdCount" resultType="Integer">
select count(*) from invite where user_id=#{userId} and date_format(create_time,'%Y-%m-%d') between #{startTime} and #{endTime}
</select>
<select id="selectInviteByUserIdCountNotTime" resultType="Integer">
select count(*) from invite where user_id=#{userId}
</select>
<select id="selectInviteByUserIdSum" resultType="Double">
select sum(money) from invite where user_id=#{userId} and date_format(create_time,'%Y-%m-%d') between #{startTime} and #{endTime}
</select>
<select id="inviteAnalysis" resultType="Map">
select b.*,u.nick_name as nickName from (
SELECT
sum(i.money) as money,
count(*) as `count`,
i.user_id as userId
FROM
invite i where
<if test="flag!=null and flag==1">
date_format(i.create_time,'%Y-%m-%d')=date_format(#{time},'%Y-%m-%d')
</if>
<if test="flag!=null and flag==2">
date_format(i.create_time,'%Y-%m')=date_format(#{time},'%Y-%m')
</if>
<if test="flag!=null and flag==3">
date_format(i.create_time,'%Y')=date_format(#{time},'%Y')
</if>
GROUP BY i.user_id
) b
left join tb_user u on u.user_id=b.userId
</select>
</mapper>

View File

@@ -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.sqx.modules.invite.dao.InviteMoneyDao">
<select id="selectInviteMoneyByUserId" resultType="com.sqx.modules.invite.entity.InviteMoney">
select * from invite_money where user_id=#{userId}
</select>
<update id="updateInviteMoneySum">
update invite_money set money=money+#{money},money_sum=money_sum+#{money} where user_id=#{userId}
</update>
<update id="updateInviteMoneySumSub">
update invite_money set money=money-#{money},money_sum=money_sum-#{money} where user_id=#{userId}
</update>
<update id="updateInviteMoneyCashOut">
update invite_money set
<if test="type==1">
cash_out=cash_out-#{money},money=money+#{money}
</if>
<if test="type==2">
cash_out=cash_out+#{money},money=money-#{money}
</if>
where user_id=#{userId}
</update>
<update id="updateInviteMoneySub">
update invite_money set money=money-#{money} where user_id=#{userId}
</update>
</mapper>

View File

@@ -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.sqx.modules.job.dao.ScheduleJobDao">
<!-- 批量更新状态 -->
<update id="updateBatch">
update schedule_job set status = #{status} where job_id in
<foreach item="jobId" collection="list" open="(" separator="," close=")">
#{jobId}
</foreach>
</update>
</mapper>

View File

@@ -0,0 +1,6 @@
<?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.sqx.modules.job.dao.ScheduleJobLogDao">
</mapper>

View File

@@ -0,0 +1,29 @@
<?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.sqx.modules.message.dao.ActivityMessageInfoDao">
<select id="find" resultType="com.sqx.modules.message.entity.ActivityMessageInfo">
select * from activity_message_info where state=#{state} order by id desc
</select>
<select id="findType" resultType="com.sqx.modules.message.entity.ActivityMessageInfo">
select * from activity_message_info where type=#{type} order by id desc
</select>
<select id="findTypeByUserId" resultType="com.sqx.modules.message.entity.ActivityMessageInfo">
select * from activity_message_info where state=#{state} and user_id=#{userId} order by id desc
</select>
<update id="updateState">
update activity_message_info s set s.state=#{state} where s.id=#{id}
</update>
<update id="updateSendState">
update activity_message_info s set s.send_state=#{state} where s.id=#{id}
</update>
</mapper>

View File

@@ -0,0 +1,12 @@
<?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.sqx.modules.message.dao.MessageInfoDao">
<update id="updateSendState">
update message_info s set s.is_see=2 where s.user_id=#{userId} and s.state=#{state} and s.is_see=0
</update>
</mapper>

View File

@@ -0,0 +1,281 @@
<?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.sqx.modules.orders.dao.OrdersDao">
<select id="selectMaxCode" resultType="String">
select max(orders_no) code from orders where orders_no like #{newData}
</select>
<insert id="insertOrders" useGeneratedKeys="true" keyProperty="ordersId" parameterType="com.sqx.modules.orders.entity.Orders">
INSERT INTO orders
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="null != ordersId and '' != ordersId">
orders_id,
</if>
<if test="null != ordersNo and '' != ordersNo">
orders_no,
</if>
<if test="null != tradeNo and '' != tradeNo">
trade_no,
</if>
<if test="null != userId and '' != userId">
user_id,
</if>
<if test="null != courseId and '' != courseId">
course_id,
</if>
<if test="null != payMoney and '' != payMoney">
pay_money,
</if>
<if test="null != payWay and '' != payWay">
pay_way,
</if>
<if test="null != status">
status,
</if>
<if test="null != createTime and '' != createTime">
create_time,
</if>
<if test="null != refundContent and '' != refundContent">
refund_content,
</if>
<if test="null != ordersType and '' != ordersType">
orders_type,
</if>
<if test="null != courseDetailsId ">
course_details_id,
</if>
<if test="null != vipNameType">
vip_name_type
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="null != ordersId and '' != ordersId">
#{ordersId},
</if>
<if test="null != ordersNo and '' != ordersNo">
#{ordersNo},
</if>
<if test="null != tradeNo and '' != tradeNo">
#{tradeNo},
</if>
<if test="null != userId and '' != userId">
#{userId},
</if>
<if test="null != courseId and '' != courseId">
#{courseId},
</if>
<if test="null != payMoney and '' != payMoney">
#{payMoney},
</if>
<if test="null != payWay and '' != payWay">
#{payWay},
</if>
<if test="null != status">
#{status},
</if>
<if test="null != createTime and '' != createTime">
#{createTime},
</if>
<if test="null != refundContent and '' != refundContent">
#{refundContent},
</if>
<if test="null != ordersType and '' != ordersType">
#{ordersType},
</if>
<if test="null != courseDetailsId ">
#{courseDetailsId},
</if>
<if test="null != vipNameType">
#{vipNameType}
</if>
</trim>
</insert>
<select id="selectOrdersByOrdersNo" resultType="com.sqx.modules.orders.entity.Orders">
select o.*,u.user_name as userName,c.title as title,s.username as sysUserName,s.qd_code as qdCode from orders o
left join tb_user u on o.user_id=u.user_id
left join course c on c.course_id=o.course_id
left join sys_user s on s.user_id=o.sys_user_id
where 1=1
<if test="userName!=null and userName!=''">
and u.user_name LIKE CONCAT('%', #{userName}, '%')
</if>
<if test="qdCode!=null and qdCode!=''">
and s.qd_code = #{qdCode}
</if>
<if test="sysUserName!=null and sysUserName!=''">
and s.username LIKE CONCAT('%', #{sysUserName}, '%')
</if>
<if test="ordersNo!=null and ordersNo!=''">
and o.orders_no LIKE CONCAT('%', #{ordersNo}, '%')
</if>
<if test="status!=null and status!=-1">
and o.status=#{status}
</if>
<if test="userId!=null">
and o.user_id=#{userId}
</if>
<if test="ordersType!=null">
and o.orders_type=#{ordersType}
</if>
<if test="courseId!=null">
and o.course_id=#{courseId}
</if>
<if test="sysUserId!=null">
and o.sys_user_id=#{sysUserId}
</if>
<if test="startTime!=null and startTime!='' and endTime!=null and endTime!=''">
and date_format(o.create_time,'%Y-%m-%d') BETWEEN #{startTime} and #{endTime}
</if>
<if test="startTime!=null and startTime!='' and (endTime==null or endTime=='')">
and date_format(o.create_time,'%Y-%m-%d') &gt;= #{startTime}
</if>
<if test="endTime!=null and endTime!='' and (startTime==null or startTime=='')">
and date_format(o.create_time,'%Y-%m-%d') &lt;= #{endTime}
</if>
order by o.create_time desc
</select>
<delete id="deleteOrders" parameterType="String">
DELETE FROM orders WHERE orders_id IN
<foreach collection="array" item="ids" open="(" separator="," close=")">
#{ids}
</foreach>
</delete>
<select id="statisticsIncomeMoney" resultType="Double">
select sum(pay_money) from orders where status=1
<if test="ordersType!=null">
and orders_type=#{ordersType}
</if>
<if test="flag!=null and flag==1">
and date_format(create_time,'%Y-%m-%d')=date_format(#{time},'%Y-%m-%d')
</if>
<if test="flag!=null and flag==2">
and date_format(create_time,'%Y-%m')=date_format(#{time},'%Y-%m')
</if>
<if test="flag!=null and flag==3">
and date_format(create_time,'%Y')=date_format(#{time},'%Y')
</if>
</select>
<select id="selectOrdersByCourseIdAndUserId" resultType="com.sqx.modules.orders.entity.Orders">
select * from orders where user_id=#{userId} and course_id=#{courseId} and status=1 order by create_time desc limit 1
</select>
<select id="selectOrdersMoneyList" resultType="com.sqx.modules.orders.entity.Orders">
select o.*,c.title from orders o
left join tb_user u on u.user_id=o.user_id
left join course c on o.course_id=c.course_id
where o.status=1
<if test="flag!=null and flag==1">
and date_format(o.create_time,'%Y-%m-%d')=date_format(#{time},'%Y-%m-%d')
</if>
<if test="flag!=null and flag==2">
and date_format(o.create_time,'%Y-%m')=date_format(#{time},'%Y-%m')
</if>
<if test="flag!=null and flag==3">
and date_format(o.create_time,'%Y')=date_format(#{time},'%Y')
</if>
</select>
<select id="selectOrdersCount" resultType="Integer">
select count(*) from orders where 1=1
<if test="sysUserId!=null">
and sys_user_id=#{sysUserId}
</if>
<if test="status!=null">
and status=#{status}
</if>
<if test="ordersType!=null">
and orders_type=#{ordersType}
</if>
<if test="flag!=null and flag==1">
and date_format(create_time,'%Y-%m-%d')=date_format(#{time},'%Y-%m-%d')
</if>
<if test="flag!=null and flag==2">
and date_format(create_time,'%Y-%m')=date_format(#{time},'%Y-%m')
</if>
<if test="flag!=null and flag==3">
and date_format(create_time,'%Y')=date_format(#{time},'%Y')
</if>
</select>
<select id="selectOrdersMoney" resultType="Double">
select ifnull(sum(pay_money),0.00) from orders where 1=1
<if test="sysUserId!=null">
and sys_user_id=#{sysUserId}
</if>
<if test="status!=null">
and status=#{status}
</if>
<if test="courseId!=null">
and course_id=#{courseId}
</if>
<if test="ordersType!=null">
and orders_type=#{ordersType}
</if>
<if test="flag!=null and flag==1">
and date_format(create_time,'%Y-%m-%d')=date_format(#{time},'%Y-%m-%d')
</if>
<if test="flag!=null and flag==2">
and date_format(create_time,'%Y-%m')=date_format(#{time},'%Y-%m')
</if>
<if test="flag!=null and flag==3">
and date_format(create_time,'%Y')=date_format(#{time},'%Y')
</if>
</select>
<select id="selectFenXiaoMoney" resultType="Double">
select
<if test="type==1">
ifnull(sum(one_money),0.00)
</if>
<if test="type==2">
ifnull(sum(two_money),0.00)
</if>
<if test="type==3">
ifnull(sum(qd_money),0.00)
</if>
<if test="type==4">
ifnull(sum(one_money),0.00)+ifnull(sum(two_money),0.00)+ifnull(sum(qd_money),0.00)
</if>
from orders
where status=1
<if test="sysUserId!=null">
and sys_user_id=#{sysUserId}
</if>
<if test="flag!=null and flag==1">
and date_format(create_time,'%Y-%m-%d')=date_format(#{time},'%Y-%m-%d')
</if>
<if test="flag!=null and flag==2">
and date_format(create_time,'%Y-%m')=date_format(#{time},'%Y-%m')
</if>
<if test="flag!=null and flag==3">
and date_format(create_time,'%Y')=date_format(#{time},'%Y')
</if>
</select>
<select id="selectOrdersCountStatisticsByYear" resultType="Integer">
select count(*) from orders
where 1=1
<if test="status!=null and status!=0">
and status=#{status}
</if>
<if test="flag!=null and flag==1">
and date_format(create_time,'%Y-%m-%d')=date_format(#{time},'%Y-%m-%d')
</if>
<if test="flag!=null and flag==2">
and date_format(create_time,'%Y-%m')=date_format(#{time},'%Y-%m')
</if>
<if test="flag!=null and flag==3">
and date_format(create_time,'%Y')=date_format(#{time},'%Y')
</if>
</select>
</mapper>

View File

@@ -0,0 +1,7 @@
<?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.sqx.modules.oss.dao.SysOssDao">
</mapper>

View File

@@ -0,0 +1,168 @@
<?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.sqx.modules.pay.dao.CashOutDao">
<select id="selectCashOutLimit3" resultType="com.sqx.modules.pay.entity.CashOut">
select * from cash_out where state=1 order by out_at desc limit 3
</select>
<select id="selectCashOutSum" resultType="Double">
select sum(money) from cash_out where state in (0,1) and user_id=#{userId} and date_format(create_at,'%Y-%m-%d') between #{startTime} and #{endTime}
</select>
<select id="sumMoney" resultType="Double">
select sum(money) from cash_out where state =1
<if test="flag!=null and flag==1">
and date_format(create_at,'%Y-%m-%d')=date_format(#{time},'%Y-%m-%d')
</if>
<if test="flag!=null and flag==2">
and date_format(create_at,'%Y-%m')=date_format(#{time},'%Y-%m')
</if>
<if test="flag!=null and flag==3">
and date_format(create_at,'%Y')=date_format(#{time},'%Y')
</if>
</select>
<select id="countMoney" resultType="Integer">
select count(*) from cash_out where
<if test="flag!=null and flag==1">
date_format(create_at,'%Y-%m-%d')=date_format(#{time},'%Y-%m-%d')
</if>
<if test="flag!=null and flag==2">
date_format(create_at,'%Y-%m')=date_format(#{time},'%Y-%m')
</if>
<if test="flag!=null and flag==3">
date_format(create_at,'%Y')=date_format(#{time},'%Y')
</if>
</select>
<select id="stayMoney" resultType="Integer">
select count(*) from cash_out where
<if test="flag!=null and flag==1">
date_format(create_at,'%Y-%m-%d')=date_format(#{time},'%Y-%m-%d')
</if>
<if test="flag!=null and flag==2">
date_format(create_at,'%Y-%m')=date_format(#{time},'%Y-%m')
</if>
<if test="flag!=null and flag==3">
date_format(create_at,'%Y')=date_format(#{time},'%Y')
</if>
and state=0
</select>
<select id="selectMayMoney" resultType="Double">
select money from user_money where user_id=#{userId}
</select>
<select id="selectCashOutPage" resultType="com.sqx.modules.pay.entity.CashOut">
SELECT c.*,
ifnull(u.user_name,"用户不存在") as userName,
s.username as sysUserName
FROM cash_out c
left join tb_user u on c.user_id = u.user_id
left join sys_user s on s.user_id= c.sys_user_id
<where>
<if test="cashOut.userName!=null and cashOut.userName!=''">
and u.user_name like concat("%",#{cashOut.userName},"%")
</if>
<if test="cashOut.state!=null">
and c.state = #{cashOut.state}
</if>
<if test="cashOut.userId!=null">
and c.user_id = #{cashOut.userId}
</if>
<if test="cashOut.sysUserId!=null">
and c.sys_user_id = #{cashOut.sysUserId}
</if>
<if test="cashOut.sysUserName!=null and cashOut.sysUserName!=''">
and s.username = #{cashOut.sysUserName}
</if>
<if test="cashOut.userType!=null">
and c.user_type = #{cashOut.userType}
</if>
<if test="cashOut.status!=null and cashOut.status!=-2">
and c.state = #{cashOut.status}
</if>
<if test="cashOut.zhifubao!=null and cashOut.zhifubao!=''">
and c.zhifubao like concat("%",#{cashOut.zhifubao},"%")
</if>
<if test="cashOut.zhifubaoName!=null and cashOut.zhifubaoName!=''">
and c.zhifubao_name like concat("%",#{cashOut.zhifubaoName},"%")
</if>
<if test="cashOut.startTime!=null and cashOut.startTime!='' and (cashOut.endTime!=null and cashOut.endTime!='')">
and date_format(c.create_at,'%Y-%m-%d') BETWEEN #{cashOut.startTime} and #{cashOut.endTime}
</if>
<if test="cashOut.startTime!=null and cashOut.startTime!='' and (cashOut.endTime==null or cashOut.endTime=='')">
and date_format(c.create_at,'%Y-%m-%d') &gt;= #{cashOut.startTime}
</if>
<if test="cashOut.endTime!=null and cashOut.endTime!='' and (cashOut.startTime==null or cashOut.startTime=='')">
and date_format(c.create_at,'%Y-%m-%d') &lt;= #{cashOut.endTime}
</if>
</where>
order by c.create_at desc
</select>
<select id="selectCashOutList" resultType="com.sqx.modules.pay.entity.CashOut">
SELECT c.*,
ifnull(u.user_name,"用户不存在") as userName,
s.username as sysUserName
FROM cash_out c
left join tb_user u on c.user_id = u.user_id
left join sys_user s on s.user_id= c.sys_user_id
<where>
<if test="cashOut.userName!=null and cashOut.userName!=''">
and u.user_name like concat("%",#{cashOut.userName},"%")
</if>
<if test="cashOut.state!=null">
and c.state = #{cashOut.state}
</if>
<if test="cashOut.userId!=null">
and c.user_id = #{cashOut.userId}
</if>
<if test="cashOut.sysUserId!=null">
and c.sys_user_id = #{cashOut.sysUserId}
</if>
<if test="cashOut.userType!=null">
and c.user_type = #{cashOut.userType}
</if>
<if test="cashOut.status!=null and cashOut.status!=-2">
and c.state = #{cashOut.status}
</if>
<if test="cashOut.zhifubao!=null and cashOut.zhifubao!=''">
and c.zhifubao like concat("%",#{cashOut.zhifubao},"%")
</if>
<if test="cashOut.zhifubaoName!=null and cashOut.zhifubaoName!=''">
and c.zhifubao_name like concat("%",#{cashOut.zhifubaoName},"%")
</if>
<if test="cashOut.startTime!=null and cashOut.startTime!='' and (cashOut.endTime!=null and cashOut.endTime!='')">
and date_format(c.create_at,'%Y-%m-%d') BETWEEN #{cashOut.startTime} and #{cashOut.endTime}
</if>
<if test="cashOut.startTime!=null and cashOut.startTime!='' and (cashOut.endTime==null or cashOut.endTime=='')">
and date_format(c.create_at,'%Y-%m-%d') &gt;= #{cashOut.startTime}
</if>
<if test="cashOut.endTime!=null and cashOut.endTime!='' and (cashOut.startTime==null or cashOut.startTime=='')">
and date_format(c.create_at,'%Y-%m-%d') &lt;= #{cashOut.endTime}
</if>
</where>
order by c.create_at desc
</select>
<update id="updateMayMoney">
update user_money set
<if test="type==1">
money=money+#{money}
</if>
<if test="type==2">
money=money-#{money}
</if>
where user_id=#{userId}
</update>
</mapper>

View File

@@ -0,0 +1,177 @@
<?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.sqx.modules.pay.dao.PayDetailsDao">
<select id="selectById" resultType="com.sqx.modules.pay.entity.PayDetails">
select * from pay_details d where d.id=#{id}
</select>
<select id="selectByRemark" resultType="com.sqx.modules.pay.entity.PayDetails">
select * from pay_details d where d.remark=#{remark}
</select>
<select id="selectByOrderId" resultType="com.sqx.modules.pay.entity.PayDetails">
select * from pay_details d where d.order_id=#{orderId}
</select>
<update id="updateState">
update pay_details set `state`=#{state},pay_time=#{time},trade_no=#{tradeNo} where id=#{id}
</update>
<select id=" selectPayDetails" resultType="Map">
select s.id,s.classify,s.order_id as orderId,s.money,s.user_id as userId,
s.state,s.create_time as createTime,s.pay_time as payTime,u.user_name as userName,u.phone
from pay_details s
left join tb_user u on u.user_id=s.user_id
where 1=1
<if test="startTime!=null and startTime!=''and endTime!=null and endTime!='' ">
and str_to_date(s.create_time, '%Y-%m-%d') between str_to_date(#{startTime}, '%Y-%m-%d') AND str_to_date(#{endTime}, '%Y-%m-%d')
</if>
<if test="userId!=null">
and u.user_id=#{userId}
</if>
<if test="state!=null and state!=-1">
and s.state=#{state}
</if>
<if test="state==null or state==-1">
and s.state!=-1
</if>
group by s.id
order by s.create_time desc
</select>
<select id="selectPayDetails" resultType="Map">
select s.id,s.classify,s.order_id as orderId,s.money,s.user_id as userId,s.pay_diamond as payDiamond,s.diamond,
s.state,s.create_time as createTime,s.pay_time as payTime,u.user_name as userName,u.phone
from pay_details s
left join tb_user u on u.user_id=s.user_id
where 1=1
<if test="startTime!=null and startTime!=''and endTime!=null and endTime!='' ">
and str_to_date(s.create_time, '%Y-%m-%d') between str_to_date(#{startTime}, '%Y-%m-%d') AND
str_to_date(#{endTime}, '%Y-%m-%d')
</if>
<if test="userName!=null and userName!=''">
and u.user_name like concat("%",#{userName},"%")
</if>
<if test="orderId!=null and orderId!=''">
and s.order_id like concat("%",#{orderId},"%")
</if>
<if test="userId!=null">
and u.user_id=#{userId}
</if>
<if test="state!=null and state!=-1">
and s.state=#{state}
</if>
<if test="state==null or state==-1">
and s.state!=-1
</if>
group by s.id
order by s.create_time desc
</select>
<select id="selectSumPay" resultType="Double">
select sum(money) from pay_details
where str_to_date(create_time, '%Y-%m-%d') BETWEEN str_to_date(#{createTime}, '%Y-%m-%d') AND str_to_date(#{endTime}, '%Y-%m-%d')
<if test="userId!=null">
and user_id=#{userId}
</if>
and state=1
</select>
<select id="selectSumMember" resultType="Double">
select sum(money) from pay_details where state=1 and `type`=2
<if test="flag!=null and flag==1">
and date_format(create_time,'%Y-%m-%d')=date_format(#{time},'%Y-%m-%d')
</if>
<if test="flag!=null and flag==2">
and date_format(create_time,'%Y-%m')=date_format(#{time},'%Y-%m')
</if>
<if test="flag!=null and flag==3">
and date_format(create_time,'%Y')=date_format(#{time},'%Y')
</if>
</select>
<select id="selectSumPayByState" resultType="Double">
select sum(money) from pay_details where 1=1
<if test="state!=null">
and state=#{state}
</if>
<if test="flag!=null and flag==1">
and date_format(create_time,'%Y-%m-%d')=date_format(#{time},'%Y-%m-%d')
</if>
<if test="flag!=null and flag==2">
and date_format(create_time,'%Y-%m')=date_format(#{time},'%Y-%m')
</if>
<if test="flag!=null and flag==3">
and date_format(create_time,'%Y')=date_format(#{time},'%Y')
</if>
</select>
<select id="selectSumPayByClassify" resultType="Double">
select sum(money) from pay_details where 1=1
<if test="classify!=null">
and classify=#{classify}
</if>
<if test="flag!=null and flag==1">
and date_format(create_time,'%Y-%m-%d')=date_format(#{time},'%Y-%m-%d')
</if>
<if test="flag!=null and flag==2">
and date_format(create_time,'%Y-%m')=date_format(#{time},'%Y-%m')
</if>
<if test="flag!=null and flag==3">
and date_format(create_time,'%Y')=date_format(#{time},'%Y')
</if>
<if test="payClassify!=null and payClassify!=0">
and pay_classify=#{payClassify}
</if>
and state=1
</select>
<select id="payMemberAnalysis" resultType="Map">
SELECT
d.classify,d.money,d.pay_time as payTime,d.remark,d.user_id as userId,u.user_name as nickName
FROM
`pay_details` d
left join tb_user u on u.user_id=d.user_id
WHERE
d.type = 2
AND d.state =1
<if test="flag!=null and flag==1">
and date_format(d.create_time,'%Y-%m-%d')=date_format(#{time},'%Y-%m-%d')
</if>
<if test="flag!=null and flag==2">
and date_format(d.create_time,'%Y-%m')=date_format(#{time},'%Y-%m')
</if>
<if test="flag!=null and flag==3">
and date_format(d.create_time,'%Y')=date_format(#{time},'%Y')
</if>
order by d.pay_time desc
</select>
<select id="instantselectSumPay" resultType="Double">
select sum(money) from pay_details where 1=1
and date_format(create_time,'%Y-%m')=date_format(#{date},'%Y-%m')
and state=1 and user_id=#{userId}
</select>
<select id="selectUserMemberList" resultType="Map">
select s.classify,s.money,s.remark,u.nick_name as nickName,u.user_id as userId,u.member from pay_details s
left join tb_user u on s.user_id=u.user_id
where s.state=-1 and s.`type`=2
<if test="phone!=null and phone!=''">
and u.phone=#{phone}
</if>
order by s.create_time desc
</select>
<select id="selectPayCount" resultType="int">
select count(*) from pay_details
where `state`=1 and user_id=#{userId}
</select>
</mapper>

View File

@@ -0,0 +1,80 @@
<?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.sqx.modules.sdk.dao.SdkInfoDao">
<select id="getSdkPage" resultType="com.sqx.modules.sdk.entity.SdkInfo">
SELECT s.*,
u.`user_name` AS nickName,
su.username as sysUserName
FROM sdk_info s
LEFT JOIN tb_user u ON s.user_id = u.user_id
left join sys_user su on su.user_id=s.sys_user_id
where 1=1
<if test="sdkInfo.nickName!=null and sdkInfo.nickName!=''">
and u.user_name like concat("%",#{sdkInfo.nickName},"%")
</if>
<if test="sdkInfo.sdkContent!=null and sdkInfo.sdkContent!=''">
and s.sdk_content like concat("%",#{sdkInfo.sdkContent},"%")
</if>
<if test="sdkInfo.sdkRemarks!=null and sdkInfo.sdkRemarks!=''">
and s.sdk_remarks like concat("%",#{sdkInfo.sdkRemarks},"%")
</if>
<if test="sdkInfo.typeId!=null">
and s.type_id = #{sdkInfo.typeId}
</if>
<if test="sdkInfo.userId!=null">
and s.user_id = #{sdkInfo.userId}
</if>
<if test="sdkInfo.sysUserId!=null">
and s.sys_user_id = #{sdkInfo.sysUserId}
</if>
<if test="sdkInfo.sysUserName!=null and sdkInfo.sysUserName!=''">
and su.username like concat("%",#{sdkInfo.sysUserName},"%")
</if>
<if test="sdkInfo.status!=null">
and s.status = #{sdkInfo.status}
</if>
<if test="sdkInfo.startTime!=null and sdkInfo.startTime!=''">
and date_format(s.create_time,'%Y-%m-%d') >= date_format(#{sdkInfo.startTime},'%Y-%m-%d')
</if>
<if test="sdkInfo.endTime!=null and sdkInfo.endTime!=''">
and date_format(s.create_time,'%Y-%m-%d') &lt;= date_format(#{sdkInfo.endTime},'%Y-%m-%d')
</if>
order by s.create_time desc
</select>
<select id="getSdkList" resultType="com.sqx.modules.sdk.entity.SdkInfo">
SELECT s.*,
u.`user_name` AS nickName
FROM sdk_info s
LEFT JOIN tb_user u ON s.user_id = u.user_id
where 1=1
<if test="sdkInfo.nickName!=null and sdkInfo.nickName!=''">
and u.user_name like concat("%",#{sdkInfo.nickName},"%")
</if>
<if test="sdkInfo.sdkContent!=null and sdkInfo.sdkContent!=''">
and s.sdk_content like concat("%",#{sdkInfo.sdkContent},"%")
</if>
<if test="sdkInfo.sdkRemarks!=null and sdkInfo.sdkRemarks!=''">
and s.sdk_remarks like concat("%",#{sdkInfo.sdkRemarks},"%")
</if>
<if test="sdkInfo.typeId!=null">
and s.type_id = #{sdkInfo.typeId}
</if>
<if test="sdkInfo.userId!=null">
and s.user_id = #{sdkInfo.userId}
</if>
<if test="sdkInfo.status!=null">
and s.status = #{sdkInfo.status}
</if>
<if test="sdkInfo.startTime!=null and sdkInfo.startTime!=''">
and date_format(s.create_time,'%Y-%m-%d') >= date_format(#{sdkInfo.startTime},'%Y-%m-%d')
</if>
<if test="sdkInfo.endTime!=null and sdkInfo.endTime!=''">
and date_format(s.create_time,'%Y-%m-%d') &lt;= date_format(#{sdkInfo.endTime},'%Y-%m-%d')
</if>
order by s.create_time desc
</select>
</mapper>

View File

@@ -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.sqx.modules.search.dao.AppSearchDao">
<select id="selectAppSearchNum" resultType="String">
select search_name AS searchName from search group by search_name order by count(search_name) desc limit 5
</select>
<delete id="deleteAppSearch">
delete from search where user_id=#{userId}
</delete>
</mapper>

View File

@@ -0,0 +1,15 @@
<?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.sqx.modules.sys.dao.SysConfigDao">
<!-- 根据key更新value -->
<update id="updateValueByKey" parameterType="map">
update sys_config set param_value = #{paramValue} where param_key = #{paramKey}
</update>
<!-- 根据key查询value -->
<select id="queryByKey" parameterType="string" resultType="com.sqx.modules.sys.entity.SysConfigEntity">
select * from sys_config where param_key = #{paramKey}
</select>
</mapper>

View File

@@ -0,0 +1,7 @@
<?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.sqx.modules.sys.dao.SysDictDao">
</mapper>

View File

@@ -0,0 +1,6 @@
<?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.sqx.modules.sys.dao.SysLogDao">
</mapper>

View File

@@ -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.sqx.modules.sys.dao.SysMenuDao">
<select id="queryListParentId" resultType="com.sqx.modules.sys.entity.SysMenuEntity">
select * from sys_menu where parent_id = #{parentId} order by order_num asc
</select>
<select id="queryNotButtonList" resultType="com.sqx.modules.sys.entity.SysMenuEntity">
select * from sys_menu where type != 2 order by order_num asc
</select>
</mapper>

View File

@@ -0,0 +1,10 @@
<?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.sqx.modules.sys.dao.SysRoleDao">
<!-- 查询用户创建的角色ID列表 -->
<select id="queryRoleIdList" resultType="long">
select role_id from sys_role where create_user_id = #{createUserId}
</select>
</mapper>

View File

@@ -0,0 +1,17 @@
<?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.sqx.modules.sys.dao.SysRoleMenuDao">
<select id="queryMenuIdList" resultType="long">
select menu_id from sys_role_menu where role_id = #{value}
</select>
<delete id="deleteBatch">
delete from sys_role_menu where role_id in
<foreach item="roleId" collection="array" open="(" separator="," close=")">
#{roleId}
</foreach>
</delete>
</mapper>

View File

@@ -0,0 +1,24 @@
<?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.sqx.modules.sys.dao.SysUserDao">
<!-- 查询用户的所有权限 -->
<select id="queryAllPerms" resultType="string">
select m.perms from sys_user_role ur
LEFT JOIN sys_role_menu rm on ur.role_id = rm.role_id
LEFT JOIN sys_menu m on rm.menu_id = m.menu_id
where ur.user_id = #{userId}
</select>
<!-- 查询用户的所有菜单ID -->
<select id="queryAllMenuId" resultType="long">
select distinct rm.menu_id from sys_user_role ur
LEFT JOIN sys_role_menu rm on ur.role_id = rm.role_id
where ur.user_id = #{userId}
</select>
<select id="queryByUserName" resultType="com.sqx.modules.sys.entity.SysUserEntity">
select * from sys_user where username = #{username}
</select>
</mapper>

View File

@@ -0,0 +1,16 @@
<?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.sqx.modules.sys.dao.SysUserRoleDao">
<delete id="deleteBatch">
delete from sys_user_role where role_id in
<foreach item="roleId" collection="array" open="(" separator="," close=")">
#{roleId}
</foreach>
</delete>
<select id="queryRoleIdList" resultType="long">
select role_id from sys_user_role where user_id = #{value}
</select>
</mapper>

View File

@@ -0,0 +1,9 @@
<?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.sqx.modules.sys.dao.SysUserTokenDao">
<select id="queryByToken" resultType="com.sqx.modules.sys.entity.SysUserTokenEntity">
select * from sys_user_token where token = #{value}
</select>
</mapper>