dev
parent
8dead8a5f4
commit
e4cb4230a5
|
|
@ -739,29 +739,14 @@ public class OrderclusterService extends BaseService {
|
|||
* @return
|
||||
*/
|
||||
public BigDecimal undoPrice(int customer_id) {
|
||||
String sql = "select(\n" +
|
||||
" select sum(t.`total_weight` * t.`unit_price`) `total_price`\n" +
|
||||
" from `ordercluster` t\n" +
|
||||
" where t.`customer_id`= ?\n" +
|
||||
" and t.state < ? ) - (\n" +
|
||||
" select sum(t.`weight` * t.`unit_price`) total_price\n" +
|
||||
" from order_temp t\n" +
|
||||
" where exists(\n" +
|
||||
" select 1 from `ordercluster` o\n" +
|
||||
" where o.`customer_id`= ?\n" +
|
||||
" and o.id= t.`ordercluster_id`\n" +
|
||||
" and o.`state`< ?" +
|
||||
" )\n" +
|
||||
" and t.`customer_id`= ?\n" +
|
||||
" and t.`state`= ?)";
|
||||
String sql = "select sum(t.`total_weight`* t.`unit_price`) `total_price`\n" +
|
||||
" from `ordercluster` t\n" +
|
||||
" where t.`customer_id`= ? \n" +
|
||||
" and t.state< ? ";
|
||||
|
||||
BigDecimal out = Db.queryBigDecimal(
|
||||
sql,
|
||||
customer_id,
|
||||
OrderStateEnum.RECEIVED.getStateid(),
|
||||
customer_id,
|
||||
OrderStateEnum.RECEIVED.getStateid(),
|
||||
customer_id,
|
||||
OrderStateEnum.RECEIVED.getStateid()
|
||||
);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue