| | |
| | | a.order_no orderNo, |
| | | a.score scoreReward, |
| | | a.amount amountReward, |
| | | a.nick_name nickname, |
| | | a.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} |
| | | </select> |
| | |
| | | |
| | | <select id="selectOrderByHeadUserId" resultType="java.lang.String"> |
| | | SELECT |
| | | IFNULL(SUM(weight),0) as kg |
| | | IFNULL(SUM(a.weight),0) as kg |
| | | FROM |
| | | xzx_jhy_order_items |
| | | xzx_jhy_order_items a |
| | | left join xzx_sys_environmental_info b on a.item_type = b.id |
| | | WHERE |
| | | order_id in ( |
| | | b.item_unit = 'kg' and a.order_id in ( |
| | | SELECT |
| | | id |
| | | FROM |