嗨森逛服务
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
hai-server/hai-service/src/main/java/com/hai/dao/HighGasClassGroupTaskMapper...

57 lines
2.7 KiB

3 years ago
package com.hai.dao;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
import java.util.Map;
/**
* mapper扩展类
*/
public interface HighGasClassGroupTaskMapperExt {
@Select("<script>" +
" select " +
" case when SUM(a.total_price) is not null then SUM(a.total_price) else 0 end refuelPrice," +
" COUNT(1) refuelNum," +
" case when SUM(a.gas_liters_preferences) is not null then SUM(a.gas_liters_preferences) else 0 end refuelLiters" +
" from high_child_order a" +
" where goods_type = 3 " +
" and gas_class_group_task_id = #{gasClassGroupTaskId} " +
" and child_orde_status in (2,3)" +
"</script>")
Map<String, Object> countRefuelData(@Param("gasClassGroupTaskId") Long gasClassGroupTaskId);
@Select("<script>" +
" select " +
" case when SUM(a.total_price) is not null then SUM(a.total_price) else 0 end refundPrice," +
" COUNT(1) refundNum," +
" case when SUM(a.gas_liters_preferences) is not null then SUM(a.gas_liters_preferences) else 0 end refundLiters" +
" from high_child_order a" +
" where goods_type = 3 " +
" and gas_class_group_task_id = #{gasClassGroupTaskId} " +
" and child_orde_status in (4)" +
"</script>")
Map<String, Object> countRefundData(@Param("gasClassGroupTaskId") Long gasClassGroupTaskId);
@Select("<script>" +
" SELECT" +
" a.oil_no," +
" case when b.refuelPrice is not null then b.refuelPrice else 0 end refuelPrice," +
" case when b.refuelNum is not null then b.refuelNum else 0 end refuelNum," +
" case when b.refuelLiters is not null then b.refuelLiters else 0 end refuelLiters" +
" FROM" +
" high_gas_oil_price a " +
" LEFT JOIN (select gas_oil_no," +
" case when SUM(a.total_price) is not null then SUM(a.total_price) else 0 end refuelPrice," +
" COUNT(1) refuelNum," +
" case when SUM(a.gas_liters_preferences) is not null then SUM(a.gas_liters_preferences) else 0 end refuelLiters" +
" from high_child_order a" +
" where gas_class_group_task_id = #{gasClassGroupTaskId} and goods_type = 3 and child_orde_status in (2,3)" +
" GROUP BY a.gas_oil_no) b on b.gas_oil_no = a.oil_no" +
3 years ago
" WHERE a.merchant_store_id = #{gasId} and <![CDATA[ `status` <> 0 ]]> " +
3 years ago
"</script>")
List<Map<String, Object>> countOilData(@Param("gasId") Long gasId, @Param("gasClassGroupTaskId") Long gasClassGroupTaskId);
}