ProjectDao.java 798 Bytes
Newer Older
1
package pwc.taxtech.atms.dao;
2 3 4 5

import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
6 7
import pwc.taxtech.atms.entity.Project;
import pwc.taxtech.atms.entity.ProjectExample;
8 9 10 11 12 13

@Service
public class ProjectDao {
    @Autowired
    ProjectMapper projectMapper;

14
    public String getDbNameWithYearAndOrgId(String orgId,int year){
15
        ProjectExample example = new ProjectExample();
16
        example.createCriteria().andOrganizationIdEqualTo(orgId).andYearEqualTo(year);
17 18 19 20 21 22 23 24
        Project project = projectMapper.selectByExample(example).get(0);
        String dbName = StringUtils.EMPTY;
        if (project != null) {
            dbName = project.getDbName();
        }
        return dbName;
    }
}