package com.yc.ship.module.otc.dal.mysql.store;

import com.yc.ship.framework.common.pojo.PageParam;
import com.yc.ship.framework.common.pojo.PageResult;
import com.yc.ship.framework.mybatis.core.mapper.BaseMapperX;
import com.yc.ship.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.yc.ship.module.otc.dal.dataobject.store.StoreProductDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 门店设备产品关联 Mapper
 *
 * @author 管理员
 */
@Mapper
public interface StoreProductMapper extends BaseMapperX<StoreProductDO> {

    default PageResult<StoreProductDO> selectPage(PageParam reqVO, Long storeId) {
        return selectPage(reqVO, new LambdaQueryWrapperX<StoreProductDO>()
                .eq(StoreProductDO::getStoreId, storeId)
                .orderByDesc(StoreProductDO::getId));
    }

    default int deleteByStoreId(Long storeId) {
        return delete(StoreProductDO::getStoreId, storeId);
    }

}
