OrgExtService.java 1.25 KB
package com.tanpu.feo.feojob.service;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.tanpu.feo.feojob.constant.BaseConstant;
import com.tanpu.feo.feojob.dao.user.entity.OrgExtEntity;
import com.tanpu.feo.feojob.dao.user.mapper.OrgExtMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.Date;
import java.util.List;

/**
 * 机构扩展信息表ServiceImp
 *
 * @author zejia zj wu 2021年05月18日
 * @version 1.0
 */
@Service("orgExtService")
@Slf4j
public class OrgExtService extends ServiceImpl<OrgExtMapper, OrgExtEntity> {

	@Autowired
	private OrgExtMapper orgExtMapper;


	public List<OrgExtEntity> findOrgExtByModel(String model) {
		return orgExtMapper.selectList(Wrappers.lambdaQuery(OrgExtEntity.class).eq(OrgExtEntity::getModel, model).eq(OrgExtEntity::getDeleteTag, BaseConstant.DeleteTagStr.NOT_DELETED));
	}

	@Transactional
	public boolean updateById(OrgExtEntity orgExt) {
		orgExt.setUpdateBy("SYS");
		orgExt.setUpdateTime(new Date());
		orgExtMapper.updateById(orgExt);
		return true;
	}
}