|
|
|
@ -9,6 +9,7 @@ import org.springframework.test.annotation.Rollback; |
|
|
|
import org.springframework.test.context.junit4.SpringRunner; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
import java.math.BigDecimal; |
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
import java.util.Date; |
|
|
|
import java.util.HashMap; |
|
|
|
@ -97,4 +98,17 @@ public class OrderMapperTest { |
|
|
|
int ret = orderMapper.countOrderByStatus(status); |
|
|
|
System.out.println(ret); |
|
|
|
} |
|
|
|
|
|
|
|
@Test |
|
|
|
public void mapSumTest(){ |
|
|
|
String starttime ="2022-05-18 00:00:00"; |
|
|
|
String endtime="2022-05-18 23:59:59"; |
|
|
|
String swhere ="(paymenttime between "+starttime+" and "+endtime+") " + |
|
|
|
"and pay_status=2"; |
|
|
|
Map xmap =new HashMap(); |
|
|
|
xmap.put("field","total_money"); |
|
|
|
xmap.put("wherestr",swhere); |
|
|
|
BigDecimal bd= orderMapper.sumOrderByMap(xmap); |
|
|
|
System.out.println(bd); |
|
|
|
} |
|
|
|
} |