|
|
@@ -45,10 +45,18 @@
|
|
|
|
|
|
|
|
|
<select id="queryRider" resultType="com.sqx.modules.app.entity.queryRiderVo">
|
|
|
- select u.user_id,u.clientid,u.open_id,u.rider_open_id,u.user_name,u.phone,u.cash_deposit,u.check_certification,r.station_name
|
|
|
+ select u.user_id,
|
|
|
+ u.clientid,
|
|
|
+ u.open_id,
|
|
|
+ u.rider_open_id,
|
|
|
+ u.user_name,
|
|
|
+ u.phone,
|
|
|
+ u.cash_deposit,
|
|
|
+ u.check_certification,
|
|
|
+ r.station_name
|
|
|
from tb_user u
|
|
|
- left join rider_station r on r.id = u.rider_station_id
|
|
|
- where u.user_id = #{userId}
|
|
|
+ left join rider_station r on r.id = u.rider_station_id
|
|
|
+ where u.user_id = #{userId}
|
|
|
</select>
|
|
|
|
|
|
<select id="queryRiders" resultType="com.sqx.modules.app.entity.queryRidersVo">
|
|
|
@@ -64,9 +72,10 @@
|
|
|
|
|
|
|
|
|
<select id="queryInviterCount" resultType="int">
|
|
|
- select count(*) from tb_user
|
|
|
- where inviter_code=#{inviterCode}
|
|
|
- </select>
|
|
|
+ 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">
|
|
|
@@ -326,8 +335,8 @@
|
|
|
</select>
|
|
|
|
|
|
<update id="updateCashDeposit">
|
|
|
- update tb_user set
|
|
|
- cash_deposit = cash_deposit+#{cashDeposit}
|
|
|
+ update tb_user
|
|
|
+ set cash_deposit = cash_deposit + #{cashDeposit}
|
|
|
where user_id = #{userId}
|
|
|
</update>
|
|
|
|
|
|
@@ -353,9 +362,17 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="findUserMessage" resultType="com.sqx.modules.app.entity.UserEntity">
|
|
|
- select tu.*, um.birthday as birthday, um.height as height, um.weight as weight, um.occupation as occupation, um.individual_resume as individualResume,
|
|
|
- um.picture_list as pictureList, um.sex as umSex
|
|
|
- from tb_user tu left join user_message um on tu.user_id = um.user_id where tu.user_id = #{userId}
|
|
|
+ select tu.*,
|
|
|
+ um.birthday as birthday,
|
|
|
+ um.height as height,
|
|
|
+ um.weight as weight,
|
|
|
+ um.occupation as occupation,
|
|
|
+ um.individual_resume as individualResume,
|
|
|
+ um.picture_list as pictureList,
|
|
|
+ um.sex as umSex
|
|
|
+ from tb_user tu
|
|
|
+ left join user_message um on tu.user_id = um.user_id
|
|
|
+ where tu.user_id = #{userId}
|
|
|
</select>
|
|
|
|
|
|
<select id="selectUser" resultType="com.sqx.modules.app.entity.UserEntity">
|
|
|
@@ -371,8 +388,8 @@
|
|
|
<select id="selectUserById" resultType="com.sqx.modules.app.entity.UserEntity">
|
|
|
select tu.*, um.money as money, ui.integral_num as integralNum
|
|
|
from tb_user tu
|
|
|
- left join user_money um on tu.user_id = um.user_id
|
|
|
- left join user_integral ui on tu.user_id = ui.user_id
|
|
|
+ left join user_money um on tu.user_id = um.user_id
|
|
|
+ left join user_integral ui on tu.user_id = ui.user_id
|
|
|
where tu.user_id = #{userId}
|
|
|
</select>
|
|
|
|
|
|
@@ -382,54 +399,87 @@
|
|
|
</insert>
|
|
|
|
|
|
<update id="certification">
|
|
|
- update tb_user set user_name = #{userName}, audit_time = #{format}, identity_card_number = #{identityCardNumber}, identity_card_front = #{identityCardFront},
|
|
|
- identity_card_verso = #{identityCardVerso}, self_identity_card = #{selfIdentityCard}, check_certification = "0", cash_deposit=#{cashDeposit}, check_number=#{checkNumber} where user_id = #{userId}
|
|
|
+ update tb_user
|
|
|
+ set user_name = #{userName},
|
|
|
+ audit_time = #{format},
|
|
|
+ identity_card_number = #{identityCardNumber},
|
|
|
+ identity_card_front = #{identityCardFront},
|
|
|
+ identity_card_verso = #{identityCardVerso},
|
|
|
+ self_identity_card = #{selfIdentityCard},
|
|
|
+ check_certification = "0",
|
|
|
+ cash_deposit=#{cashDeposit},
|
|
|
+ check_number=#{checkNumber}
|
|
|
+ where user_id = #{userId}
|
|
|
</update>
|
|
|
|
|
|
<insert id="userFeedback">
|
|
|
insert into sys_feedback (feedback_type, user_id, user_email, feedback_score, feedback_message, feedback_time)
|
|
|
- values
|
|
|
- (#{feedbackType}, #{userId}, #{userEmail}, #{feedbackScore}, #{feedbackMessage}, #{format})
|
|
|
+ values (#{feedbackType}, #{userId}, #{userEmail}, #{feedbackScore}, #{feedbackMessage}, #{format})
|
|
|
</insert>
|
|
|
|
|
|
<insert id="addRedPacket">
|
|
|
- insert into errand_user_red_packet (user_id, red_packet_type, minimum_amount, red_packet_amount, red_packet_title, expiration_time, delete_flag, create_time)
|
|
|
- values (#{userId}, #{redPacketType}, #{minimumAmount}, #{redPacketAmount}, #{redPacketTitle}, #{expirationTime}, "0", #{createTime})
|
|
|
+ insert into errand_user_red_packet (user_id, red_packet_type, minimum_amount, red_packet_amount,
|
|
|
+ red_packet_title, expiration_time, delete_flag, create_time)
|
|
|
+ values (#{userId}, #{redPacketType}, #{minimumAmount}, #{redPacketAmount}, #{redPacketTitle}, #{expirationTime},
|
|
|
+ "0", #{createTime})
|
|
|
</insert>
|
|
|
|
|
|
<update id="updateOldUser">
|
|
|
- update tb_user set new_user_flag = "2" where user_id = #{userId}
|
|
|
+ update tb_user
|
|
|
+ set new_user_flag = "2"
|
|
|
+ where user_id = #{userId}
|
|
|
</update>
|
|
|
|
|
|
<select id="selectUserMessage" resultType="com.sqx.modules.app.entity.UserEntity">
|
|
|
- select tu.*, gs.status as shopStatus from tb_user tu left join sys_user_shop sus on tu.admin_user_id = sus.user_id
|
|
|
- left join goods_shop gs on sus.shop_id = gs.shop_id
|
|
|
+ select tu.*, gs.status as shopStatus
|
|
|
+ from tb_user tu
|
|
|
+ left join sys_user_shop sus on tu.admin_user_id = sus.user_id
|
|
|
+ left join goods_shop gs on sus.shop_id = gs.shop_id
|
|
|
where tu.user_id = #{userId}
|
|
|
</select>
|
|
|
|
|
|
<select id="selectVipOverdue" resultType="com.sqx.modules.app.entity.UserEntity">
|
|
|
- select * from tb_user where is_vip = 1 and vip_expiration_time < #{date}
|
|
|
+ select *
|
|
|
+ from tb_user
|
|
|
+ where is_vip = 1
|
|
|
+ and vip_expiration_time < #{date}
|
|
|
</select>
|
|
|
|
|
|
<update id="updateUserClientIdIsNull">
|
|
|
- update tb_user set clientid='' where clientid=#{clientid}
|
|
|
+ update tb_user
|
|
|
+ set clientid=''
|
|
|
+ where clientid = #{clientid}
|
|
|
</update>
|
|
|
|
|
|
<update id="updateUserRiderClientIdIsNull">
|
|
|
- update tb_user set rider_clientid='' where rider_clientid=#{clientid}
|
|
|
+ update tb_user
|
|
|
+ set rider_clientid=''
|
|
|
+ where rider_clientid = #{clientid}
|
|
|
</update>
|
|
|
|
|
|
<update id="updateUserShopClientIdIsNull">
|
|
|
- update tb_user set shop_client_id='' where shop_client_id=#{clientid}
|
|
|
+ update tb_user
|
|
|
+ set shop_client_id=''
|
|
|
+ where shop_client_id = #{clientid}
|
|
|
</update>
|
|
|
|
|
|
<select id="selectRiderUserByOnLineFlag" resultType="com.sqx.modules.app.entity.UserEntity">
|
|
|
- select * from (select (st_distance (point (r.lng, r.lat),point(#{lng},#{lat}) ) *111195) as distance,t.*
|
|
|
- from rider_location r
|
|
|
- left join tb_user t on t.user_id=r.user_id
|
|
|
- where t.on_line_flag=1
|
|
|
- ) a where distance<=#{distance}
|
|
|
+ select *
|
|
|
+ from (select (st_distance(point(r.lng, r.lat), point(#{lng}, #{lat})) * 111195) as distance, t.*
|
|
|
+ from rider_location r
|
|
|
+ left join tb_user t on t.user_id = r.user_id
|
|
|
+ where t.on_line_flag = 1) a
|
|
|
+ where distance <= #{distance}
|
|
|
</select>
|
|
|
|
|
|
+ <insert id="batchAddRedPacket" parameterType="java.util.List">
|
|
|
+ insert into errand_user_red_packet (user_id, red_packet_type, minimum_amount, red_packet_amount,
|
|
|
+ red_packet_title, expiration_time, delete_flag, create_time)
|
|
|
+ values
|
|
|
+ <foreach collection="redPacketList" item="item" index="index" separator=",">
|
|
|
+ (#{item.userId}, #{item.redPacketType}, #{item.minimumAmount}, #{item.redPacketAmount},
|
|
|
+ #{item.redPacketTitle}, #{item.expirationTime}, '0', #{item.createTime})
|
|
|
+ </foreach>
|
|
|
+ </insert>
|
|
|
|
|
|
</mapper>
|