parent
0cecd31d98
commit
ddc74d3f52
@ -0,0 +1,111 @@ |
||||
package com.dxhy.base.dao; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.dxhy.base.entity.SysDeptEntity; |
||||
import org.apache.ibatis.annotations.Mapper; |
||||
import org.apache.ibatis.annotations.Param; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* 部门管理 |
||||
* |
||||
* @author jiaohongyang |
||||
*/ |
||||
@Mapper |
||||
public interface SysDeptDao extends BaseMapper<SysDeptEntity> { |
||||
/** |
||||
* 根据集团编码查询税号 |
||||
* |
||||
* @author 陈刚扬 |
||||
* @date 2020/12/4 |
||||
* @param company |
||||
* @param orgType |
||||
* @return java.util.List<com.dxhy.admin.sys.entity.SysDeptEntity> |
||||
*/ |
||||
List<SysDeptEntity> selectDeptByCompany(@Param("company") String company, @Param("orgType") String orgType); |
||||
|
||||
/** |
||||
* 根据集团编码查询部门信息 |
||||
* |
||||
* @param company |
||||
* 集团编码 |
||||
* @return 部门信息 |
||||
*/ |
||||
List<SysDeptEntity> queryList(@Param("company") String company); |
||||
|
||||
/** |
||||
* 根据集团编码查询用户关联部门信息 |
||||
* |
||||
* @param company |
||||
* 集团编码 |
||||
* @return 部门信息 |
||||
*/ |
||||
List<SysDeptEntity> queryListUser(@Param("company") String company); |
||||
|
||||
/** |
||||
* 根据集团编码查询上级部门信息 |
||||
* |
||||
* @param company |
||||
* 集团编码 |
||||
* @return 部门信息 |
||||
*/ |
||||
List<SysDeptEntity> queryListParent(@Param("company") String company); |
||||
|
||||
/** |
||||
* 查询子部门ID列表 |
||||
* |
||||
* @param parentId |
||||
* 上级部门ID |
||||
* @return 部门信息 |
||||
*/ |
||||
List<Long> queryDetpIdList(@Param("parentId") Long parentId); |
||||
|
||||
/** |
||||
* 根据上级ID查询部门信息 |
||||
* |
||||
* @param parentId |
||||
* 集团编码 |
||||
* @return 部门信息 |
||||
*/ |
||||
List<SysDeptEntity> queryDeptParentId(@Param("parentId") Long parentId); |
||||
|
||||
/** |
||||
* 获取部门信息 |
||||
* |
||||
* @return 部门信息 |
||||
*/ |
||||
List<SysDeptEntity> queryDeptList(); |
||||
|
||||
/** |
||||
* 根据集团编码修改部分信息 |
||||
* |
||||
* @param company |
||||
* 集团编码 |
||||
* @param isCollext |
||||
* 是否采集 |
||||
* @param aceKey |
||||
* key |
||||
* @param aceId |
||||
* id |
||||
* @param dbName |
||||
* 数据库 |
||||
* @param qsStatus |
||||
* 签收状态 |
||||
*/ |
||||
void updateDeptCompany(@Param("company") String company, @Param("isCollext") String isCollext, |
||||
@Param("aceKey") String aceKey, @Param("aceId") String aceId, @Param("dbName") String dbName, |
||||
@Param("qsStatus") String qsStatus); |
||||
|
||||
List<String> getOrgCodeList(Long userId); |
||||
|
||||
/** |
||||
* 查询id与税号对应list |
||||
* |
||||
* @return 部门信息 |
||||
*/ |
||||
List<SysDeptEntity> queryTaxnoList(); |
||||
|
||||
List<SysDeptEntity> queryParentIdList(); |
||||
|
||||
} |
@ -0,0 +1,109 @@ |
||||
package com.dxhy.base.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField; |
||||
import com.baomidou.mybatisplus.annotation.TableId; |
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import lombok.Data; |
||||
|
||||
import java.io.Serializable; |
||||
import java.util.Date; |
||||
import java.util.List; |
||||
|
||||
/** |
||||
* 部门管理 |
||||
* |
||||
* @author jiaohongyang |
||||
*/ |
||||
@Data |
||||
@TableName("sys_dept") |
||||
public class SysDeptEntity implements Serializable { |
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
/** |
||||
* 部门ID |
||||
*/ |
||||
@TableId |
||||
private String deptId; |
||||
/** |
||||
* 上级部门ID,一级部门为0 |
||||
*/ |
||||
private String parentId; |
||||
/** |
||||
* 部门名称 |
||||
*/ |
||||
private String name; |
||||
/** |
||||
* 上级部门名称 |
||||
*/ |
||||
@TableField(exist = false) |
||||
private String parentName; |
||||
private Integer orderNum; |
||||
|
||||
private String taxno; |
||||
private String taxname; |
||||
private String linkman; |
||||
private String phone; |
||||
private String address; |
||||
private String bank; |
||||
private String account; |
||||
private String company; |
||||
private String orgType; |
||||
private String deptType; |
||||
private String upgradeStatus; |
||||
|
||||
/** |
||||
* 是否查验 0-- 不查验 1---查验 |
||||
*/ |
||||
private String checkStatus; |
||||
/** |
||||
* 是否采集状态 0 -- 不采集 1--采集 |
||||
*/ |
||||
private String cjStatus; |
||||
/** |
||||
* 是否签收认证 0 -- 不签收认证 1 -- 签收认证 |
||||
*/ |
||||
private String qsStatus; |
||||
/** |
||||
* 所选数据库名称 |
||||
*/ |
||||
private String dbName; |
||||
|
||||
/** |
||||
* 兼容大企业平台添加 |
||||
*/ |
||||
private String aceKey; |
||||
/** |
||||
* 兼容大企业平台添加 |
||||
*/ |
||||
private String aceId; |
||||
/** |
||||
* 是否采集全票面 0-- 不采集全票面 1--采集全票面 |
||||
*/ |
||||
private String isCollext; |
||||
/** |
||||
* 机构编码 |
||||
*/ |
||||
private String orgCode; |
||||
/** |
||||
* 地区编码 |
||||
*/ |
||||
private String areaCode; |
||||
/** |
||||
* 是否需要确认密码 |
||||
*/ |
||||
private String isPassword; |
||||
/** |
||||
* 确认密码 |
||||
*/ |
||||
private String password; |
||||
|
||||
private Date updateTime; |
||||
|
||||
private Date createTime; |
||||
|
||||
private String autoRz; |
||||
|
||||
private String productType; |
||||
@TableField(exist = false) |
||||
private List<SysDeptEntity> children; |
||||
} |
@ -0,0 +1,97 @@ |
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
||||
<mapper namespace="com.dxhy.base.dao.SysDeptDao"> |
||||
|
||||
<select id="queryList" resultType="com.dxhy.base.entity.SysDeptEntity"> |
||||
select t1.*,(select t2.name from sys_dept t2 where t2.dept_id=t1.parent_id)parentName from sys_dept t1 |
||||
where (t1.org_type != '8' and t1.org_type != '9') |
||||
<if test="company != null and company != '' and company != 'null'"> |
||||
and t1.company = #{company} |
||||
</if> |
||||
</select> |
||||
|
||||
<select id="queryListUser" resultType="com.dxhy.base.entity.SysDeptEntity"> |
||||
select t1.*,(select t2.name from sys_dept t2 where t2.dept_id=t1.parent_id)parentName from sys_dept t1 where |
||||
and t1.org_type != '7' and t1.org_type != '8' and t1.org_type != '9' and t1.org_type != '3' |
||||
<if test="company != null and company != '' and company != 'null'"> |
||||
and t1.company = #{company} |
||||
</if> |
||||
</select> |
||||
|
||||
<select id="queryListParent" resultType="com.dxhy.base.entity.SysDeptEntity"> |
||||
select t1.*,(select t2.name from sys_dept t2 where t2.dept_id=t1.parent_id)parentName from sys_dept t1 where |
||||
(t1.dept_type = '0' or t1.dept_type = '1') |
||||
<if test="company != null and company != '' and company != 'null'"> |
||||
and t1.company = #{company} |
||||
</if> |
||||
</select> |
||||
|
||||
<select id="queryDetpIdList" resultType="long"> |
||||
select dept_id |
||||
from sys_dept |
||||
where parent_id = #{parentId} |
||||
</select> |
||||
|
||||
<select id="queryDeptParentId" resultType="com.dxhy.base.entity.SysDeptEntity"> |
||||
select * |
||||
from sys_dept |
||||
where parent_id = #{parentId} |
||||
</select> |
||||
|
||||
<select id="queryDeptList" resultType="com.dxhy.base.entity.SysDeptEntity"> |
||||
select * |
||||
from sys_dept |
||||
where cj_status = '1' |
||||
and org_type = '5' |
||||
</select> |
||||
|
||||
<update id="updateDeptCompany"> |
||||
update |
||||
sys_dept |
||||
set qs_status = #{qsStatus}, |
||||
db_name = #{dbName}, |
||||
ace_key = #{aceKey}, |
||||
ace_id = #{aceId}, |
||||
is_collext = #{isCollext} |
||||
where company = #{company} |
||||
and org_type != '1' |
||||
|
||||
</update> |
||||
<select id="selectDeptByCompany" resultType="com.dxhy.base.entity.SysDeptEntity" databaseId="mysql"> |
||||
select * from sys_dept |
||||
where company = #{company} |
||||
<if test="orgType!=null and orgType !=''"> |
||||
and org_type = #{orgType} |
||||
</if> |
||||
order by org_code |
||||
</select> |
||||
<!-- group by taxno--> |
||||
<select id="selectDeptByCompany" resultType="com.dxhy.base.entity.SysDeptEntity" databaseId="oracle"> |
||||
select * from sys_dept a |
||||
where |
||||
a.company=#{company} |
||||
<if test="orgType!=null and orgType !=''"> |
||||
and a.org_type = #{orgType} |
||||
</if> |
||||
<if test='orgType!="1"'> |
||||
and a.dept_id = (select max(dept_id) from sys_dept b where a.taxno=b.taxno ) |
||||
</if> |
||||
order by a.org_code |
||||
</select> |
||||
|
||||
<select id="getOrgCodeList" parameterType="long" resultType="string"> |
||||
select d.org_code |
||||
from sys_user_org o left join sys_dept d |
||||
on o.dept_id = d.dept_id |
||||
where o.userid = #{userId} |
||||
</select> |
||||
|
||||
<select id="queryTaxnoList" resultType="com.dxhy.base.entity.SysDeptEntity"> |
||||
select dept_id,taxno,name from sys_dept where taxno is not null and taxno != ''; |
||||
</select> |
||||
|
||||
<select id="queryParentIdList" resultType="com.dxhy.base.entity.SysDeptEntity"> |
||||
select dept_id,parent_id,name from sys_dept; |
||||
</select> |
||||
</mapper> |
Loading…
Reference in new issue