File was renamed from consum-base/src/main/java/com/consum/base/service/FinSysTenantDepartmentServiceImpl.java |
| | |
| | | package com.consum.base.service; |
| | | package com.consum.base.service.impl; |
| | | |
| | | import com.consum.base.Constants; |
| | | import com.consum.base.pojo.FinSysTenantDepartmentParam; |
| | | import com.consum.base.core.utils.IdUtil; |
| | | import com.consum.base.pojo.FinSysTenantDepartmentParam; |
| | | import com.consum.base.service.FinSysTenantDepartmentService; |
| | | import com.consum.model.po.FinSysTenantDepartment; |
| | | import com.consum.model.po.FinSysTenantUser; |
| | | import com.walker.db.page.GenericPager; |
| | | 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.HashMap; |
| | | import java.util.List; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * @Description 部门管理 |
| | |
| | | * @Date 2023/10/26 |
| | | */ |
| | | @Service |
| | | public class FinSysTenantDepartmentServiceImpl extends BaseServiceImpl { |
| | | public class FinSysTenantDepartmentServiceImpl extends BaseServiceImpl implements FinSysTenantDepartmentService { |
| | | |
| | | private static final String QUERY_BY_CODE = "SELECT * FROM fin_sys_tenant_department WHERE CODE = ?"; |
| | | |
| | | /** |
| | | * @Description 根据 部门名称和机构id 查询部门 |
| | | * @Description 根据 部门名称和机构id 查询部门 |
| | | * @Author 卢庆阳 |
| | | * @Date 2023/10/26 |
| | | */ |
| | | public FinSysTenantDepartment getByNameAndTenantId(String name,Long tenantId) { |
| | | @Override |
| | | public FinSysTenantDepartment getByNameAndTenantId(String name, Long tenantId) { |
| | | StringBuilder sql = new StringBuilder("SELECT * FROM fin_sys_tenant_department WHERE 1 = 1 "); |
| | | HashMap<String, Object> paramts = new HashMap<>(); |
| | | |
| | |
| | | } |
| | | |
| | | /** |
| | | * @Description 新增 |
| | | * @Description 新增 |
| | | * @Author 卢庆阳 |
| | | * @Date 2023/10/26 |
| | | */ |
| | | @Override |
| | | public int add(FinSysTenantDepartmentParam param, FinSysTenantUser sysInfo) { |
| | | FinSysTenantDepartment department = new FinSysTenantDepartment(); |
| | | BeanUtils.copyProperties(param, department); |
| | |
| | | * @Author 卢庆阳 |
| | | * @Date 2023/10/26 |
| | | */ |
| | | @Override |
| | | public GenericPager<FinSysTenantDepartment> queryList(FinSysTenantDepartmentParam param) { |
| | | StringBuilder sql = new StringBuilder("SELECT * FROM fin_sys_tenant_department WHERE 1 = 1 and is_delete = 0 "); |
| | | HashMap<String, Object> paramts = new HashMap<>(); |
| | |
| | | return selectSplit(sql.toString(), paramts, new FinSysTenantDepartment()); |
| | | } |
| | | |
| | | @Override |
| | | public FinSysTenantDepartment selectByCode(String code) { |
| | | List<FinSysTenantDepartment> select = this.select(QUERY_BY_CODE, new Object[]{code}, new FinSysTenantDepartment()); |
| | | if (StringUtils.isEmptyList(select)) { |
| | |
| | | * @Author 卢庆阳 |
| | | * @Date 2023/10/26 |
| | | */ |
| | | @Override |
| | | public int updateFinSysTenantDepartment(FinSysTenantDepartment department, FinSysTenantUser sysInfo) { |
| | | department.setUpdateTime(DateUtils.getDateTimeNumber(System.currentTimeMillis())); |
| | | department.setUpdateBy(sysInfo.getUserName()); |
| | |
| | | |
| | | /** |
| | | * 根据部门id查询部门详情 |
| | | * |
| | | * @author 卢庆阳 |
| | | * @Date 2023/10/26 |
| | | */ |
| | | @Override |
| | | public FinSysTenantDepartment getById(Long id) { |
| | | return this.get(new FinSysTenantDepartment(id)); |
| | | } |
| | | |
| | | /** |
| | | * @param department |
| | | * @param currentUser |
| | | * @Description 根据id删除部门 |
| | | * @Author 卢庆阳 |
| | | * @Date 2023/10/26 |
| | | * @param department |
| | | * @param currentUser |
| | | */ |
| | | @Override |
| | | public int updateById(FinSysTenantDepartment department, FinSysTenantUser currentUser) { |
| | | department.setIsDelete(Constants.IS_DELETE_YES); |
| | | //删除时间 |
| | |
| | | |
| | | /** |
| | | * 根据机构id查询部门 |
| | | * |
| | | * @param agencyId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<FinSysTenantDepartment> getByTenantId(Long agencyId) { |
| | | StringBuilder sql = new StringBuilder("SELECT * FROM fin_sys_tenant_department WHERE 1 = 1 and is_delete = 0 "); |
| | | HashMap<String, Object> paramts = new HashMap<>(); |