| | |
| | | package com.consum.base.service.impl; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import com.consum.base.Constants; |
| | | import com.consum.base.core.utils.IdUtil; |
| | | import com.consum.base.pojo.FinSysTenantDepartmentParam; |
| | |
| | | import com.walker.infrastructure.utils.DateUtils; |
| | | import com.walker.infrastructure.utils.StringUtils; |
| | | import com.walker.jdbc.service.BaseServiceImpl; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Description 部门管理 |
| | |
| | | * @Date 2023/10/26 |
| | | */ |
| | | @Override |
| | | public FinSysTenantDepartment getByNameAndTenantId(String name, Long tenantId) { |
| | | public FinSysTenantDepartment getTenantDepartment(String name, Long tenantId, String code) { |
| | | StringBuilder sql = new StringBuilder("SELECT * FROM fin_sys_tenant_department WHERE 1 = 1 "); |
| | | HashMap<String, Object> paramts = new HashMap<>(); |
| | | |
| | |
| | | sql.append(" and TENANT_ID =:TENANT_ID "); |
| | | paramts.put("TENANT_ID", tenantId); |
| | | } |
| | | if (!StringUtils.isEmpty(code)) { |
| | | sql.append("and CODE = :code "); |
| | | paramts.put("code", code); |
| | | } |
| | | |
| | | sql.append("and status = 1"); |
| | | return this.get(sql.toString(), paramts, new FinSysTenantDepartment()); |
| | | } |
| | | |
| | |
| | | |
| | | sql.append(" ORDER BY ORDER_NUM,CREATE_TIME DESC "); |
| | | return selectSplit(sql.toString(), paramts, new FinSysTenantDepartment()); |
| | | } |
| | | |
| | | @Override |
| | | public FinSysTenantDepartment selectByCode(String code, Long id) { |
| | | StringBuilder sql = new StringBuilder(QUERY_BY_CODE); |
| | | ArrayList<Object> param = new ArrayList<>(2); |
| | | param.add(code); |
| | | if (id != null) { |
| | | sql.append(" and id != ?"); |
| | | param.add(id); |
| | | } |
| | | List<FinSysTenantDepartment> select = this.select(sql.toString(), param.toArray(), new FinSysTenantDepartment()); |
| | | if (StringUtils.isEmptyList(select)) { |
| | | return null; |
| | | } else { |
| | | return select.get(0); |
| | | } |
| | | } |
| | | |
| | | /** |