package com.dk.mdm.service.ivt;

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.ivt.CheckItem;
import com.dk.mdm.mapper.ivt.CheckItemMapper;
import com.dk.common.service.BaseService;
import com.dk.common.mapper.BaseMapper;
import com.dk.mdm.model.query.ivt.CheckItemQuery;
import com.dk.mdm.model.query.ivt.FreezeItemQuery;
import com.dk.mdm.model.response.ivt.CheckItemResponse;
import com.dk.mdm.model.response.ivt.FreezeItemResponse;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
public class CheckItemService extends BaseService<CheckItem> {

	@Override
	public BaseMapper<CheckItem> getRepository() {
		return checkItemMapper;
	}

	@Autowired
	private CheckItemMapper checkItemMapper;

	/**
	 * @desc   : 重新主键
	 * @author : 宋扬
	 * @date   : 2024/3/28 14:00
	 */
	@Override
	public String getPrimaryKey() {
		return "item_id";
	}

	/**
	 * @desc   : 盘点明细
	 * @author : 宋扬
	 * @date   : 2024/3/28 14:00
	 */
	@Pagination
	public ResponseResultVO<PageList<CheckItemResponse>> selectByCond(CheckItemQuery checkItemQuery) {
		return super.mergeListWithCount(checkItemMapper, checkItemMapper.selectByCond(checkItemQuery)
				, checkItemMapper.countByCond(checkItemQuery));
	}

}
