update xzx_account_info set
overdraft_limit=#{oldOverdrawPrice},
fixed_limit=#{newOverdrawPrice}
where del_flag=0
and user_id in
#{id}
update xzx_account_info set
overdraft_limit=#{newOverdrawPrice},
fixed_limit=#{newOverdrawPrice}
where del_flag=0 and overdraft_limit=#{oldOverdrawPrice}
and user_id in
#{id}
update xzx_account_info set del_flag=0 where del_flag=1
and user_id=#{userId}
and account_name=#{phone}
order by account_id desc limit 1
INSERT INTO xzx_account_info(`account_id`,`account_name`, `user_id`, `pay_password`, `money`, `freeze_money`,
`withdraw_money`, `overdraft_limit`, `lock_time`,`fixed_limit`)
VALUES (#{id}, #{phone}, #{userId}, NULL, '0', '0', '0', #{money}, NULL,#{money})
update xzx_account_info set fixed_limit=#{fixedLimit},overdraft_limit=#{overdraftLimit} where account_id=#{accountId}
select * from xzx_account_info
inner join xzx_user_info on xzx_account_info.user_id=xzx_user_info.user_id
where xzx_account_info.del_flag=0
AND user_id in
#{id}
AND is_prohibit = #{isProhibit}
order by CAST(money AS DECIMAL) desc
update xzx_account_info
set is_prohibit = #{isProhibit}
where account_id = #{accountId}
update xzx_account_info
set money = #{money}
where user_id = #{userId}
select *
from xzx_account_info
where user_id = #{userId} and del_flag = 0
update xzx_account_info
set money = #{money}, overdraft_limit = #{overdraftLimit}
where user_id = #{userId} and del_flag = 0
update xzx_account_info
set del_flag = 1
where account_id = #{accountId}
select * from xzx_account_info where account_id=#{accountId}
SELECT a.user_id "userId",a.money,c.township_id "townId",d.level_3_name "townShipName"
,c.longitude,c.latitude
from xzx_account_info a
inner JOIN xzx_user_info b
on a.user_id=b.user_id
left JOIN xzx_user_address_info c on b.user_id=c.user_id and c.del_flag=0 AND c.flag=1
left join xzx_sys_address_level_info d on c.township_id=d.level_3_id
where a.del_flag=0 and b.del_flag=0
and cast(a.money as DECIMAL(9,2))>0
insert into xzx_score_details (CREATED_TIME, user_id, type, original_score, change_score, current_score)
values (
#{createdTime}, #{userId}, #{type}, #{originalScore}, #{changeScore}, #{currentScore}
)
select * from xzx_account_info where user_id = #{userId}
SELECT
a.account_id id,
a.is_head isHead,
b.nick_name nickname,
b.regist_time registTime,
b.mobile_phone phone
FROM
xzx_account_info a
LEFT JOIN xzx_user_info b on a.user_id = b.user_id
1=1
and (b.nick_name like concat('%',#{record.name},'%')
or b.mobile_phone like concat('%',#{record.phone},'%') )
order by id desc
SELECT
a.account_id id,
b.nick_name nickname,
b.mobile_phone phone,
b.regist_time registTime,
a.is_head isHead,
(select IFNULL(count(1), 0) from xzx_user_head_relate where head_user_id = a.user_id ) cnt,
(select IFNULL(count(1), 0) from xzx_user_head_details where head_user_id = a.user_id ) orderCnt,
(select IFNULL(sum(amount), 0) from xzx_user_head_relate where head_user_id = a.user_id ) amount,
(select IFNULL(sum(score), 0) from xzx_user_head_relate where head_user_id = a.user_id ) score,
a.is_prohibit isProhibit
FROM
xzx_account_info a
LEFT JOIN xzx_user_info b on a.user_id = b.user_id
1=1
and a.is_head = 1
and b.nick_name like concat('%',#{record.name},'%')
and b.mobile_phone like concat('%',#{record.phone},'%')
and a.is_prohibit = #{record.isProhibit}
and b.regist_time >= #{record.reserveTimeStart}
and b.regist_time <= #{record.reserveTimeEnd}
order by id desc
SELECT
a.account_id id,
b.nick_name nickname,
b.mobile_phone phone,
b.regist_time registTime,
(select IFNULL(count(1), 0) from xzx_user_head_relate where head_user_id = a.user_id ) cnt,
(select IFNULL(count(1), 0) from xzx_user_head_details where head_user_id = a.user_id ) orderCnt,
(select IFNULL(sum(amount), 0) from xzx_user_head_relate where head_user_id = a.user_id ) amount,
(select IFNULL(sum(score), 0) from xzx_user_head_relate where head_user_id = a.user_id ) score
FROM
xzx_account_info a
LEFT JOIN xzx_user_info b on a.user_id = b.user_id
where a.account_id = #{id}
SELECT
b.nick_name nickname,
b.mobile_phone phone,
a.CREATED_TIME createTime,
(select IFNULL(count(1), 0) from xzx_user_head_details where user_id = a.user_id and head_user_id = #{id}) orderCnt,
(select IFNULL(sum(amount), 0) from xzx_user_head_details where user_id = a.user_id and head_user_id = #{id}) amount,
(select IFNULL(sum(score), 0) from xzx_user_head_details where user_id = a.user_id and head_user_id = #{id}) score,
(SELECT
IFNULL(SUM(score),0) as kg
FROM
xzx_jhy_order_items WHERE order_id in ( SELECT
id
FROM
xzx_jhy_order WHERE order_no in ( SELECT
order_no
FROM
xzx_user_head_details WHERE
user_id = a.user_id and head_user_id = #{id} ) )) orderScore
FROM
xzx_user_head_relate a
LEFT JOIN xzx_user_info b on a.user_id = b.user_id
where a.head_user_id = #{id}
SELECT
b.id orderId,
a.order_no orderNo,
a.score scoreReward,
a.amount amountReward,
c.nick_name nickname,
c.mobile_phone phone,
(select sum(score) from xzx_jhy_order_items where b.id = order_id) score,
(select sum(score/ 40) from xzx_jhy_order_items where b.id = order_id) amount
FROM
xzx_user_head_details a
LEFT JOIN xzx_jhy_order b ON a.order_no = b.order_no
LEFT JOIN xzx_user_info c on a.user_id = c.user_id
WHERE
a.head_user_id = #{userId}
order by b.CREATED_TIME desc
SELECT
*
FROM
xzx_jhy_order_items a
where a.order_id = #{orderId}
SELECT
a.account_id id,
b.nick_name nickname,
b.mobile_phone phone,
b.regist_time registTime,
a.is_head isHead,
(select IFNULL(count(1), 0) from xzx_user_head_relate where head_user_id = a.user_id) cnt,
(select IFNULL(count(1), 0) from xzx_user_head_details where head_user_id = a.user_id
and CREATED_TIME >= #{record.reserveTimeStart}
and CREATED_TIME <= #{record.reserveTimeEnd}
) orderCnt,
(select IFNULL(sum(amount), 0) from xzx_user_head_relate where head_user_id = a.user_id
and CREATED_TIME >= #{record.reserveTimeStart}
and CREATED_TIME <= #{record.reserveTimeEnd}
) amount,
(select IFNULL(sum(score), 0) from xzx_user_head_relate where head_user_id = a.user_id
and CREATED_TIME >= #{record.reserveTimeStart}
and CREATED_TIME <= #{record.reserveTimeEnd}
) score,
a.is_prohibit isProhibit
FROM
xzx_account_info a
LEFT JOIN xzx_user_info b on a.user_id = b.user_id
1=1
and a.is_head = 1
and (b.nick_name like concat('%',#{record.name},'%') or b.mobile_phone like concat('%',#{record.phone},'%'))
order by id desc
SELECT
IFNULL(SUM(a.weight),0) as kg
FROM
xzx_jhy_order_items a
left join xzx_sys_environmental_info b on a.item_type = b.id
WHERE
b.item_unit = 'kg'
and a.order_id in (
SELECT
id
FROM
xzx_jhy_order
WHERE
order_no in (
SELECT
order_no
FROM
xzx_user_head_details
WHERE
head_user_id = (
SELECT
user_id
FROM
xzx_account_info
WHERE
account_id = #{accountId}
)
)
and CREATED_TIME >= #{record.reserveTimeStart}
and CREATED_TIME <= #{record.reserveTimeEnd}
)
SELECT
IFNULL(SUM(a.weight),0) as jdsl
FROM
xzx_jhy_order_items a
left join xzx_sys_environmental_info b on a.item_type = b.id
WHERE
b.item_unit = '台' and
a.order_id in (
SELECT
id
FROM
xzx_jhy_order
WHERE order_no in (
SELECT
order_no
FROM
xzx_user_head_details
WHERE
head_user_id = (
SELECT
user_id
FROM
xzx_account_info
WHERE
account_id = #{accountId}
)
)
and CREATED_TIME >= #{record.reserveTimeStart}
and CREATED_TIME <= #{record.reserveTimeEnd}
)
SELECT
IFNULL(count(1), 0) cnt,
SUM((select IFNULL(count(1), 0) from xzx_user_head_details where head_user_id = a.user_id) ) orderCnt,
SUM((select IFNULL(sum(amount), 0) from xzx_user_head_details where head_user_id = a.user_id) ) amount,
SUM((select IFNULL(sum(score), 0) from xzx_user_head_details where head_user_id = a.user_id) ) score
FROM
xzx_account_info a
where
1=1
and a.is_head = 1
SELECT
a.account_id id,
b.nick_name nickname,
b.mobile_phone phone,
b.regist_time registTime,
a.is_head isHead,
(select IFNULL(count(1), 0) from xzx_user_head_relate where head_user_id = a.user_id) cnt,
(select IFNULL(count(1), 0) from xzx_user_head_details where head_user_id = a.user_id
and CREATED_TIME >= #{record.reserveTimeStart}
and CREATED_TIME <= #{record.reserveTimeEnd}
) orderCnt,
(select IFNULL(sum(amount), 0) from xzx_user_head_relate where head_user_id = a.user_id
and CREATED_TIME >= #{record.reserveTimeStart}
and CREATED_TIME <= #{record.reserveTimeEnd}
) amount,
(select IFNULL(sum(score), 0) from xzx_user_head_relate where head_user_id = a.user_id
and CREATED_TIME >= #{record.reserveTimeStart}
and CREATED_TIME <= #{record.reserveTimeEnd}
) score,
a.is_prohibit isProhibit
FROM
xzx_account_info a
LEFT JOIN xzx_user_info b on a.user_id = b.user_id
1=1
and a.is_head = 1
and (b.nick_name like concat('%',#{record.name},'%') or b.mobile_phone like concat('%',#{record.phone},'%'))
order by id desc
SELECT
IFNULL(SUM(a.weight),0) as kg
FROM
xzx_jhy_order_items a
left join xzx_sys_environmental_info b on a.item_type = b.id
WHERE
b.item_unit = 'kg'
and a.order_id in (
SELECT
id
FROM
xzx_jhy_order
WHERE
order_no in (
SELECT
order_no
FROM
xzx_user_head_details
WHERE
head_user_id = (
SELECT
user_id
FROM
xzx_account_info
WHERE
account_id = #{accountId}
)
)
and CREATED_TIME >= #{record.reserveTimeStart}
and CREATED_TIME <= #{record.reserveTimeEnd}
)
SELECT
IFNULL(SUM(a.weight),0) as jdsl
FROM
xzx_jhy_order_items a
left join xzx_sys_environmental_info b on a.item_type = b.id
WHERE
b.item_unit = '台' and
a.order_id in (
SELECT
id
FROM
xzx_jhy_order
WHERE order_no in (
SELECT
order_no
FROM
xzx_user_head_details
WHERE
head_user_id = (
SELECT
user_id
FROM
xzx_account_info
WHERE
account_id = #{accountId}
)
)
and CREATED_TIME >= #{record.reserveTimeStart}
and CREATED_TIME <= #{record.reserveTimeEnd}
)
select * from xzx_account_info
where account_id in
#{id}
select a.* from xzx_account_info a, xzx_user_info b
where a.user_id=b.user_id and b.mobile_phone=#{phone}