You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
1.4 KiB
42 lines
1.4 KiB
package com.hai.service.impl;
|
|
|
|
import com.hai.dao.HighCompanyTwoPwdMapper;
|
|
import com.hai.entity.HighCompanyTwoPwd;
|
|
import com.hai.entity.HighCompanyTwoPwdExample;
|
|
import com.hai.service.HighCompanyTwoPwdService;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import javax.annotation.Resource;
|
|
import java.util.Date;
|
|
import java.util.List;
|
|
|
|
@Service("companyTwoPwdService")
|
|
public class HighCompanyTwoPwdServiceImpl implements HighCompanyTwoPwdService {
|
|
|
|
@Resource
|
|
private HighCompanyTwoPwdMapper companyTwoPwdMapper;
|
|
|
|
@Override
|
|
public void editData(HighCompanyTwoPwd companyTwoPwd) {
|
|
if (companyTwoPwd.getId() == null) {
|
|
companyTwoPwd.setCreateTime(new Date());
|
|
companyTwoPwd.setUpdateTime(new Date());
|
|
companyTwoPwd.setStatus(1);
|
|
companyTwoPwdMapper.insert(companyTwoPwd);
|
|
} else {
|
|
companyTwoPwd.setUpdateTime(new Date());
|
|
companyTwoPwdMapper.updateByPrimaryKey(companyTwoPwd);
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public HighCompanyTwoPwd getTwoPwdByOrg(Long orgId) {
|
|
HighCompanyTwoPwdExample example = new HighCompanyTwoPwdExample();
|
|
example.createCriteria().andStatusEqualTo(1).andOrgIdEqualTo(orgId);
|
|
List<HighCompanyTwoPwd> list = companyTwoPwdMapper.selectByExample(example);
|
|
if (list.size() > 0) {
|
|
return list.get(0);
|
|
}
|
|
return null;
|
|
}
|
|
}
|
|
|