package market.Lms.FixedAssets.impl;

import java.text.SimpleDateFormat;
import java.util.Date;

import market.Com.pb.PbMethod;
import market.Lms.FixedAssets.mapper.LmsFixedAssetsBorrowInfoMapper;
import market.Lms.FixedAssets.service.LmsFixedAssetsBorrowInfoService;
import market.Lms.FixedAssets.vo.LmsFixedAssetsBorrowInfo;

import com.hnshituo.basic.service.impl.BaseServiceImpl;
import com.hnshituo.basic.spring.remoting.annotation.RemoteService;

@RemoteService(path="LmsFixedAssetsBorrowInfo")
public class LmsFixedAssetsBorrowInfoServiceImpl extends BaseServiceImpl<LmsFixedAssetsBorrowInfo,Object> implements LmsFixedAssetsBorrowInfoService{

	//新增
	public String doAdd(LmsFixedAssetsBorrowInfo borrow){
		String id = new SimpleDateFormat("yyyyMMddHHmmssSSS").format(new Date())+PbMethod.RandomCreate(3);
		borrow.setBorrow_no(id);
		this.getMapper(LmsFixedAssetsBorrowInfoMapper.class).insert(borrow);
		return id;
	}

	//删除
	public void doDelete(LmsFixedAssetsBorrowInfo borrow){
		this.getMapper(LmsFixedAssetsBorrowInfoMapper.class).delete(borrow.getBorrow_no());
	}

	//修改
	public void doUpdate(LmsFixedAssetsBorrowInfo borrow){
		this.getMapper(LmsFixedAssetsBorrowInfoMapper.class).update(borrow);
	}

	//查询
	public LmsFixedAssetsBorrowInfo doQuery(String borrowNo){
		LmsFixedAssetsBorrowInfo borrow = new LmsFixedAssetsBorrowInfo();
		borrow = this.getMapper(LmsFixedAssetsBorrowInfoMapper.class).findById(borrowNo);
		return borrow;
	}
}
