package market.Lms.FixedAssets.impl;

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

import market.Com.pb.PbMethod;
import market.Lms.FixedAssets.mapper.LmsFixedAssetsMaintainInfoMapper;
import market.Lms.FixedAssets.service.LmsFixedAssetsMaintainInfoService;
import market.Lms.FixedAssets.vo.LmsFixedAssetsMaintainInfo;

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

@RemoteService(path="LmsFixedAssetsMaintainInfo")
public class LmsFixedAssetsMaintainInfoServiceImpl extends BaseServiceImpl<LmsFixedAssetsMaintainInfo,Object> implements LmsFixedAssetsMaintainInfoService{

	//新增
	public String doAdd(LmsFixedAssetsMaintainInfo maintain){
		String id = new SimpleDateFormat("yyyyMMddHHmmssSSS").format(new Date())+PbMethod.RandomCreate(3);
		maintain.setMaintain_no(id);
		if(maintain.getMaintain_time()==null)
			maintain.setMaintain_time(new Date());
		this.getMapper(LmsFixedAssetsMaintainInfoMapper.class).insert(maintain);
		return id;
	}

	//删除
	public void doDelete(LmsFixedAssetsMaintainInfo maintain){
		this.getMapper(LmsFixedAssetsMaintainInfoMapper.class).delete(maintain.getMaintain_no());
	}

	//修改
	public void doUpdate(LmsFixedAssetsMaintainInfo maintain){
		this.getMapper(LmsFixedAssetsMaintainInfoMapper.class).update(maintain);
	}

	//查询
	public LmsFixedAssetsMaintainInfo doQuery(String maintainNo){
		LmsFixedAssetsMaintainInfo maintain = new LmsFixedAssetsMaintainInfo();
		maintain = this.getMapper(LmsFixedAssetsMaintainInfoMapper.class).findById(maintainNo);
		return maintain;
	}
}
