SELECT go.jwcode,mi.name,mi.deptName,mi.shopName,go.type,go.order_no,go.price,go.count,gps.`name`,go.success_time from g_order as go
SELECT gps.`name` as payStyle,go.jwcode,mi.name,mi.deptName,mi.shopName,go.type,go.order_no,go.price,go.count,gps.`name`,go.success_time from g_order as go
LEFT JOIN member_info as mi on go.jwcode = mi.jwcode
LEFT JOIN g_pay_style gps on go.pay_style=gps.id
<where>
@ -18,7 +18,7 @@ LEFT JOIN member_info as mi on go.jwcode = mi.jwcode
and go.type = #{type}
</if>
<iftest="payStyle != null and payStyle.length > 0">
and go.pay_style = #{payStyle}
and gps.`name` = #{payStyle}
</if>
<iftest="deptName !=null and deptName.length > 0">
and mi.deptName = #{deptName}
@ -44,6 +44,7 @@ LEFT JOIN member_info as mi on go.jwcode = mi.jwcode
sum(price) as priceTotal,
sum(count) as countTotal
FROM g_order as go
LEFT JOIN g_pay_style gps on go.pay_style=gps.id
<where>
<iftest="jwcode != null">
and go.jwcode = #{jwcode}
@ -55,7 +56,7 @@ LEFT JOIN member_info as mi on go.jwcode = mi.jwcode
and go.type = #{type}
</if>
<iftest="payStyle != null and payStyle.length > 0">
and go.pay_style = #{payStyle}
and gps.`name` = #{payStyle}
</if>
<iftest="deptName !=null and deptName.length > 0">