package com.dk.mdm.service.mac;

import com.dk.common.infrastructure.annotaiton.Pagination;
import com.dk.common.model.pojo.PageList;
import com.dk.common.response.ResponseResultVO;
import com.dk.mdm.model.pojo.mac.MacTransferItem;
import com.dk.mdm.mapper.mac.MacTransferItemMapper;
import com.dk.common.service.BaseService;
import com.dk.common.mapper.BaseMapper;
import com.dk.mdm.model.query.mac.MacTransferItemQuery;
import com.dk.mdm.model.query.pur.PurchaseItemQuery;
import com.dk.mdm.model.response.mac.MacTransferItemResponse;
import com.dk.mdm.model.response.pur.PurchaseItemResponse;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
public class MacTransferItemService extends BaseService<MacTransferItem> {

	@Override
	public String getPrimaryKey() {
		return "item_id";
	}

	@Override
	public BaseMapper<MacTransferItem> getRepository() {
		return macTransferItemMapper;
	}

	@Autowired
	private MacTransferItemMapper macTransferItemMapper;

	/**
	 * @desc   : 条件查询
	 * @author : 常皓宁
	 * @date   : 2024/2/28 15:16
	 */
	@Pagination
	public ResponseResultVO<PageList<MacTransferItemResponse>> selectByCond(MacTransferItemQuery macTransferItemQuery) {
		return super.mergeListWithCount(macTransferItemMapper, macTransferItemMapper.selectByCond(macTransferItemQuery), macTransferItemMapper.countByCond(macTransferItemQuery));
	}

}
