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.OtherReceivableItem;
import com.dk.mdm.mapper.mac.OtherReceivableItemMapper;
import com.dk.common.service.BaseService;
import com.dk.common.mapper.BaseMapper;
import com.dk.mdm.model.query.mac.OtherReceivableItemQuery;
import com.dk.mdm.model.query.sale.OrderItemQuery;
import com.dk.mdm.model.response.mac.OtherReceivableItemResponse;
import com.dk.mdm.model.response.sale.OrderItemResponse;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
public class OtherReceivableItemService extends BaseService<OtherReceivableItem> {

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

	@Override
	public BaseMapper<OtherReceivableItem> getRepository() {
		return otherReceivableItemMapper;
	}

	@Autowired
	private OtherReceivableItemMapper otherReceivableItemMapper;

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

}
