| | |
| | | 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> |
| | | |
| | | |
| | |
| | | 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, |
| | | (select IFNULL(count(1), 0) from xzx_user_head_details where head_user_id = a.user_id |
| | | <if test="record.reserveTimeStart != null"> |
| | | and CREATED_TIME >= #{record.reserveTimeStart} |
| | | </if> |
| | | |
| | | <if test="record.reserveTimeEnd != null"> |
| | | and CREATED_TIME <= #{record.reserveTimeEnd} |
| | | </if> |
| | | ) orderCnt, |
| | | (select IFNULL(sum(amount), 0) from xzx_user_head_relate where head_user_id = a.user_id |
| | | <if test="record.reserveTimeStart != null"> |
| | | and CREATED_TIME >= #{record.reserveTimeStart} |
| | | </if> |
| | | |
| | | <if test="record.reserveTimeEnd != null"> |
| | | and CREATED_TIME <= #{record.reserveTimeEnd} |
| | | </if> |
| | | ) amount, |
| | | (select IFNULL(sum(score), 0) from xzx_user_head_relate where head_user_id = a.user_id |
| | | <if test="record.reserveTimeStart != null"> |
| | | and CREATED_TIME >= #{record.reserveTimeStart} |
| | | </if> |
| | | |
| | | <if test="record.reserveTimeEnd != null"> |
| | | and CREATED_TIME <= #{record.reserveTimeEnd} |
| | | </if> |
| | | ) score, |
| | | a.is_prohibit isProhibit |
| | | FROM |
| | | xzx_account_info a |
| | |
| | | and a.is_head = 1 |
| | | <if test="record.queryCol != null and record.queryCol != ''"> |
| | | and (b.nick_name like concat('%',#{record.name},'%') or b.mobile_phone like concat('%',#{record.phone},'%')) |
| | | </if> |
| | | <if test="record.reserveTimeStart != null"> |
| | | and b.regist_time >= #{record.reserveTimeStart} |
| | | </if> |
| | | |
| | | <if test="record.reserveTimeEnd != null"> |
| | | and b.regist_time <= #{record.reserveTimeEnd} |
| | | </if> |
| | | </where> |
| | | order by id desc |
| | |
| | | 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 ( |
| | | b.item_unit = 'kg' |
| | | and a.order_id in ( |
| | | SELECT |
| | | id |
| | | FROM |
| | |
| | | account_id = #{accountId} |
| | | ) |
| | | ) |
| | | <if test="record!= null"> |
| | | <if test="record.reserveTimeStart != null"> |
| | | and CREATED_TIME >= #{record.reserveTimeStart} |
| | | </if> |
| | | |
| | | <if test="record.reserveTimeEnd != null"> |
| | | and CREATED_TIME <= #{record.reserveTimeEnd} |
| | | </if> |
| | | </if> |
| | | ) |
| | | </select> |
| | | |
| | |
| | | id |
| | | FROM |
| | | xzx_jhy_order |
| | | WHERE |
| | | order_no in ( |
| | | WHERE order_no in ( |
| | | SELECT |
| | | order_no |
| | | FROM |
| | |
| | | account_id = #{accountId} |
| | | ) |
| | | ) |
| | | |
| | | <if test="record!= null"> |
| | | <if test="record.reserveTimeStart != null"> |
| | | and CREATED_TIME >= #{record.reserveTimeStart} |
| | | </if> |
| | | |
| | | <if test="record.reserveTimeEnd != null"> |
| | | and CREATED_TIME <= #{record.reserveTimeEnd} |
| | | </if> |
| | | </if> |
| | | ) |
| | | </select> |
| | | |
| | |
| | | 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, |
| | | (select IFNULL(count(1), 0) from xzx_user_head_details where head_user_id = a.user_id |
| | | <if test="record.reserveTimeStart != null"> |
| | | and CREATED_TIME >= #{record.reserveTimeStart} |
| | | </if> |
| | | |
| | | <if test="record.reserveTimeEnd != null"> |
| | | and CREATED_TIME <= #{record.reserveTimeEnd} |
| | | </if>) orderCnt, |
| | | (select IFNULL(sum(amount), 0) from xzx_user_head_relate where head_user_id = a.user_id |
| | | <if test="record.reserveTimeStart != null"> |
| | | and CREATED_TIME >= #{record.reserveTimeStart} |
| | | </if> |
| | | |
| | | <if test="record.reserveTimeEnd != null"> |
| | | and CREATED_TIME <= #{record.reserveTimeEnd} |
| | | </if>) amount, |
| | | (select IFNULL(sum(score), 0) from xzx_user_head_relate where head_user_id = a.user_id |
| | | <if test="record.reserveTimeStart != null"> |
| | | and CREATED_TIME >= #{record.reserveTimeStart} |
| | | </if> |
| | | |
| | | <if test="record.reserveTimeEnd != null"> |
| | | and CREATED_TIME <= #{record.reserveTimeEnd} |
| | | </if>) score, |
| | | a.is_prohibit isProhibit |
| | | FROM |
| | | xzx_account_info a |
| | |
| | | <if test="record.queryCol != null and record.queryCol != ''"> |
| | | and (b.nick_name like concat('%',#{record.name},'%') or b.mobile_phone like concat('%',#{record.phone},'%')) |
| | | </if> |
| | | <if test="record.reserveTimeStart != null"> |
| | | and b.regist_time >= #{record.reserveTimeStart} |
| | | </if> |
| | | |
| | | <if test="record.reserveTimeEnd != null"> |
| | | and b.regist_time <= #{record.reserveTimeEnd} |
| | | </if> |
| | | </where> |
| | | order by id desc |
| | | </select> |
| | | |
| | | <select id="selectOrderExportByHeadUserId" resultType="java.lang.String"> |
| | | 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} |
| | | ) |
| | | ) |
| | | <if test="record!= null"> |
| | | <if test="record.reserveTimeStart != null"> |
| | | and CREATED_TIME >= #{record.reserveTimeStart} |
| | | </if> |
| | | |
| | | <if test="record.reserveTimeEnd != null"> |
| | | and CREATED_TIME <= #{record.reserveTimeEnd} |
| | | </if> |
| | | </if> |
| | | ) |
| | | </select> |
| | | |
| | | <select id="selectJDSLExportByHeadUserId" resultType="java.lang.String"> |
| | | 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} |
| | | ) |
| | | ) |
| | | |
| | | <if test="record!= null"> |
| | | <if test="record.reserveTimeStart != null"> |
| | | and CREATED_TIME >= #{record.reserveTimeStart} |
| | | </if> |
| | | |
| | | <if test="record.reserveTimeEnd != null"> |
| | | and CREATED_TIME <= #{record.reserveTimeEnd} |
| | | </if> |
| | | </if> |
| | | ) |
| | | </select> |
| | | |
| | | </mapper> |