das接口新增

This commit is contained in:
chenhaojie 2024-06-26 15:23:58 +08:00
parent 9db5556eca
commit 230ae01b9e
2 changed files with 48 additions and 13 deletions

View File

@ -0,0 +1,36 @@
package com.das.modules.auth.domain.vo;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
@Data
public class SysOrgVo implements Serializable {
/** 机构id */
private Long id ;
/** 机构名称 */
private String name ;
/** 机构编码 */
private String mrid ;
/** 省份 */
private String province ;
/** 城市 */
private String city ;
/** 区县 */
private String county ;
/** 具体地址 */
private String address ;
/** 联系电话 */
private String contactPhone ;
/** 备注 */
private String remarks ;
/** 机构简称 */
private String aliasName;
/** 上级组织机构id */
private Long parentOrgId ;
private String parentOrgName ;
/** 乐观锁 */
private Integer revision ;
}

View File

@ -2,7 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.das.modules.auth.mapper.SysOrgMapper">
<resultMap type="com.das.modules.auth.entity.SysOrg" id="SysOrgMap">
<resultMap type="com.das.modules.auth.domain.vo.SysOrgVo" id="SysOrgMap">
<result property="id" column="id" jdbcType="BIGINT"/>
<result property="name" column="name" jdbcType="VARCHAR"/>
<result property="mrid" column="mrid" jdbcType="VARCHAR"/>
@ -13,42 +13,41 @@
<result property="contactPhone" column="contact_phone" jdbcType="VARCHAR"/>
<result property="remarks" column="remarks" jdbcType="VARCHAR"/>
<result property="parentOrgId" column="parent_org_id" jdbcType="VARCHAR"/>
<result property="parentOrgName" column="parentOrgName" jdbcType="VARCHAR"/>
<result property="revision" column="revision" jdbcType="VARCHAR"/>
<result property="createdBy" column="created_by" jdbcType="VARCHAR"/>
<result property="createdTime" column="created_time" jdbcType="VARCHAR"/>
<result property="updatedBy" column="updated_by" jdbcType="VARCHAR"/>
<result property="updatedTime" column="updated_time" jdbcType="VARCHAR"/>
</resultMap>
<select id="queryOrgList" resultMap="SysOrgMap">
select * from sys_org
select t.*, p.name as parentOrgName from sys_org t left join sys_org p on p.id = t.parent_org_id
<where>
<if test="sysOrg.name != null and sysOrg.name != ''">
and name like concat('%',#{sysOrg.name},'%')
and t.name like concat('%',#{sysOrg.name},'%')
</if>
<if test="sysOrg.province != null and sysOrg.province != ''">
and province like concat('%',#{sysOrg.province},'%')
and t.province like concat('%',#{sysOrg.province},'%')
</if>
<if test="sysOrg.city != null and sysOrg.city != ''">
and city like concat('%',#{sysOrg.city},'%')
and t.city like concat('%',#{sysOrg.city},'%')
</if>
<if test="sysOrg.county != null and sysOrg.county != ''">
and county like concat('%',#{sysOrg.county},'%')
and t.county like concat('%',#{sysOrg.county},'%')
</if>
<if test="sysOrg.parentOrgId != null and sysOrg.parentOrgId != ''">
and parent_org_id = #{sysOrg.parentOrgId}
and t.parent_org_id = #{sysOrg.parentOrgId}
</if>
</where>
</select>
<select id="queryAllOrgTree" resultMap="SysOrgMap">
SELECT i.* FROM sys_org i WHERE i.id = #{id}
select t.*, p.name as parentOrgName from sys_org t left join sys_org p on p.id = t.parent_org_id
WHERE t.id = #{id}
</select>
<select id="queryAllChildOrgTree" resultMap="SysOrgMap">
SELECT i.* FROM sys_org i WHERE i.parent_org_id = #{id}
select t.*, p.name as parentOrgName from sys_org t left join sys_org p on p.id = t.parent_org_id
WHERE t.parent_org_id = #{id}
</select>
</mapper>