package market.Lms.FixedAssets.impl;

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

import market.Com.pb.PbMethod;
import market.Lms.FixedAssets.mapper.LmsFixedAssetsScrapInfoMapper;
import market.Lms.FixedAssets.service.LmsFixedAssetsScrapInfoService;
import market.Lms.FixedAssets.vo.LmsFixedAssetsScrapInfo;

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

@RemoteService(path="LmsFixedAssetsScrapInfo")
public class LmsFixedAssetsScrapInfoServiceImpl extends BaseServiceImpl<LmsFixedAssetsScrapInfo,Object> implements LmsFixedAssetsScrapInfoService{

	//新增
	public String doAdd(LmsFixedAssetsScrapInfo scrap){
		String id = new SimpleDateFormat("yyyyMMddHHmmssSSS").format(new Date())+PbMethod.RandomCreate(3);
		scrap.setScrap_no(id);
		this.getMapper(LmsFixedAssetsScrapInfoMapper.class).insert(scrap);
		return id;
	}

	//删除
	public void doDelete(LmsFixedAssetsScrapInfo scrap){
		this.getMapper(LmsFixedAssetsScrapInfoMapper.class).delete(scrap.getScrap_no());
	}

	//修改
	public void doUpdate(LmsFixedAssetsScrapInfo scrap){
		this.getMapper(LmsFixedAssetsScrapInfoMapper.class).update(scrap);
	}

	//查询
	public LmsFixedAssetsScrapInfo doQuery(String scrapNo){
		LmsFixedAssetsScrapInfo scrap = new LmsFixedAssetsScrapInfo();
		scrap = this.getMapper(LmsFixedAssetsScrapInfoMapper.class).findById(scrapNo);
		return scrap;
	}
}
