xuefei
2020-12-22 4745238280ae22f373802470844c66cbcdbf4458
platform-modules/platform-zhyl/src/main/java/cn/cetc54/platform/zhyl/mapper/OrderMapper.java
@@ -2,13 +2,43 @@
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import cn.cetc54.platform.zhyl.entity.Order;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
import java.util.Map;
/**
 * 订单数据处理层
 * @author 
 */
public interface OrderMapper extends BaseMapper<Order> {
    /**
     * 获取某个区域的服务项目的个数
     * @param areaId
     * @return
     */
    @Select("<script>" +
            "select detail,count(*) as num " +
            "from" +
            "(select detail,person_id " +
            "from t_yl_order " +
            "<where>" +
            " <if test='areaId!= null'>" +
            "and area_id=#{areaId} " +
            " </if>" +
            "</where>" +
            "GROUP BY detail,person_id) t " +
            "GROUP BY detail ORDER BY num desc" +
            "</script>")
    List<Map<String,Object>> getTypeStatics(@Param("areaId") String areaId);
    @Select("<script>" +
            "select count(*) as num " +
            "from t_yl_order o " +
            "left join t_yl_fuwu_person p " +
            "on o.person_id=p.id " +
            "where p.org_fw_Id=#{orgId}" +
            "</script>")
    int getOrderNum(@Param("orgId") String orgId);
}