package com.qnfhq.modules.c2c.dao;

import com.qnfhq.common.dao.BaseDao;
import com.qnfhq.modules.c2c.entity.C2cOrderEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * c2c订单
 *
 * @author yelz 30262728@qq.com
 * @since 1.0.0 2025-11-17
 */
@Mapper
public interface C2cOrderDao extends BaseDao<C2cOrderEntity> {

    @Select("select count(1) NUM from c2c_order where tran_user_id=#{tranUserId} and status=0 and direction=2")
    public List<Map> selectMtUnPayCount(@Param("tranUserId") Long tranUserId);

    @Select("select count(1) NUM from c2c_order where tran_user_id=#{tranUserId} and status=1 and direction=1")
    public List<Map> selectMtUnReleaseCount(@Param("tranUserId") Long tranUserId);

    public int insertC2cOrder(C2cOrderEntity c2cOrder);
}