兼容+功能

This commit is contained in:
ran.shang
2026-01-05 16:35:46 +08:00
parent e99b717e48
commit ea6d25ca97
103 changed files with 1563 additions and 581 deletions

View File

@@ -1,20 +1,20 @@
-- 系统uc_platform -- 系统uc_platform
INSERT INTO uc_platform INSERT INTO uc_platform
(platform_code, name, full_name, short_name, business, deleted, create_time) (platform_code, name, full_name, short_name, business, deleted, create_time)
VALUES(1, '文档系统', 's-file', 'file', 1, 0, now()); VALUES(1, '文档系统', 's-file', 'file', true, FALSE, now());
-- 平台机构/平台机构管理员 -- 平台机构/平台机构管理员
INSERT INTO xs_org INSERT INTO xs_org
(org_name, org_code, type, address_code, address_name, description, quality, enable, activated, parent_id, credit_code, trade, deleted, create_by, create_time, update_by, update_time, proxy_by, activation_code, phone, query_children, org_logo, registered_address, company_size, business_license, recruit_position_type) (org_name, org_code, type, address_code, address_name, description, quality, enable, activated, parent_id, credit_code, trade, deleted, create_by, create_time, update_by, update_time, proxy_by, activation_code, phone, query_children, org_logo, registered_address, company_size, business_license, recruit_position_type)
VALUES('senmesh', 'O001', '1', '440232', NULL, NULL, 0, 1, 1, NULL, '', NULL, 0, 0, now(), 1, now(), null, NULL, null, NULL, null, '1234', '6', null, '1'); VALUES('senmesh', 'O001', '1', '440232', NULL, NULL, false, TRUE, TRUE, NULL, '', NULL, FALSE, 0, now(), 1, now(), null, NULL, null, NULL, null, '1234', '6', null, '1');
INSERT INTO uc_user INSERT INTO uc_user
(username, password, type, supeiror, security_code, nickname, avatar, phone, phone_binding, real_name, card_no, authenticated, status, email, address, education, init_user_id, enabled, account_non_expired, account_non_locked, credentials_non_expired, deleted, create_by, create_time, update_by, update_time, proxy_by, gender, birthday) (username, password, type, supeiror, security_code, nickname, avatar, phone, phone_binding, real_name, card_no, authenticated, status, email, address, education, init_user_id, enabled, account_non_expired, account_non_locked, credentials_non_expired, deleted, create_by, create_time, update_by, update_time, proxy_by, gender, birthday)
VALUES('admin', '$2a$10$0N3iaxx2sYv0hXvYzS4.6.yriL.DfjRTjED7Y4vkqxzbxi2dNpBou', 1, 1, '$2a$10$992AErI/g5nnfGnraSh7NuoeZVOXYcPuPQ3hqi5FjjIlU0Dwfk0/a', '平台管理员', '20d78fb6abe9478cadc2e1cb5bf93a35', '13611806907', 1, '平台管理员', NULL, 0, 2, null, NULL, NULL, NULL, 1, 1, 1, 1, 0, 0, now(), 1, NULL, NULL, NULL, NULL); VALUES('admin', '$2a$10$0N3iaxx2sYv0hXvYzS4.6.yriL.DfjRTjED7Y4vkqxzbxi2dNpBou', 1, TRUE, '$2a$10$992AErI/g5nnfGnraSh7NuoeZVOXYcPuPQ3hqi5FjjIlU0Dwfk0/a', '平台管理员', '20d78fb6abe9478cadc2e1cb5bf93a35', '13611806907', TRUE, '平台管理员', NULL, FALSE, 2, null, NULL, NULL, NULL, TRUE, TRUE, TRUE, TRUE, FALSE, 0, now(), 1, NULL, NULL, NULL, NULL);
INSERT INTO uc_org_user INSERT INTO uc_org_user
(user_id, org_id, administrator, deleted, create_by, create_time, update_by, update_time, proxy_by) (user_id, org_id, administrator, deleted, create_by, create_time, update_by, update_time, proxy_by)
VALUES(1, 1, 1, 0, 0, now(), NULL, NULL, NULL); VALUES(1, 1, TRUE, FALSE, 0, now(), NULL, NULL, NULL);
-- 平台uc_org_relation -- 平台uc_org_relation
INSERT INTO uc_org_relation INSERT INTO uc_org_relation
(org_id, org_type, parent_id, path, platform_code, platform_name, deleted, create_by, create_time, update_by, update_time, proxy_by) (org_id, org_type, parent_id, path, platform_code, platform_name, deleted, create_by, create_time, update_by, update_time, proxy_by)
VALUES(1, 1, 0, '1', 1, NULL, 0, NULL, NULL, NULL, NULL, NULL); VALUES(1, 1, 0, '1', 1, NULL, FALSE, NULL, NULL, NULL, NULL, NULL);

View File

@@ -81,7 +81,7 @@
<version>4.2</version> <version>4.2</version>
</dependency> </dependency>
<!--<dependency> <dependency>
<groupId>org.mapstruct</groupId> <groupId>org.mapstruct</groupId>
<artifactId>mapstruct-jdk8</artifactId> <artifactId>mapstruct-jdk8</artifactId>
<version>${org.mapstruct.version}</version> <version>${org.mapstruct.version}</version>
@@ -92,7 +92,7 @@
<artifactId>mapstruct-processor</artifactId> <artifactId>mapstruct-processor</artifactId>
<version>${org.mapstruct.version}</version> <version>${org.mapstruct.version}</version>
<scope>provided</scope> <scope>provided</scope>
</dependency>--> </dependency>
<dependency> <dependency>
<groupId>org.mapstruct</groupId> <groupId>org.mapstruct</groupId>
<artifactId>mapstruct</artifactId> <artifactId>mapstruct</artifactId>

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.senmesh.codesetting.dao.CodeSettingMapper"> <mapper namespace="com.senmesh.codesetting.dao.CodeSettingMapper">
@@ -16,7 +16,7 @@
<sql id="queryFromSql"> <sql id="queryFromSql">
FROM FROM
xs_code_setting t xs_code_setting t
WHERE t.deleted = 0 WHERE t.deleted = FALSE
<if test='param.id != null'> <if test='param.id != null'>
AND t.id = #{param.id} AND t.id = #{param.id}
</if> </if>

View File

@@ -13,16 +13,16 @@ public class RandomUtils {
/** /**
* 随机六位数 * 随机六位数
* @return * @return
* @author sr on 2020-01-02 * @author sr on 2020-01-02
*/ */
public static int nextSixInt() { public static int nextSixInt() {
return org.apache.commons.lang3.RandomUtils.nextInt(100000, 1000000); return org.apache.commons.lang3.RandomUtils.nextInt(100000, 1000000);
} }
/** /**
* 随机六位验证码 * 随机六位验证码
* @return * @return
* @author sr on 2020-01-02 * @author sr on 2020-01-02
*/ */
public static String nextSixVerificationCode() { public static String nextSixVerificationCode() {
return Integer.toString(RandomUtils.nextSixInt()); return Integer.toString(RandomUtils.nextSixInt());

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
@@ -8,7 +8,7 @@
* *
from uc_action_detail from uc_action_detail
where where
deleted = 0 deleted = FALSE
<if test="param.id != null"> <if test="param.id != null">
and id = #{param.id} and id = #{param.id}
</if> </if>

View File

@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.senmesh.component.action.dao.ActionMapper"> <mapper namespace="com.senmesh.component.action.dao.ActionMapper">
<select id="listActionDTO" resultType="com.senmesh.component.action.dto.ActionDTO"> <select id="listActionDTO" resultType="com.senmesh.component.action.dto.ActionDTO">
select t1.*,t2.nickname as createName select t1.*,t2.nickname as createName
from uc_action t1 left join uc_user t2 on t1.create_by = t2.id and t2.deleted = 0 from uc_action t1 left join uc_user t2 on t1.create_by = t2.id and t2.deleted = FALSE
where where
t1.deleted = 0 t1.deleted = FALSE
<if test="param.id != null"> <if test="param.id != null">
and id = #{param.id} and id = #{param.id}
</if> </if>

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
@@ -8,7 +8,7 @@
* *
from async_task_notice from async_task_notice
where where
deleted = 0 deleted = FALSE
<if test="param.id != null"> <if test="param.id != null">
and id = #{param.id} and id = #{param.id}
</if> </if>
@@ -30,7 +30,7 @@
,biz_status_str = #{param.bizStatusStr} ,biz_status_str = #{param.bizStatusStr}
</if> </if>
where where
deleted = 0 deleted = FALSE
and union_type = #{param.unionType} and union_type = #{param.unionType}
and union_id = #{param.unionId} and union_id = #{param.unionId}
and flow_status = 1 and flow_status = 1
@@ -40,7 +40,7 @@
update async_task_notice update async_task_notice
set notice_status = 2,update_time = now(), update_by = #{param.operateUserId} set notice_status = 2,update_time = now(), update_by = #{param.operateUserId}
where where
deleted = 0 deleted = FALSE
and create_by = #{param.operateUserId} and create_by = #{param.operateUserId}
and notice_status = 1 and notice_status = 1
<if test="param.id != null"> <if test="param.id != null">

View File

@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.senmesh.component.cardbin.dao.CardBinMapper"> <mapper namespace="com.senmesh.component.cardbin.dao.CardBinMapper">
<select id="findByCardBin" resultType="com.senmesh.component.cardbin.entity.CardBin"> <select id="findByCardBin" resultType="com.senmesh.component.cardbin.entity.CardBin">
select * from xs_card_bin where length(#{param1}) = card_length and locate(card_bin, #{param1}) = 1 and deleted = 0 select * from xs_card_bin where length(#{param1}) = card_length and POSITION(card_bin IN #{param1}) = 1 and deleted = FALSE
</select> </select>
<select id="selectAllCardBinList" resultType="com.senmesh.component.cardbin.entity.CardBin"> <select id="selectAllCardBinList" resultType="com.senmesh.component.cardbin.entity.CardBin">
@@ -20,7 +20,7 @@
FROM FROM
xs_card_bin xs_card_bin
WHERE WHERE
deleted = 0 deleted = FALSE
</select> </select>
</mapper> </mapper>

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
@@ -14,7 +14,7 @@
inner join xs_org o on o.id = c.org_id inner join xs_org o on o.id = c.org_id
inner join uc_user u on u.id = c.person_user_id inner join uc_user u on u.id = c.person_user_id
where where
c.deleted = 0 c.deleted = FALSE
<if test="param.id != null"> <if test="param.id != null">
and c.id = #{param.id} and c.id = #{param.id}
</if> </if>

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
@@ -8,7 +8,7 @@
* *
from xs_chat_msg from xs_chat_msg
where where
deleted = 0 deleted = FALSE
<if test="param.id != null"> <if test="param.id != null">
and id = #{param.id} and id = #{param.id}
</if> </if>

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
@@ -8,7 +8,7 @@
* *
from uc_import_main from uc_import_main
where where
deleted = 0 deleted = FALSE
<if test="param.id != null"> <if test="param.id != null">
and id = #{param.id} and id = #{param.id}
</if> </if>
@@ -69,7 +69,7 @@
</if> </if>
update_by = #{param.operateUserId}, update_by = #{param.operateUserId},
update_time = now() update_time = now()
where deleted = 0 where deleted = FALSE
and id = #{param.id} and id = #{param.id}
and import_status in and import_status in
<foreach collection="param.oldStatusSet" item="oldStatus" <foreach collection="param.oldStatusSet" item="oldStatus"

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
@@ -9,7 +9,7 @@
xs_dict dict xs_dict dict
inner join xs_dict_detail detail on dict.id = detail.dict_id inner join xs_dict_detail detail on dict.id = detail.dict_id
where where
dict.deleted = 0 and detail.deleted = 0 dict.deleted = FALSE and detail.deleted = FALSE
<if test='param.dictName != null and param.dictName.trim() != ""'> <if test='param.dictName != null and param.dictName.trim() != ""'>
<bind name="dictNameLike" value="'%' + param.dictName + '%'" /> <bind name="dictNameLike" value="'%' + param.dictName + '%'" />
AND dict.dict_name like #{dictNameLike} AND dict.dict_name like #{dictNameLike}

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
@@ -7,7 +7,7 @@
<select id="list" resultType="com.senmesh.component.dict.dto.DictDTO"> <select id="list" resultType="com.senmesh.component.dict.dto.DictDTO">
SELECT * FROM xs_dict SELECT * FROM xs_dict
<where> <where>
deleted = 0 deleted = FALSE
<if test='param.dictId != null'> <if test='param.dictId != null'>
AND id = #{param.dictId} AND id = #{param.dictId}
</if> </if>

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
@@ -8,7 +8,7 @@
* *
from uc_dynamic_table from uc_dynamic_table
where where
deleted = 0 deleted = FALSE
<if test="param.id != null"> <if test="param.id != null">
and id = #{param.id} and id = #{param.id}
</if> </if>

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
@@ -6,7 +6,7 @@
<select id="getExceptionRecordCount" resultType="java.lang.Integer"> <select id="getExceptionRecordCount" resultType="java.lang.Integer">
select count(1) size from xs_exception_record where deleted=0; select count(1) size from xs_exception_record where deleted = FALSE;
</select> </select>
</mapper> </mapper>

View File

@@ -13,16 +13,25 @@ public class FileProperties {
/** 文件上传路径 **/ /** 文件上传路径 **/
private String uploadDir; private String uploadDir;
/** 传输发送目录 **/
private String transferSendDir;
/** 传输接收目录 **/
private String transferReceiveDir;
private final Storage storage = new Storage(); private final Storage storage = new Storage();
/** 文件位置:1内网2外网 **/
private String location;
@Data @Data
@NoArgsConstructor @NoArgsConstructor
public static class Storage{ public static class Storage{
private String type; private String type;
private final AliStorage ali = new AliStorage(); private final AliStorage ali = new AliStorage();
} }
@Data @Data
@NoArgsConstructor @NoArgsConstructor
public static class AliStorage{ public static class AliStorage{

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
@@ -12,7 +12,7 @@
AND deleted = #{param.deleted} AND deleted = #{param.deleted}
</when> </when>
<otherwise> <otherwise>
AND deleted = 0 AND deleted = FALSE
</otherwise> </otherwise>
</choose> </choose>
<if test='param.classCode != null and param.classCode.trim() != ""'> <if test='param.classCode != null and param.classCode.trim() != ""'>
@@ -35,7 +35,7 @@
AND deleted = #{param.deleted} AND deleted = #{param.deleted}
</when> </when>
<otherwise> <otherwise>
AND deleted = 0 AND deleted = FALSE
</otherwise> </otherwise>
</choose> </choose>
<if test='param.fileCode != null'> <if test='param.fileCode != null'>

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
@@ -18,7 +18,7 @@
<select id="find" resultType="com.senmesh.component.file.entity.FileRecord"> <select id="find" resultType="com.senmesh.component.file.entity.FileRecord">
SELECT * FROM xs_file_record SELECT * FROM xs_file_record
<where> <where>
deleted = 0 deleted = FALSE
<if test='param.fileCode != null'> <if test='param.fileCode != null'>
AND file_code = #{param.fileCode} AND file_code = #{param.fileCode}
</if> </if>
@@ -35,7 +35,7 @@
<select id="findFilePathByCode" resultType="java.lang.String"> <select id="findFilePathByCode" resultType="java.lang.String">
SELECT file_path FROM xs_file_record SELECT file_path FROM xs_file_record
<where> <where>
deleted = 0 deleted = FALSE
<if test='param.fileCode != null'> <if test='param.fileCode != null'>
AND file_code = #{param.fileCode} AND file_code = #{param.fileCode}
</if> </if>

View File

@@ -106,10 +106,10 @@ public interface FileService {
* @param fileName * @param fileName
* @param is * @param is
* @return * @return
* @author sr on 2023-12-07 * @author sr on 2023-12-07
*/ */
FileRecord uploadTemp(String fileName, InputStream is); FileRecord uploadTemp(String fileName, InputStream is);
InputStream getFile(String fileCode); InputStream getFile(String fileCode);
} }

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
@@ -8,7 +8,7 @@
SET deleted = TRUE, SET deleted = TRUE,
update_time = NOW(), update_time = NOW(),
update_by = #{userId} update_by = #{userId}
WHERE deleted = 0 WHERE deleted = FALSE
AND config_code = #{configCode} AND config_code = #{configCode}
</update> </update>
@@ -21,8 +21,8 @@
SELECT t.* ,o.org_name,o.id orgId SELECT t.* ,o.org_name,o.id orgId
FROM FROM
xs_config t xs_config t
LEFT JOIN xs_org o ON t.org_id = o.id AND o.deleted = 0 LEFT JOIN xs_org o ON t.org_id = o.id AND o.deleted = FALSE
WHERE t.deleted = 0 WHERE t.deleted = FALSE
<if test='param.id != null'> <if test='param.id != null'>
AND t.id = #{param.id} AND t.id = #{param.id}
</if> </if>
@@ -67,7 +67,7 @@
<sql id="queryFromSql"> <sql id="queryFromSql">
FROM FROM
xs_config t xs_config t
WHERE t.deleted = 0 WHERE t.deleted = FALSE
<if test='param.id != null'> <if test='param.id != null'>
AND t.id = #{param.id} AND t.id = #{param.id}
</if> </if>
@@ -113,7 +113,7 @@
AND deleted = #{param.deleted} AND deleted = #{param.deleted}
</when> </when>
<otherwise> <otherwise>
AND deleted = 0 AND deleted = FALSE
</otherwise> </otherwise>
</choose> </choose>
<choose> <choose>
@@ -121,7 +121,7 @@
AND enable = #{param.enable} AND enable = #{param.enable}
</when> </when>
<otherwise> <otherwise>
AND enable = 1 AND enable = TRUE
</otherwise> </otherwise>
</choose> </choose>
<if test='param.orgId != null'> <if test='param.orgId != null'>
@@ -139,8 +139,8 @@
FROM FROM
xs_config c xs_config c
WHERE WHERE
c.deleted = 0 c.deleted = FALSE
AND c.enable = 1 AND c.enable = TRUE
<if test="orgIds != null"> <if test="orgIds != null">
AND org_id in AND org_id in
<foreach close=")" collection="orgIds" index="index" item="orgId" open="(" <foreach close=")" collection="orgIds" index="index" item="orgId" open="("
@@ -155,7 +155,7 @@
<select id="existConfigCode" resultType="int"> <select id="existConfigCode" resultType="int">
select count(*) select count(*)
from xs_config from xs_config
where org_id = #{orgId} and config_code = #{configCode} and deleted = 0 where org_id = #{orgId} and config_code = #{configCode} and deleted = FALSE
<if test="configId != null"> <if test="configId != null">
and id != #{configId} and id != #{configId}
</if> </if>
@@ -167,19 +167,19 @@
from xs_config from xs_config
where config_code = #{configCode} where config_code = #{configCode}
and org_id = #{orgId} and org_id = #{orgId}
and deleted = 0 and deleted = FALSE
union union
select * select *
from xs_config from xs_config
where config_code = #{configCode} where config_code = #{configCode}
and org_id = #{platformOrgId} and org_id = #{platformOrgId}
and deleted = 0) a limit 1 and deleted = FALSE) a limit 1
</select> </select>
<select id="queryOrgConfigByCode" resultType="com.senmesh.config.dto.ConfigDTO"> <select id="queryOrgConfigByCode" resultType="com.senmesh.config.dto.ConfigDTO">
select * select *
from xs_config from xs_config
where deleted = 0 where deleted = FALSE
and org_id = #{orgId} and org_id = #{orgId}
and config_code = #{configCode} limit 1 and config_code = #{configCode} limit 1
</select> </select>
@@ -187,11 +187,11 @@
SELECT o.id, SELECT o.id,
o.org_name o.org_name
FROM xs_org o FROM xs_org o
WHERE o.deleted = 0 WHERE o.deleted = FALSE
AND o.enable = 1 AND o.enable = TRUE
AND o.id NOT IN (SELECT t.org_id AND o.id NOT IN (SELECT t.org_id
FROM xs_config t FROM xs_config t
WHERE t.deleted = 0 WHERE t.deleted = FALSE
AND t.config_code = #{configCode}) AND t.config_code = #{configCode})
</select> </select>
@@ -217,6 +217,6 @@
FROM xs_config FROM xs_config
WHERE org_id = #{param.orgId} WHERE org_id = #{param.orgId}
and config_code = #{param.configCode} and config_code = #{param.configCode}
and deleted = 0) and deleted = FALSE)
</insert> </insert>
</mapper> </mapper>

View File

@@ -28,9 +28,9 @@ import com.senmesh.mq.util.MqSendUtils;
/** /**
* @author sr on 2020-07-22 * @author sr on 2020-07-22
*/ */
@Configuration /*@Configuration
@EnableConfigurationProperties(RabbitCustomProperties.class) @EnableConfigurationProperties(RabbitCustomProperties.class)
@AutoConfigureAfter(CommonConfiguration.class) @AutoConfigureAfter(CommonConfiguration.class)*/
public class RabbitMqConfiguration { public class RabbitMqConfiguration {
public static final String DEFAULT_EXCHANGE_NAME = "alita_exchange"; public static final String DEFAULT_EXCHANGE_NAME = "alita_exchange";

View File

@@ -22,7 +22,7 @@ public interface CaptchaRequestMapMapper {
* @author sr on 2020-08-10 * @author sr on 2020-08-10
*/ */
@Mappings({ @Mappings({
@Mapping(target = "captchaType", constant = "9") @Mapping(target = "captchaType", constant = "9l")
}) })
DescribeCaptchaResultRequest toRequest(TencentCaptchaDTO dto); DescribeCaptchaResultRequest toRequest(TencentCaptchaDTO dto);

View File

@@ -22,7 +22,7 @@ public interface UserMapMapper {
* @return * @return
* @author sr on 2020-06-08 * @author sr on 2020-06-08
*/ */
@Mapping(target = "tag", expression = "java(com.newyetai.common.util.RandomUtils.getRandomString(6))") @Mapping(target = "tag", expression = "java(com.senmesh.common.util.RandomUtils.getRandomString(6))")
SecurityUserDTO dtoToDto(UserDetailDTO userDto); SecurityUserDTO dtoToDto(UserDetailDTO userDto);

View File

@@ -0,0 +1,59 @@
package com.senmesh.sfile.constant;
/**
* 文件位置枚举
*/
public enum FileLocationEnum {
/**
* 内网
*/
INTERNAL("1", "内网"),
/**
* 外网
*/
EXTERNAL("2", "外网");
private final String location;
private final String desc;
FileLocationEnum(String location, String desc) {
this.location = location;
this.desc = desc;
}
public String getLocation() {
return location;
}
public String getDesc() {
return desc;
}
/**
* 根据位置获取枚举
*
* @param location 位置
* @return FileLocationEnum
*/
public static FileLocationEnum getByLocation(String location) {
for (FileLocationEnum fileLocationEnum : FileLocationEnum.values()) {
if (fileLocationEnum.getLocation().equals(location)) {
return fileLocationEnum;
}
}
return null;
}
/**
* 判断是否为内网
*
* @param location 位置
* @return true-内网,false-外网
*/
public static boolean isInternal(String location) {
return INTERNAL.getLocation().equals(location);
}
}

View File

@@ -43,7 +43,7 @@ public class NormalUserFileController {
@PostMapping("/create") @PostMapping("/create")
@ApiOperation("创建") @ApiOperation("创建")
public AlitaResult<Long> create(@Validated @RequestBody UserFileCreateDTO createDTO) { public AlitaResult<UserFileDTO> create(@Validated @RequestBody UserFileCreateDTO createDTO) {
return AlitaResult.success(normalUserFileService.create(createDTO)); return AlitaResult.success(normalUserFileService.create(createDTO));
} }

View File

@@ -0,0 +1,32 @@
package com.senmesh.sfile.controller;
import com.senmesh.common.AlitaResult;
import com.senmesh.sfile.dto.TransferUserFileCreateDTO;
import com.senmesh.sfile.service.TransferUserFileService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* 传输用户文件Controller
*/
@RestController
@RequestMapping("transfer_user_file")
@Api(tags = "传输用户文件")
public class TransferUserFileController {
@Autowired
private TransferUserFileService transferUserFileService;
@PostMapping("/create")
@ApiOperation("创建")
public AlitaResult<Long> create(@Validated @RequestBody TransferUserFileCreateDTO createDTO) {
return AlitaResult.success(transferUserFileService.create(createDTO));
}
}

View File

@@ -29,11 +29,11 @@ public class UserFileController {
@Autowired @Autowired
private UserFileService userFileService; private UserFileService userFileService;
@PostMapping("/create") /* @PostMapping("/create")
@ApiOperation("创建") @ApiOperation("创建")
public AlitaResult<Long> create(@Validated @RequestBody UserFileCreateDTO createDTO) { public AlitaResult<Long> create(@Validated @RequestBody UserFileCreateDTO createDTO) {
return AlitaResult.success(userFileService.create(createDTO)); return AlitaResult.success(userFileService.create(createDTO));
} }*/
@PostMapping("/modify") @PostMapping("/modify")
@ApiOperation("修改") @ApiOperation("修改")

View File

@@ -0,0 +1,32 @@
package com.senmesh.sfile.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.List;
/**
* 扩展用户文件DTO
*/
@ApiModel("扩展用户文件DTO")
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ExpandUserFileDTO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty("文件夹信息")
private UserFileDTO folder;
@ApiModelProperty("文件列表")
private List<UserFileDTO> files;
}

View File

@@ -15,7 +15,7 @@ import lombok.experimental.SuperBuilder;
*/ */
@ApiModel("文件种类查询DTO") @ApiModel("文件种类查询DTO")
@Data @Data
@SuperBuilder @Builder
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)

View File

@@ -0,0 +1,28 @@
package com.senmesh.sfile.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* 传输元数据DTO
*/
@ApiModel("传输元数据DTO")
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class TransferMetadataDTO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty("扩展用户文件DTO")
private ExpandUserFileDTO expandUserFile;
}

View File

@@ -0,0 +1,32 @@
package com.senmesh.sfile.dto;
import com.senmesh.common.dto.BaseOperateDTO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import javax.validation.constraints.NotNull;
/**
* 传输用户文件创建DTO
*/
@ApiModel("传输用户文件创建DTO")
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
public class TransferUserFileCreateDTO extends BaseOperateDTO {
private static final long serialVersionUID = 1L;
@ApiModelProperty("用户文件ID")
@NotNull(message = "用户文件ID不能为空")
private Long userFileId;
}

View File

@@ -30,7 +30,7 @@ public class UserFileCreateDTO extends BaseOperateDTO {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ApiModelProperty("用户id") @ApiModelProperty("用户id")
@NotNull(message = "用户id不能为空") // @NotNull(message = "用户id不能为空")
private Long userId; private Long userId;
@ApiModelProperty("根类型:1普通/2内穿外/3外传内/4我的分享") @ApiModelProperty("根类型:1普通/2内穿外/3外传内/4我的分享")

View File

@@ -44,6 +44,9 @@ public class UserFileDTO extends BaseDTO {
@ApiModelProperty("文件编码") @ApiModelProperty("文件编码")
private String fileCode; private String fileCode;
@ApiModelProperty("文件大小")
private Long fileSize;
@ApiModelProperty("文件状态:1正常2失效11解析中12待审核13传输中14失败") @ApiModelProperty("文件状态:1正常2失效11解析中12待审核13传输中14失败")
private String fileStatus; private String fileStatus;

View File

@@ -4,6 +4,7 @@ import com.senmesh.common.dto.PageQueryDTO;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
@@ -14,7 +15,7 @@ import lombok.experimental.SuperBuilder;
*/ */
@ApiModel("用户文件查询DTO") @ApiModel("用户文件查询DTO")
@Data @Data
@SuperBuilder @Builder
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)

View File

@@ -4,6 +4,7 @@ import com.senmesh.common.dto.PageQueryDTO;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
@@ -14,7 +15,7 @@ import lombok.experimental.SuperBuilder;
*/ */
@ApiModel("用户空间查询DTO") @ApiModel("用户空间查询DTO")
@Data @Data
@SuperBuilder @Builder
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)

View File

@@ -0,0 +1,39 @@
package com.senmesh.sfile.job;
import com.senmesh.common.annotation.AlitaStopWatch;
import com.senmesh.component.file.config.FileProperties;
import com.senmesh.sfile.service.TransferFileMonitorService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
/**
* 传输文件监听定时任务
*/
@Component
@Slf4j
public class TransferFileMonitorJob {
@Autowired
private TransferFileMonitorService transferFileMonitorService;
@Autowired
private FileProperties fileProperties;
/**
* 定时扫描传输目录
* 默认每分钟执行一次
*/
@Scheduled(cron = "${file.transfer.monitor.cron:0 */1 * * * ?}")
@AlitaStopWatch
public void execute() {
try {
log.debug("开始扫描传输目录");
transferFileMonitorService.scanAndProcess();
} catch (Exception e) {
log.error("传输文件监听处理失败", e);
}
}
}

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.senmesh.sfile.dao.FileCategoryMapper"> <mapper namespace="com.senmesh.sfile.dao.FileCategoryMapper">
@@ -11,7 +11,7 @@
<sql id="queryFromSql"> <sql id="queryFromSql">
FROM x_file_category t FROM x_file_category t
WHERE t.deleted = 0 WHERE t.deleted = FALSE
<if test='param.id != null'> <if test='param.id != null'>
AND t.id = #{param.id} AND t.id = #{param.id}
</if> </if>

View File

@@ -1,17 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.senmesh.sfile.dao.UserFileMapper"> <mapper namespace="com.senmesh.sfile.dao.UserFileMapper">
<select id="list" resultType="com.senmesh.sfile.dto.UserFileDTO"> <select id="list" resultType="com.senmesh.sfile.dto.UserFileDTO">
SELECT t.* SELECT t.*, fr.file_size
<include refid="queryFromSql"></include> <include refid="queryFromSql"></include>
ORDER BY t.id DESC ORDER BY t.id DESC
</select> </select>
<sql id="queryFromSql"> <sql id="queryFromSql">
FROM x_user_file t FROM x_user_file t
WHERE t.deleted = 0 LEFT JOIN xs_file_record fr ON t.file_code = fr.file_code AND fr.deleted = FALSE
WHERE t.deleted = FALSE
<if test='param.id != null'> <if test='param.id != null'>
AND t.id = #{param.id} AND t.id = #{param.id}
</if> </if>
@@ -48,12 +49,10 @@
<update id="updatePathByParentIdChange"> <update id="updatePathByParentIdChange">
UPDATE x_user_file child UPDATE x_user_file child
INNER JOIN x_user_file current ON current.id = #{fileId} AND current.deleted = 0 SET path = CASE
LEFT JOIN x_user_file parent ON parent.id = #{newParentId} AND parent.deleted = 0
SET child.path = CASE
WHEN child.id = #{fileId} THEN WHEN child.id = #{fileId} THEN
CASE CASE
WHEN #{newParentId} = 0 THEN CAST(#{fileId} AS CHAR) WHEN #{newParentId} = 0 THEN CAST(#{fileId} AS VARCHAR)
ELSE CONCAT(parent.path, ',', #{fileId}) ELSE CONCAT(parent.path, ',', #{fileId})
END END
ELSE ELSE
@@ -63,35 +62,44 @@
WHEN #{newParentId} = 0 THEN CONCAT(#{fileId}, ',') WHEN #{newParentId} = 0 THEN CONCAT(#{fileId}, ',')
ELSE CONCAT(parent.path, ',', #{fileId}, ',') ELSE CONCAT(parent.path, ',', #{fileId}, ',')
END) END)
END END,
WHERE (child.id = #{fileId} OR child.path LIKE CONCAT(current.path, ',%')) update_by = #{operateUserId},
AND child.deleted = 0 update_time = NOW()
FROM x_user_file current
LEFT JOIN x_user_file parent ON parent.id = #{newParentId} AND parent.deleted = FALSE
WHERE current.id = #{fileId}
AND current.deleted = FALSE
AND (child.id = #{fileId} OR child.path LIKE CONCAT(current.path, ',%'))
AND child.deleted = FALSE
AND child.user_id = current.user_id AND child.user_id = current.user_id
AND child.root_type = current.root_type AND child.root_type = current.root_type
</update> </update>
<update id="deleteFileWithChildren"> <update id="deleteFileWithChildren">
UPDATE x_user_file child UPDATE x_user_file child
INNER JOIN x_user_file current ON current.id = #{fileId} AND current.deleted = 0 SET deleted = TRUE,
SET child.deleted = 1, update_by = #{operateUserId},
child.update_by = #{operateUserId}, update_time = NOW()
child.update_time = NOW() FROM x_user_file current
WHERE (child.id = #{fileId} OR child.path LIKE CONCAT(current.path, ',%')) WHERE current.id = #{fileId}
AND child.deleted = 0 AND current.deleted = FALSE
AND (child.id = #{fileId} OR child.path LIKE CONCAT(current.path, ',%'))
AND child.deleted = FALSE
AND child.user_id = current.user_id AND child.user_id = current.user_id
AND child.root_type = current.root_type AND child.root_type = current.root_type
</update> </update>
<update id="updateStatusWithChildren"> <update id="updateStatusWithChildren">
UPDATE x_user_file child UPDATE x_user_file child
INNER JOIN x_user_file current ON current.id = #{fileId} SET file_status = #{newStatus},
AND current.deleted = 0 update_by = #{operateUserId},
update_time = NOW()
FROM x_user_file current
WHERE current.id = #{fileId}
AND current.deleted = FALSE
AND current.file_status = #{oldStatus} AND current.file_status = #{oldStatus}
SET child.file_status = #{newStatus}, AND (child.id = #{fileId} OR child.path LIKE CONCAT(current.path, ',%'))
child.update_by = #{operateUserId}, AND child.deleted = FALSE
child.update_time = NOW()
WHERE (child.id = #{fileId} OR child.path LIKE CONCAT(current.path, ',%'))
AND child.deleted = 0
AND child.user_id = current.user_id AND child.user_id = current.user_id
AND child.root_type = current.root_type AND child.root_type = current.root_type
</update> </update>

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.senmesh.sfile.dao.UserSpaceMapper"> <mapper namespace="com.senmesh.sfile.dao.UserSpaceMapper">
@@ -11,7 +11,7 @@
<sql id="queryFromSql"> <sql id="queryFromSql">
FROM x_user_space t FROM x_user_space t
WHERE t.deleted = 0 WHERE t.deleted = FALSE
<if test='param.id != null'> <if test='param.id != null'>
AND t.id = #{param.id} AND t.id = #{param.id}
</if> </if>

View File

@@ -1,6 +1,7 @@
package com.senmesh.sfile.service; package com.senmesh.sfile.service;
import com.senmesh.sfile.dto.UserFileCreateDTO; import com.senmesh.sfile.dto.UserFileCreateDTO;
import com.senmesh.sfile.dto.UserFileDTO;
/** /**
* 普通用户文件Service * 普通用户文件Service
@@ -11,8 +12,8 @@ public interface NormalUserFileService {
* 创建普通用户文件 * 创建普通用户文件
* *
* @param createDTO 创建DTO * @param createDTO 创建DTO
* @return 主键ID * @return UserFileDTO
*/ */
Long create(UserFileCreateDTO createDTO); UserFileDTO create(UserFileCreateDTO createDTO);
} }

View File

@@ -0,0 +1,22 @@
package com.senmesh.sfile.service;
import java.nio.file.Path;
/**
* 传输文件监听服务
*/
public interface TransferFileMonitorService {
/**
* 扫描并处理传输目录中的文件
*/
void scanAndProcess();
/**
* 解包单个传输文件
*
* @param zipFilePath zip文件路径
*/
void unpackTransferFile(Path zipFilePath);
}

View File

@@ -0,0 +1,19 @@
package com.senmesh.sfile.service;
import com.senmesh.sfile.dto.TransferUserFileCreateDTO;
/**
* 传输用户文件Service
*/
public interface TransferUserFileService {
/**
* 创建传输用户文件
* 根据 FileProperties#location 的类型决定是内穿外还是外传内
*
* @param createDTO 创建DTO
* @return 主键ID
*/
Long create(TransferUserFileCreateDTO createDTO);
}

View File

@@ -1,6 +1,7 @@
package com.senmesh.sfile.service; package com.senmesh.sfile.service;
import com.senmesh.sfile.dto.ExpandUserFileCreateDTO; import com.senmesh.sfile.dto.ExpandUserFileCreateDTO;
import com.senmesh.sfile.dto.ExpandUserFileDTO;
import com.senmesh.sfile.dto.UserFileCreateDTO; import com.senmesh.sfile.dto.UserFileCreateDTO;
import com.senmesh.sfile.dto.UserFileDTO; import com.senmesh.sfile.dto.UserFileDTO;
import com.senmesh.sfile.dto.UserFileModifyDTO; import com.senmesh.sfile.dto.UserFileModifyDTO;
@@ -18,18 +19,30 @@ public interface UserFileService {
* 创建用户文件 * 创建用户文件
* *
* @param createDTO 创建DTO * @param createDTO 创建DTO
* @return 主键ID * @return UserFileDTO
*/ */
Long create(UserFileCreateDTO createDTO); UserFileDTO create(UserFileCreateDTO createDTO);
/** /**
* 根据普通文件创建新的文件(复制) * 根据普通文件创建新的文件(复制)
* 创建一个文件夹,文件名为原文件名+时间戳,然后复制原文件下所有文件类型的子文件 * 创建一个文件夹,文件名为原文件名+时间戳,然后复制原文件下所有文件类型的子文件
* *
* @param expandCreateDTO 扩展创建DTO * @param expandCreateDTO 扩展创建DTO
* @return 新创建的文件夹ID * @return 扩展用户文件DTO(包含文件夹信息和文件列表)
*/ */
Long create(ExpandUserFileCreateDTO expandCreateDTO); ExpandUserFileDTO create(ExpandUserFileCreateDTO expandCreateDTO);
/**
* 根据文件夹和文件列表创建文件夹和文件(用于传输文件解包)
* 1. 从 folder 中获取 userId 和 rootType
* 2. 创建文件夹
* 3. 遍历文件列表,通过 fileCode 获取文件流,上传文件获取新的 fileCode,然后创建用户文件记录
*
* @param folder 文件夹信息(包含 userId、rootType、fileName 等)
* @param files 文件列表(每个文件包含 fileCode、fileName 等)
* @return 扩展用户文件DTO(包含创建后的文件夹信息和文件列表)
*/
ExpandUserFileDTO create(UserFileDTO folder, List<UserFileDTO> files);
/** /**
* 修改用户文件 * 修改用户文件

View File

@@ -4,6 +4,7 @@ import com.senmesh.common.util.UserContextHolder;
import com.senmesh.sfile.constant.FileStatusEnum; import com.senmesh.sfile.constant.FileStatusEnum;
import com.senmesh.sfile.constant.RootTypeEnum; import com.senmesh.sfile.constant.RootTypeEnum;
import com.senmesh.sfile.dto.UserFileCreateDTO; import com.senmesh.sfile.dto.UserFileCreateDTO;
import com.senmesh.sfile.dto.UserFileDTO;
import com.senmesh.sfile.service.NormalUserFileService; import com.senmesh.sfile.service.NormalUserFileService;
import com.senmesh.sfile.service.UserFileService; import com.senmesh.sfile.service.UserFileService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@@ -21,7 +22,7 @@ public class NormalUserFileServiceImpl implements NormalUserFileService {
@Override @Override
@Transactional @Transactional
public Long create(UserFileCreateDTO createDTO) { public UserFileDTO create(UserFileCreateDTO createDTO) {
createDTO.setUserId(UserContextHolder.getExistLoginUserId()); createDTO.setUserId(UserContextHolder.getExistLoginUserId());
// 设置根类型为普通 // 设置根类型为普通
createDTO.setRootType(RootTypeEnum.NORMAL.getType()); createDTO.setRootType(RootTypeEnum.NORMAL.getType());

View File

@@ -1,5 +1,6 @@
package com.senmesh.sfile.service.impl; package com.senmesh.sfile.service.impl;
import com.senmesh.common.util.RandomUtils;
import com.senmesh.common.util.UserContextHolder; import com.senmesh.common.util.UserContextHolder;
import com.senmesh.sfile.constant.FileStatusEnum; import com.senmesh.sfile.constant.FileStatusEnum;
import com.senmesh.sfile.constant.RootTypeEnum; import com.senmesh.sfile.constant.RootTypeEnum;
@@ -36,15 +37,19 @@ public class ShareUserFileServiceImpl implements ShareUserFileService {
calendar.add(Calendar.DAY_OF_MONTH, validDays); calendar.add(Calendar.DAY_OF_MONTH, validDays);
Date endTime = calendar.getTime(); Date endTime = calendar.getTime();
// 生成随机6位数字访问码
String accessCode = RandomUtils.nextSixVerificationCode();
// 调用UserFileService的重载create方法,根据普通文件创建分享文件 // 调用UserFileService的重载create方法,根据普通文件创建分享文件
ExpandUserFileCreateDTO expandCreateDTO = ExpandUserFileCreateDTO.builder() ExpandUserFileCreateDTO expandCreateDTO = ExpandUserFileCreateDTO.builder()
.userFileId(userFileId) .userFileId(userFileId)
.userId(userId) .userId(userId)
.rootType(RootTypeEnum.SHARE.getType()) .rootType(RootTypeEnum.SHARE.getType())
.fileStatus(FileStatusEnum.NORMAL.getStatus()) .fileStatus(FileStatusEnum.NORMAL.getStatus())
.accessCode(accessCode)
.endTime(endTime) .endTime(endTime)
.build(); .build();
return userFileService.create(expandCreateDTO); return userFileService.create(expandCreateDTO).getFolder().getId();
} }
} }

View File

@@ -0,0 +1,455 @@
package com.senmesh.sfile.service.impl;
import com.senmesh.common.exception.util.Assert;
import com.senmesh.common.util.JsonUtils;
import com.senmesh.component.file.config.FileProperties;
import com.senmesh.component.file.service.FileService;
import com.senmesh.sfile.constant.FileLocationEnum;
import com.senmesh.sfile.constant.FileStatusEnum;
import com.senmesh.sfile.constant.FileTypeEnum;
import com.senmesh.sfile.constant.RootTypeEnum;
import com.senmesh.sfile.dto.ExpandUserFileDTO;
import com.senmesh.sfile.dto.TransferMetadataDTO;
import com.senmesh.sfile.dto.UserFileCreateDTO;
import com.senmesh.sfile.dto.UserFileDTO;
import com.senmesh.sfile.dto.UserFileModifyStatusDTO;
import com.senmesh.sfile.service.TransferFileMonitorService;
import com.senmesh.sfile.service.UserFileService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.attribute.FileTime;
import java.util.Comparator;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
import java.util.zip.ZipInputStream;
/**
* 传输文件监听服务实现
*/
@Service
@Slf4j
public class TransferFileMonitorServiceImpl implements TransferFileMonitorService {
@Autowired
private FileProperties fileProperties;
@Autowired
private UserFileService userFileService;
@Autowired
private FileService fileService;
@Override
public void scanAndProcess() {
String transferReceiveDir = fileProperties.getTransferReceiveDir();
Path receiveDir = Paths.get(transferReceiveDir);
try {
if (!Files.exists(receiveDir)) {
Files.createDirectories(receiveDir);
log.info("创建接收目录: {}", receiveDir);
return;
}
// 1. 扫描 .zip 文件(解包逻辑)
List<Path> zipFiles = Files.list(receiveDir)
.filter(Files::isRegularFile)
.filter(p -> p.toString().endsWith(".zip"))
.filter(p -> !p.toString().endsWith(".tmp"))
.sorted(Comparator.comparing(p -> {
try {
return Files.getLastModifiedTime(p);
} catch (IOException e) {
return FileTime.fromMillis(0);
}
}))
.limit(10)
.collect(Collectors.toList());
if (!zipFiles.isEmpty()) {
log.info("发现 {} 个待处理的传输文件", zipFiles.size());
for (Path zipFile : zipFiles) {
processZipFile(zipFile);
}
}
// 2. 扫描 .finish 文件(完成标记逻辑)
List<Path> finishFiles = Files.list(receiveDir)
.filter(Files::isRegularFile)
.filter(p -> p.toString().endsWith(".finish"))
.sorted(Comparator.comparing(p -> {
try {
return Files.getLastModifiedTime(p);
} catch (IOException e) {
return FileTime.fromMillis(0);
}
}))
.limit(10)
.collect(Collectors.toList());
if (!finishFiles.isEmpty()) {
log.info("发现 {} 个完成标记文件", finishFiles.size());
for (Path finishFile : finishFiles) {
processFinishFile(finishFile);
}
}
} catch (Exception e) {
log.error("扫描传输目录失败", e);
}
}
/**
* 处理单个 ZIP 文件(解包逻辑)
*/
private void processZipFile(Path zipFile) {
String fileName = zipFile.getFileName().toString();
try {
// 1. 校验 ZIP 包内文件大小是否匹配,并返回元数据
TransferMetadataDTO metadata = verifyFileMD5(zipFile);
if (metadata == null) {
// 校验不通过,跳过
return;
}
log.info("文件大小校验通过,开始解包: {}", fileName);
// 2. 解包并创建用户文件(传入已解析的元数据,直接创建为正常状态)
ExpandUserFileDTO result = unpackTransferFileInternal(zipFile, metadata);
// 3. 创建 .finish 文件到发送目录,告诉发送方处理完成
createFinishFile(fileName);
// 4. 删除已处理的 ZIP 文件
Files.delete(zipFile);
log.info("处理完成,已删除 ZIP 文件: {}", fileName);
} catch (Exception e) {
log.error("处理文件失败,跳过: {}", fileName, e);
}
}
/**
* 校验文件大小(对比元数据中的大小)
*
* @param zipFile ZIP 文件路径
* @return 校验通过返回 TransferMetadataDTO,否则返回 null
*/
private TransferMetadataDTO verifyFileMD5(Path zipFile) {
String fileName = zipFile.getFileName().toString();
try (ZipFile zf = new ZipFile(zipFile.toFile())) {
// 1. 读取元数据
ZipEntry metadataEntry = zf.getEntry("transferMetadata.json");
if (metadataEntry == null) {
log.debug("ZIP 文件缺少 transferMetadata.json,跳过(可能还在传输中): {}", fileName);
return null;
}
TransferMetadataDTO metadata;
try (InputStream is = zf.getInputStream(metadataEntry)) {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
byte[] buffer = new byte[1024];
int len;
while ((len = is.read(buffer)) > 0) {
baos.write(buffer, 0, len);
}
String metadataJson = new String(baos.toByteArray(), StandardCharsets.UTF_8);
metadata = JsonUtils.toObject(metadataJson, TransferMetadataDTO.class);
}
// 2. 检查是否包含 ExpandUserFileDTO
ExpandUserFileDTO expandUserFile = metadata.getExpandUserFile();
if (expandUserFile == null || expandUserFile.getFiles() == null) {
log.debug("元数据中不包含文件信息,跳过(可能还在传输中): {}", fileName);
return null;
}
// 3. 创建 userFileId -> fileSize 的映射
Map<Long, Long> expectedSizeMap = new HashMap<>();
for (UserFileDTO file : expandUserFile.getFiles()) {
if (file.getFileSize() != null) {
expectedSizeMap.put(file.getId(), file.getFileSize());
}
}
if (expectedSizeMap.isEmpty()) {
log.debug("元数据中不包含文件大小信息,跳过(可能还在传输中): {}", fileName);
return null;
}
log.info("开始校验文件大小: {}", fileName);
// 4. 遍历 ZIP 中的文件,对比大小
Enumeration<? extends ZipEntry> entries = zf.entries();
int fileCount = 0;
int successCount = 0;
while (entries.hasMoreElements()) {
ZipEntry entry = entries.nextElement();
// 跳过目录和元数据文件
if (entry.isDirectory() || "transferMetadata.json".equals(entry.getName())) {
continue;
}
fileCount++;
// 提取 userFileId(去掉路径)
String entryName = entry.getName();
String userFileIdStr = entryName.contains("/")
? entryName.substring(entryName.lastIndexOf("/") + 1)
: entryName;
// 解析 userFileId
Long userFileId;
try {
userFileId = Long.parseLong(userFileIdStr);
} catch (NumberFormatException e) {
log.warn("无法解析 userFileId: {}", userFileIdStr);
continue;
}
// 获取期望的文件大小
Long expectedSize = expectedSizeMap.get(userFileId);
if (expectedSize == null) {
log.warn("元数据中未找到文件大小信息: userFileId={}", userFileId);
continue;
}
// 获取实际文件大小
long actualSize = entry.getSize();
// 对比大小
if (actualSize != expectedSize) {
log.error("文件大小不匹配: userFileId={}, 期望={} bytes, 实际={} bytes",
userFileId, expectedSize, actualSize);
return null;
}
successCount++;
log.debug("文件大小校验通过: userFileId={} ({} bytes)", userFileId, actualSize);
}
// 5. 检查文件数量是否匹配
if (fileCount == 0 || successCount != expectedSizeMap.size()) {
log.debug("文件数量不匹配: 期望={}, 实际={}, 跳过(可能还在传输中): {}",
expectedSizeMap.size(), successCount, fileName);
return null;
}
log.info("文件大小校验通过: {} (共 {} 个文件)", fileName, successCount);
return metadata;
} catch (Exception e) {
log.error("文件大小校验失败: {}", fileName, e);
return null;
}
}
@Override
@Transactional
public void unpackTransferFile(Path zipFilePath) {
// 先校验并获取元数据
TransferMetadataDTO metadata = verifyFileMD5(zipFilePath);
if (metadata == null) {
throw new RuntimeException("ZIP 文件校验失败或格式不正确");
}
// 调用内部方法
unpackTransferFileInternal(zipFilePath, metadata);
}
/**
* 解包传输文件(内部方法,接收已解析的元数据)
*
* @return 解包后创建的文件夹和文件信息
*/
private ExpandUserFileDTO unpackTransferFileInternal(Path zipFilePath, TransferMetadataDTO metadata) {
String fileName = zipFilePath.getFileName().toString();
log.info("开始解包文件: {}", fileName);
try {
// 1. 从元数据中获取文件夹和文件信息
ExpandUserFileDTO expandUserFile = metadata.getExpandUserFile();
Assert.notNull(expandUserFile, "metadata 缺少 expandUserFile");
UserFileDTO folder = expandUserFile.getFolder();
List<UserFileDTO> files = expandUserFile.getFiles();
Assert.notNull(folder, "expandUserFile 缺少 folder");
Assert.notEmpty(files, "expandUserFile 缺少 files");
// 2. 确定 rootType 并设置到 folder 中
String location = fileProperties.getLocation();
String rootType;
if (FileLocationEnum.INTERNAL.getLocation().equals(location)) {
rootType = RootTypeEnum.EXTERNAL_TO_INTERNAL.getType();
} else {
rootType = RootTypeEnum.INTERNAL_TO_EXTERNAL.getType();
}
folder.setRootType(rootType);
// 3. 创建 userFileId -> UserFileDTO 的映射
Map<Long, UserFileDTO> fileMap = new HashMap<>();
for (UserFileDTO file : files) {
fileMap.put(file.getId(), file);
}
// 4. 解析 ZIP 文件,上传文件并设置 fileCode
try (ZipInputStream zis = new ZipInputStream(new FileInputStream(zipFilePath.toFile()))) {
ZipEntry entry;
while ((entry = zis.getNextEntry()) != null) {
// 跳过元数据文件和目录
if ("transferMetadata.json".equals(entry.getName()) || entry.isDirectory()) {
zis.closeEntry();
continue;
}
// 提取 userFileId(去掉路径)
String entryName = entry.getName();
String userFileIdStr = entryName.contains("/")
? entryName.substring(entryName.lastIndexOf("/") + 1)
: entryName;
// 解析 userFileId
Long userFileId;
try {
userFileId = Long.parseLong(userFileIdStr);
} catch (NumberFormatException e) {
log.warn("无法解析 userFileId,跳过: {}", userFileIdStr);
zis.closeEntry();
continue;
}
// 获取文件信息
UserFileDTO fileInfo = fileMap.get(userFileId);
if (fileInfo == null) {
log.warn("元数据中未找到文件信息,跳过: userFileId={}", userFileId);
zis.closeEntry();
continue;
}
// 读取文件流到内存
ByteArrayOutputStream baos = new ByteArrayOutputStream();
byte[] buffer = new byte[8192];
int len;
while ((len = zis.read(buffer)) > 0) {
baos.write(buffer, 0, len);
}
// 上传文件获取 fileCode
String originalFileName = fileInfo.getFileName();
log.debug("开始上传文件: userFileId={}, 文件名={}", userFileId, originalFileName);
ByteArrayInputStream fileStream = new ByteArrayInputStream(baos.toByteArray());
String fileCode = fileService.upload(originalFileName, fileStream).getFileCode();
log.debug("文件上传成功: userFileId={}, fileCode={}", userFileId, fileCode);
// 设置 fileCode 到文件信息中
fileInfo.setFileCode(fileCode);
zis.closeEntry();
}
}
// 5. 调用 UserFileService 的重载方法创建文件夹和文件
ExpandUserFileDTO result = userFileService.create(folder, files);
log.info("文件解包成功: {}, 创建文件夹ID: {}", fileName, result.getFolder().getId());
return result;
} catch (Exception e) {
log.error("解包文件失败: {}", fileName, e);
throw new RuntimeException("解包文件失败: " + e.getMessage(), e);
}
}
/**
* 创建 .finish 文件到发送目录,告诉对方处理完成
*
* @param zipFileName ZIP 文件名(例如:123_456.zip)
*/
private void createFinishFile(String zipFileName) {
try {
// 获取发送目录
String transferSendDir = fileProperties.getTransferSendDir();
Path sendPath = Paths.get(transferSendDir);
// 确保发送目录存在
if (!Files.exists(sendPath)) {
Files.createDirectories(sendPath);
}
// 创建 .finish 文件
Path finishFile = sendPath.resolve(zipFileName + ".finish");
Files.createFile(finishFile);
log.info("创建完成标记文件到发送目录: {}", finishFile);
} catch (Exception e) {
log.error("创建完成标记文件失败: {}", zipFileName, e);
}
}
/**
* 处理 .finish 文件(发送方接收到对方的完成标记)
*
* @param finishFile .finish 文件路径(例如:123_456.zip.finish)
*/
private void processFinishFile(Path finishFile) {
String fileName = finishFile.getFileName().toString();
log.info("处理完成标记文件: {}", fileName);
try {
// 1. 解析文件名,获取 userFileId
// 文件名格式:123_456.zip.finish
String zipFileName = fileName.replace(".finish", "");
String[] parts = zipFileName.replace(".zip", "").split("_");
if (parts.length != 2) {
log.warn("无法解析完成标记文件名,跳过: {}", fileName);
return;
}
Long folderId = Long.parseLong(parts[0]);
Long userId = Long.parseLong(parts[1]);
log.info("解析完成标记文件: folderId={}, userId={}", folderId, userId);
// 2. 更新文件夹及其所有子文件状态为正常(modifyStatus 会自动更新所有子文件)
UserFileModifyStatusDTO statusDTO = UserFileModifyStatusDTO.builder()
.id(folderId)
.oldStatus(FileStatusEnum.TRANSFERRING.getStatus())
.newStatus(FileStatusEnum.NORMAL.getStatus())
.build();
userFileService.modifyStatus(statusDTO);
log.info("更新文件夹及所有子文件状态为正常: folderId={}", folderId);
// 3. 删除 .finish 文件
Files.delete(finishFile);
log.info("处理完成,已删除完成标记文件: {}", fileName);
} catch (Exception e) {
log.error("处理完成标记文件失败: {}", fileName, e);
}
}
}

View File

@@ -0,0 +1,151 @@
package com.senmesh.sfile.service.impl;
import com.senmesh.common.util.JsonUtils;
import com.senmesh.common.util.UserContextHolder;
import com.senmesh.component.file.config.FileProperties;
import com.senmesh.component.file.service.FileService;
import com.senmesh.sfile.constant.FileLocationEnum;
import com.senmesh.sfile.constant.FileStatusEnum;
import com.senmesh.sfile.constant.RootTypeEnum;
import com.senmesh.sfile.dto.ExpandUserFileCreateDTO;
import com.senmesh.sfile.dto.ExpandUserFileDTO;
import com.senmesh.sfile.dto.TransferMetadataDTO;
import com.senmesh.sfile.dto.TransferUserFileCreateDTO;
import com.senmesh.sfile.dto.UserFileDTO;
import com.senmesh.sfile.service.TransferUserFileService;
import com.senmesh.sfile.service.UserFileService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
/**
* 传输用户文件ServiceImpl
*/
@Service
@Slf4j
public class TransferUserFileServiceImpl implements TransferUserFileService {
@Autowired
private UserFileService userFileService;
@Autowired
private FileProperties fileProperties;
@Autowired
private FileService fileService;
@Override
@Transactional
public Long create(TransferUserFileCreateDTO createDTO) {
Long userId = UserContextHolder.getExistLoginUserId();
// 根据 FileProperties#location 的类型决定是内穿外还是外传内
String location = fileProperties.getLocation();
String rootType;
if (FileLocationEnum.INTERNAL.getLocation().equals(location)) {
// 内网 -> 内穿外
rootType = RootTypeEnum.INTERNAL_TO_EXTERNAL.getType();
} else {
// 外网 -> 外传内
rootType = RootTypeEnum.EXTERNAL_TO_INTERNAL.getType();
}
// TODO 扫描文件审核
// 调用UserFileService的重载create方法
ExpandUserFileCreateDTO expandCreateDTO = ExpandUserFileCreateDTO.builder()
.userFileId(createDTO.getUserFileId())
.userId(userId)
.rootType(rootType)
.fileStatus(FileStatusEnum.TRANSFERRING.getStatus())
.build();
ExpandUserFileDTO expandUserFileDTO = userFileService.create(expandCreateDTO);
// 打包传输文件
try {
packTransferFiles(expandUserFileDTO);
} catch (Exception e) {
log.error("打包传输文件失败", e);
throw new RuntimeException("打包传输文件失败: " + e.getMessage());
}
return expandUserFileDTO.getFolder().getId();
}
/**
* 打包传输文件
* 将文件夹和文件打包成压缩包,并添加transferMetadata.json文件信息
*
* @param expandUserFileDTO 扩展用户文件DTO
*/
private void packTransferFiles(ExpandUserFileDTO expandUserFileDTO) throws IOException {
UserFileDTO folder = expandUserFileDTO.getFolder();
List<UserFileDTO> files = expandUserFileDTO.getFiles();
// 1. 创建传输发送目录
String transferSendDir = fileProperties.getTransferSendDir();
Path transferPath = Paths.get(transferSendDir);
if (!Files.exists(transferPath)) {
Files.createDirectories(transferPath);
}
// 2. 创建最终传输包
String finalFileName = folder.getUserId() + "_" + folder.getId() + ".zip";
Path finalFilePath = transferPath.resolve(finalFileName);
try (ZipOutputStream zos = new ZipOutputStream(new FileOutputStream(finalFilePath.toFile()))) {
// 2.1 添加文件夹中的文件
String folderName = folder.getFileName();
for (UserFileDTO file : files) {
String fileCode = file.getFileCode();
Long userFileId = file.getId();
// 创建 ZipEntry(使用 userFileId 命名)
String entryName = folderName + "/" + userFileId;
ZipEntry zipEntry = new ZipEntry(entryName);
zos.putNextEntry(zipEntry);
// 边读边写
try (InputStream inputStream = fileService.getFile(fileCode)) {
byte[] buffer = new byte[8192];
int len;
while ((len = inputStream.read(buffer)) > 0) {
zos.write(buffer, 0, len);
}
}
zos.closeEntry();
log.debug("添加文件: userFileId={}, 原文件名={}, 大小={} bytes",
userFileId, file.getFileName(), file.getFileSize());
}
// 2.2 添加元数据文件
TransferMetadataDTO metadata = TransferMetadataDTO.builder()
.expandUserFile(expandUserFileDTO)
.build();
String metadataJson = JsonUtils.toJsonString(metadata);
ZipEntry metadataEntry = new ZipEntry("transferMetadata.json");
zos.putNextEntry(metadataEntry);
zos.write(metadataJson.getBytes("UTF-8"));
zos.closeEntry();
}
log.info("传输文件打包完成: {}", finalFilePath);
}
}

View File

@@ -4,11 +4,14 @@ import com.senmesh.common.constant.CommonConstants;
import com.senmesh.common.exception.util.Assert; import com.senmesh.common.exception.util.Assert;
import com.senmesh.common.util.ListUtil; import com.senmesh.common.util.ListUtil;
import com.senmesh.common.util.UserContextHolder; import com.senmesh.common.util.UserContextHolder;
import com.senmesh.component.file.service.FileService;
import com.senmesh.sfile.constant.FileStatusEnum;
import com.senmesh.sfile.constant.FileTypeEnum; import com.senmesh.sfile.constant.FileTypeEnum;
import com.senmesh.sfile.constant.RootTypeEnum; import com.senmesh.sfile.constant.RootTypeEnum;
import com.senmesh.sfile.convert.UserFileConvert; import com.senmesh.sfile.convert.UserFileConvert;
import com.senmesh.sfile.dao.UserFileMapper; import com.senmesh.sfile.dao.UserFileMapper;
import com.senmesh.sfile.dto.ExpandUserFileCreateDTO; import com.senmesh.sfile.dto.ExpandUserFileCreateDTO;
import com.senmesh.sfile.dto.ExpandUserFileDTO;
import com.senmesh.sfile.dto.UserFileCreateDTO; import com.senmesh.sfile.dto.UserFileCreateDTO;
import com.senmesh.sfile.dto.UserFileDTO; import com.senmesh.sfile.dto.UserFileDTO;
import com.senmesh.sfile.dto.UserFileModifyDTO; import com.senmesh.sfile.dto.UserFileModifyDTO;
@@ -16,73 +19,84 @@ import com.senmesh.sfile.dto.UserFileModifyStatusDTO;
import com.senmesh.sfile.dto.UserFileQueryDTO; import com.senmesh.sfile.dto.UserFileQueryDTO;
import com.senmesh.sfile.entity.UserFile; import com.senmesh.sfile.entity.UserFile;
import com.senmesh.sfile.service.UserFileService; import com.senmesh.sfile.service.UserFileService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.io.InputStream;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 用户文件ServiceImpl * 用户文件ServiceImpl
*/ */
@Slf4j
@Service @Service
public class UserFileServiceImpl implements UserFileService { public class UserFileServiceImpl implements UserFileService {
@Autowired @Autowired
private UserFileMapper userFileMapper; private UserFileMapper userFileMapper;
@Autowired
private FileService fileService;
@Override @Override
@Transactional @Transactional
public Long create(UserFileCreateDTO createDTO) { public UserFileDTO create(UserFileCreateDTO createDTO) {
Long parentId = createDTO.getParentId(); Long parentId = createDTO.getParentId();
String parentPath = createDTO.getParentPath(); String parentPath = createDTO.getParentPath();
Long userId = createDTO.getUserId(); Long userId = createDTO.getUserId();
String rootType = createDTO.getRootType(); String rootType = createDTO.getRootType();
// 1. 校验文件类型时fileCode不能为空 // 1. 校验 userId 和 rootType 不能为空
Assert.notNull(userId, "用户ID不能为空");
Assert.notBlank(rootType, "根类型不能为空");
// 2. 校验文件类型时fileCode不能为空
if (FileTypeEnum.isFile(createDTO.getFileType())) { if (FileTypeEnum.isFile(createDTO.getFileType())) {
Assert.notBlank(createDTO.getFileCode(), "文件编码不能为空"); Assert.notBlank(createDTO.getFileCode(), "文件编码不能为空");
} }
// 2. 校验父节点(如果不是根目录) // 3. 处理 parentPath(性能优化:如果提供了 parentPath,直接使用,避免查询)
if (parentId != null && parentId != 0L) { if (StringUtils.isBlank(parentPath) && parentId != null && parentId != 0L) {
// 如果没有提供parentPath,需要查询父节点 // 如果没有提供 parentPath,但提供了 parentId,需要查询父节点获取 parentPath
if (StringUtils.isBlank(parentPath)) { UserFileDTO parentFile = this.findOne(UserFileQueryDTO.builder()
UserFileDTO parentFile = this.findOne(UserFileQueryDTO.builder() .id(parentId)
.id(parentId) .userId(userId)
.userId(userId) .rootType(rootType)
.rootType(rootType) .build());
.build()); Assert.isTrue(FileTypeEnum.isFolder(parentFile.getFileType()), "父节点必须是文件夹");
Assert.isTrue(FileTypeEnum.isFolder(parentFile.getFileType()), "父节点必须是文件夹"); // 获取父路径用于后续拼接
// 获取父路径用于后续拼接 parentPath = parentFile.getPath();
parentPath = parentFile.getPath();
}
// 如果提供了parentPath,信任调用方,不做校验
} }
// 如果提供了 parentPath,直接信任调用方,不做校验
// 3. 插入数据获取ID // 4. 插入数据获取ID
UserFile userFile = UserFileConvert.INSTANCE.toEntity(createDTO); UserFile userFile = UserFileConvert.INSTANCE.toEntity(createDTO);
userFileMapper.saveEntity(userFile); userFileMapper.saveEntity(userFile);
Long newId = userFile.getId(); Long newId = userFile.getId();
// 4. 构建path // 5. 构建path
String path = StringUtils.isNotBlank(parentPath) String path = StringUtils.isNotBlank(parentPath)
? parentPath + CommonConstants.COMMA + newId ? parentPath + CommonConstants.COMMA + newId
: String.valueOf(newId); : String.valueOf(newId);
// 5. 更新path // 6. 更新path
userFile.setPath(path); userFile.setPath(path);
userFileMapper.updateEntitySelective(userFile); userFileMapper.updateEntitySelective(userFile);
return newId; // 7. 转换为DTO返回
return UserFileConvert.INSTANCE.toDto(userFile);
} }
@Override @Override
@Transactional @Transactional
public Long create(ExpandUserFileCreateDTO expandCreateDTO) { public ExpandUserFileDTO create(ExpandUserFileCreateDTO expandCreateDTO) {
Long userFileId = expandCreateDTO.getUserFileId(); Long userFileId = expandCreateDTO.getUserFileId();
Long userId = expandCreateDTO.getUserId(); Long userId = expandCreateDTO.getUserId();
String rootType = expandCreateDTO.getRootType(); String rootType = expandCreateDTO.getRootType();
@@ -94,26 +108,7 @@ public class UserFileServiceImpl implements UserFileService {
.rootType(RootTypeEnum.NORMAL.getType()) .rootType(RootTypeEnum.NORMAL.getType())
.build()); .build());
// 2. 创建文件夹,文件名 = 原文件名 + 当前时间
String timestamp = new SimpleDateFormat("yyyyMMddHHmmss").format(new Date());
String folderName = normalFile.getFileName() + "_" + timestamp;
UserFileCreateDTO folderCreateDTO = UserFileCreateDTO.builder()
.userId(userId)
.rootType(rootType)
.fileType(FileTypeEnum.FOLDER.getType())
.fileName(folderName)
.parentId(0L)
.endTime(expandCreateDTO.getEndTime())
.accessCode(expandCreateDTO.getAccessCode())
.build();
Long folderId = this.create(folderCreateDTO);
String folderPath = String.valueOf(folderId);
// 3. 查询需要复制的文件列表 // 3. 查询需要复制的文件列表
// 查询条件:path LIKE 'xxx%' AND fileType = '1'
// 如果是文件:会查到自己
// 如果是文件夹:会查到其下所有文件类型的子文件
UserFileQueryDTO queryDTO = UserFileQueryDTO.builder() UserFileQueryDTO queryDTO = UserFileQueryDTO.builder()
.userId(userId) .userId(userId)
.rootType(RootTypeEnum.NORMAL.getType()) .rootType(RootTypeEnum.NORMAL.getType())
@@ -122,23 +117,98 @@ public class UserFileServiceImpl implements UserFileService {
.build(); .build();
queryDTO.disablePage(); queryDTO.disablePage();
List<UserFileDTO> filesToCopy = this.list(queryDTO); List<UserFileDTO> filesToCopy = this.list(queryDTO);
Assert.notEmpty(filesToCopy, "未查询到需要处理的文件");
// 2. 创建文件夹,文件名 = 原文件名 + 当前时间
String timestamp = new SimpleDateFormat("yyyyMMddHHmmss").format(new Date());
String folderName = normalFile.getFileName() + "_" + timestamp;
UserFileCreateDTO folderCreateDTO = UserFileCreateDTO.builder()
.userId(userId)
.rootType(rootType)
.fileStatus(expandCreateDTO.getFileStatus())
.fileType(FileTypeEnum.FOLDER.getType())
.fileName(folderName)
.parentId(0L)
.endTime(expandCreateDTO.getEndTime())
.accessCode(expandCreateDTO.getAccessCode())
.build();
UserFileDTO folderDTO = this.create(folderCreateDTO);
Long folderId = folderDTO.getId();
String folderPath = String.valueOf(folderId);
// 4. 在文件夹下创建文件对象 // 4. 在文件夹下创建文件对象
List<UserFileDTO> createdFiles = new java.util.ArrayList<>();
for (UserFileDTO fileDTO : filesToCopy) { for (UserFileDTO fileDTO : filesToCopy) {
UserFileCreateDTO fileCreateDTO = UserFileCreateDTO.builder() UserFileCreateDTO fileCreateDTO = UserFileCreateDTO.builder()
.userId(userId) .userId(userId)
.rootType(rootType) .rootType(rootType)
.fileStatus(expandCreateDTO.getFileStatus())
.fileType(FileTypeEnum.FILE.getType()) .fileType(FileTypeEnum.FILE.getType())
.fileName(fileDTO.getFileName()) .fileName(fileDTO.getFileName())
.fileCode(fileDTO.getFileCode()) .fileCode(fileDTO.getFileCode())
.parentId(folderId)
.parentPath(folderPath) .parentPath(folderPath)
.build(); .build();
this.create(fileCreateDTO); UserFileDTO createdFile = this.create(fileCreateDTO);
createdFiles.add(createdFile);
} }
return folderId; // 6. 返回结果
return ExpandUserFileDTO.builder()
.folder(folderDTO)
.files(createdFiles)
.build();
} }
@Override
@Transactional
public ExpandUserFileDTO create(UserFileDTO folder, List<UserFileDTO> files) {
Long userId = folder.getUserId();
String rootType = folder.getRootType();
// 3. 创建文件夹
UserFileCreateDTO folderCreateDTO = UserFileCreateDTO.builder()
.userId(userId)
.rootType(rootType)
.fileType(FileTypeEnum.FOLDER.getType())
.fileName(folder.getFileName())
.parentId(0L)
.fileStatus(FileStatusEnum.NORMAL.getStatus())
.build();
UserFileDTO folderDTO = this.create(folderCreateDTO);
Long folderId = folderDTO.getId();
String folderPath = String.valueOf(folderId);
log.info("创建文件夹成功: folderId={}, 文件名={}", folderId, folder.getFileName());
// 4. 创建文件列表
List<UserFileDTO> createdFiles = new ArrayList<>();
for (UserFileDTO fileInfo : files) {
// 创建文件记录
UserFileCreateDTO fileCreateDTO = UserFileCreateDTO.builder()
.userId(userId)
.rootType(rootType)
.fileType(FileTypeEnum.FILE.getType())
.fileName(fileInfo.getFileName())
.fileCode(fileInfo.getFileCode())
.parentId(folderId)
.parentPath(folderPath)
.fileStatus(FileStatusEnum.NORMAL.getStatus())
.build();
UserFileDTO createdFile = this.create(fileCreateDTO);
createdFiles.add(createdFile);
}
// 5. 返回结果
return ExpandUserFileDTO.builder()
.folder(folderDTO)
.files(createdFiles)
.build();
}
@Override @Override
@Transactional @Transactional

View File

@@ -13,9 +13,6 @@ import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket; import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2; import springfox.documentation.swagger2.annotations.EnableSwagger2;
/**
* @author guhong
*/
@Configuration @Configuration
@EnableSwagger2 @EnableSwagger2
public class SwaggerConfig { public class SwaggerConfig {
@@ -37,7 +34,7 @@ public class SwaggerConfig {
// 设置是否开启swagger,生产环境关闭 // 设置是否开启swagger,生产环境关闭
.enable(swaggerEnable).select() .enable(swaggerEnable).select()
// 当前包路径 // 当前包路径
.apis(RequestHandlerSelectors.basePackage("com.newyetai")) .apis(RequestHandlerSelectors.basePackage("com.senmesh"))
.apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class)) .apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class))
.paths(PathSelectors.any()).build(); .paths(PathSelectors.any()).build();
} }
@@ -52,7 +49,7 @@ public class SwaggerConfig {
// 页面标题 // 页面标题
.title("接口文档") .title("接口文档")
// 创建人 // 创建人
.contact(new Contact("雷佳平", "", "")) .contact(new Contact("ljp", "", ""))
// 版本号 // 版本号
.version("1.0") .version("1.0")
// 描述 // 描述

View File

@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.senmesh.usercenter.annex.dao.UserAnnexDao"> <mapper namespace="com.senmesh.usercenter.annex.dao.UserAnnexDao">
<select id="page" resultType="com.senmesh.usercenter.annex.dto.UserAnnexDTO"> <select id="page" resultType="com.senmesh.usercenter.annex.dto.UserAnnexDTO">
select * select *
from xs_user_annex from xs_user_annex
where deleted = 0 where deleted = FALSE
<if test="param.userId != null"> <if test="param.userId != null">
and user_id = #{param.userId} and user_id = #{param.userId}
</if> </if>

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
@@ -7,10 +7,10 @@
select select
ac.* ac.*
from uc_auth_client ac from uc_auth_client ac
left join uc_domain_auth da on ac.id = da.auth_client_id and da.deleted = 0 left join uc_domain_auth da on ac.id = da.auth_client_id and da.deleted = FALSE
left join uc_domain d on da.domain_id = d.id and d.deleted = 0 left join uc_domain d on da.domain_id = d.id and d.deleted = FALSE
where where
ac.deleted = 0 ac.deleted = FALSE
<if test="param.id != null"> <if test="param.id != null">
and ac.id = #{param.id} and ac.id = #{param.id}
</if> </if>
@@ -28,9 +28,9 @@
FROM FROM
uc_auth_client ac uc_auth_client ac
LEFT JOIN uc_auth_type atp ON atp.auth_type_code = ac.auth_type_code LEFT JOIN uc_auth_type atp ON atp.auth_type_code = ac.auth_type_code
AND atp.deleted = 0 AND atp.deleted = FALSE
WHERE WHERE
ac.deleted = 0 ac.deleted = FALSE
<if test="param.id != null"> <if test="param.id != null">
and ac.id = #{param.id} and ac.id = #{param.id}
</if> </if>

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
@@ -8,7 +8,7 @@
* *
from uc_auth_detail_entrypoint from uc_auth_detail_entrypoint
where where
deleted = 0 deleted = FALSE
<if test="param.id != null"> <if test="param.id != null">
and id = #{param.id} and id = #{param.id}
</if> </if>
@@ -42,19 +42,19 @@
r.person_in_charge resumePersonInCharge r.person_in_charge resumePersonInCharge
FROM FROM
uc_auth_detail_entrypoint ade uc_auth_detail_entrypoint ade
INNER JOIN uc_lite_code lc on ade.union_id = lc.id AND lc.deleted = 0 INNER JOIN uc_lite_code lc on ade.union_id = lc.id AND lc.deleted = FALSE
INNER JOIN uc_auth_detail ad on ade.auth_detail_id = ad.id AND ad.deleted = 0 INNER JOIN uc_auth_detail ad on ade.auth_detail_id = ad.id AND ad.deleted = FALSE
INNER JOIN uc_user_auth ua on ua.unique_id = ad.unique_id AND ua.deleted = 0 INNER JOIN uc_user_auth ua on ua.unique_id = ad.unique_id AND ua.deleted = FALSE
INNER JOIN uc_user u on u.id = ua.user_id AND u.deleted = 0 INNER JOIN uc_user u on u.id = ua.user_id AND u.deleted = FALSE
INNER JOIN uc_user_register ur on ur.user_id = ua.user_id AND ur.union_id = lc.id AND ur.deleted = 0 AND ur.inviter_id = #{userId} INNER JOIN uc_user_register ur on ur.user_id = ua.user_id AND ur.union_id = lc.id AND ur.deleted = FALSE AND ur.inviter_id = #{userId}
LEFT JOIN hr_resume r on r.user_id = u.id and r.org_id = lc.org_id AND r.deleted = 0 LEFT JOIN hr_resume r on r.user_id = u.id and r.org_id = lc.org_id AND r.deleted = FALSE
LEFT JOIN hr_position_type pt on pt.code = r.job_intention AND pt.deleted = 0 LEFT JOIN hr_position_type pt on pt.code = r.job_intention AND pt.deleted = FALSE
<if test="param.queryType != null and param.queryType == 1"> <if test="param.queryType != null and param.queryType == 1">
LEFT JOIN hr_position_registration pr on pr.user_id = ur.user_id AND pr.deleted = 0 LEFT JOIN hr_position_registration pr on pr.user_id = ur.user_id AND pr.deleted = FALSE
</if> </if>
WHERE WHERE
ade.deleted = 0 ade.deleted = FALSE
AND lc.user_id = #{userId} AND lc.user_id = #{userId}
AND lc.org_id = #{orgId} AND lc.org_id = #{orgId}
<if test="param.lifeCodeId != null"> <if test="param.lifeCodeId != null">
@@ -81,7 +81,7 @@
select pt.name select pt.name
from hr_job_expect je left join hr_position_type pt on je.type_code = pt.code from hr_job_expect je left join hr_position_type pt on je.type_code = pt.code
where where
je.deleted = 0 je.deleted = FALSE
and je.user_id = u.id order by je.create_time desc limit 1 and je.user_id = u.id order by je.create_time desc limit 1
) as job_intention, ) as job_intention,
ur.inviter_id, -- 邀请人id ur.inviter_id, -- 邀请人id
@@ -91,14 +91,14 @@
lc.name as liteName lc.name as liteName
FROM FROM
uc_auth_detail_entrypoint ade uc_auth_detail_entrypoint ade
INNER JOIN uc_lite_code lc on ade.union_id = lc.id AND lc.deleted = 0 INNER JOIN uc_lite_code lc on ade.union_id = lc.id AND lc.deleted = FALSE
INNER JOIN uc_auth_detail ad on ade.auth_detail_id = ad.id AND ad.deleted = 0 INNER JOIN uc_auth_detail ad on ade.auth_detail_id = ad.id AND ad.deleted = FALSE
INNER JOIN uc_user_auth ua on ua.unique_id = ad.unique_id AND ua.deleted = 0 INNER JOIN uc_user_auth ua on ua.unique_id = ad.unique_id AND ua.deleted = FALSE
INNER JOIN uc_user u on u.id = ua.user_id AND u.deleted = 0 INNER JOIN uc_user u on u.id = ua.user_id AND u.deleted = FALSE
INNER JOIN uc_user_register ur on ur.user_id = ua.user_id AND ur.union_id = lc.id AND ur.deleted = 0 INNER JOIN uc_user_register ur on ur.user_id = ua.user_id AND ur.union_id = lc.id AND ur.deleted = FALSE
WHERE WHERE
ade.deleted = 0 ade.deleted = FALSE
AND lc.org_id = #{orgId} AND lc.org_id = #{orgId}
<if test="param.userId != null"> <if test="param.userId != null">
AND u.id = #{param.userId} AND u.id = #{param.userId}
@@ -151,11 +151,11 @@
FROM FROM
uc_auth_detail_entrypoint ade uc_auth_detail_entrypoint ade
LEFT JOIN uc_lite_code lc on ade.union_id = lc.id LEFT JOIN uc_lite_code lc on ade.union_id = lc.id
LEFT JOIN uc_auth_detail ad on ade.auth_detail_id = ad.id AND ad.deleted = 0 LEFT JOIN uc_auth_detail ad on ade.auth_detail_id = ad.id AND ad.deleted = FALSE
LEFT JOIN uc_user_auth ua on ua.unique_id = ad.unique_id AND ua.deleted = 0 LEFT JOIN uc_user_auth ua on ua.unique_id = ad.unique_id AND ua.deleted = FALSE
LEFT JOIN uc_user_register ur on ur.user_id = ua.user_id AND ur.deleted = 0 LEFT JOIN uc_user_register ur on ur.user_id = ua.user_id AND ur.deleted = FALSE
WHERE WHERE
ade.deleted = 0 AND lc.deleted = 0 ade.deleted = FALSE AND lc.deleted = FALSE
AND lc.org_id = #{orgId} AND lc.org_id = #{orgId}
<if test="param.userId != null"> <if test="param.userId != null">
AND ur.inviter_id = #{param.userId} AND ur.inviter_id = #{param.userId}
@@ -173,12 +173,12 @@
count(DISTINCT ur.user_id) count(DISTINCT ur.user_id)
FROM FROM
uc_auth_detail_entrypoint ade uc_auth_detail_entrypoint ade
INNER JOIN uc_lite_code lc on ade.union_id = lc.id AND lc.deleted = 0 INNER JOIN uc_lite_code lc on ade.union_id = lc.id AND lc.deleted = FALSE
INNER JOIN uc_auth_detail ad on ade.auth_detail_id = ad.id AND ad.deleted = 0 INNER JOIN uc_auth_detail ad on ade.auth_detail_id = ad.id AND ad.deleted = FALSE
INNER JOIN uc_user_auth ua on ua.unique_id = ad.unique_id AND ua.deleted = 0 INNER JOIN uc_user_auth ua on ua.unique_id = ad.unique_id AND ua.deleted = FALSE
INNER JOIN uc_user_register ur on ur.user_id = ua.user_id AND ur.deleted = 0 AND ur.union_id = lc.id INNER JOIN uc_user_register ur on ur.user_id = ua.user_id AND ur.deleted = FALSE AND ur.union_id = lc.id
WHERE WHERE
ade.deleted = 0 ade.deleted = FALSE
AND lc.org_id = #{orgId} AND lc.org_id = #{orgId}
<if test="param.userId != null"> <if test="param.userId != null">
AND ur.inviter_id = #{param.userId} AND ur.inviter_id = #{param.userId}
@@ -203,18 +203,18 @@
uc_auth_detail_entrypoint ade uc_auth_detail_entrypoint ade
INNER JOIN uc_lite_code lc on ade.union_id = lc.id INNER JOIN uc_lite_code lc on ade.union_id = lc.id
<if test="param.queryType != null and param.queryType == 1"> <if test="param.queryType != null and param.queryType == 1">
INNER JOIN uc_auth_detail ad on ade.auth_detail_id = ad.id AND ad.deleted = 0 INNER JOIN uc_auth_detail ad on ade.auth_detail_id = ad.id AND ad.deleted = FALSE
INNER JOIN uc_user_auth ua on ua.unique_id = ad.unique_id AND ua.deleted = 0 INNER JOIN uc_user_auth ua on ua.unique_id = ad.unique_id AND ua.deleted = FALSE
INNER JOIN uc_user u on u.id = ua.user_id AND u.deleted = 0 INNER JOIN uc_user u on u.id = ua.user_id AND u.deleted = FALSE
INNER JOIN uc_user_register ur on ur.user_id = ua.user_id AND ur.union_id = lc.id AND ur.deleted = 0 INNER JOIN uc_user_register ur on ur.user_id = ua.user_id AND ur.union_id = lc.id AND ur.deleted = FALSE
LEFT JOIN hr_position p on p.org_id = lc.org_id LEFT JOIN hr_position p on p.org_id = lc.org_id
LEFT JOIN hr_position_registration pr on pr.position_id = p.id AND pr.user_id = ua.user_id LEFT JOIN hr_position_registration pr on pr.position_id = p.id AND pr.user_id = ua.user_id
</if> </if>
WHERE WHERE
ade.deleted = 0 AND lc.deleted = 0 ade.deleted = FALSE AND lc.deleted = FALSE
AND lc.org_id = #{orgId} AND lc.org_id = #{orgId}
<if test="param.queryType != null and param.queryType == 1"> <if test="param.queryType != null and param.queryType == 1">
AND p.deleted = 0 AND pr.deleted = 0 AND pr.status = 6 AND (pr.termination is null or pr.termination = 0) AND p.deleted = FALSE AND pr.deleted = FALSE AND pr.status = 6 AND (pr.termination is null or pr.termination = 0)
AND ur.inviter_id = #{param.userId} AND ur.inviter_id = #{param.userId}
</if> </if>
<if test="param.userId != null"> <if test="param.userId != null">
@@ -236,7 +236,7 @@
FROM FROM
hr_position_registration pr hr_position_registration pr
WHERE WHERE
pr.deleted = 0 pr.deleted = FALSE
AND pr.user_id IN AND pr.user_id IN
<foreach collection="userIds" open="(" separator="," close=")" item="userId"> <foreach collection="userIds" open="(" separator="," close=")" item="userId">
#{userId} #{userId}

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
@@ -11,11 +11,10 @@
FROM FROM
uc_auth_detail ad uc_auth_detail ad
LEFT JOIN uc_auth_client ac ON ac.id = ad.auth_client_id LEFT JOIN uc_auth_client ac ON ac.id = ad.auth_client_id
AND ac.deleted = AND ac.deleted = FALSE LEFT JOIN uc_auth_type atp ON atp.auth_type_code = ac.auth_type_code
0 LEFT JOIN uc_auth_type atp ON atp.auth_type_code = ac.auth_type_code AND atp.deleted = FALSE
AND atp.deleted = 0
WHERE WHERE
ad.deleted = 0 ad.deleted = FALSE
<if test="param.id != null"> <if test="param.id != null">
and ad.id = #{param.id} and ad.id = #{param.id}
</if> </if>
@@ -41,7 +40,7 @@
from uc_user u from uc_user u
inner join uc_user_auth ua on u.id = ua.user_id inner join uc_user_auth ua on u.id = ua.user_id
where u.id = #{param.userId} where u.id = #{param.userId}
and ua.deleted = 0 and u.deleted = 0 and ua.deleted = FALSE and u.deleted = FALSE
) )
</if> </if>
</select> </select>

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
@@ -8,7 +8,7 @@
* *
from uc_auth_subscribe_detail from uc_auth_subscribe_detail
where where
deleted = 0 deleted = FALSE
<if test="param.id != null"> <if test="param.id != null">
and id = #{param.id} and id = #{param.id}
</if> </if>

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
@@ -9,6 +9,6 @@
FROM FROM
uc_auth_type atp uc_auth_type atp
WHERE WHERE
atp.deleted = 0 atp.deleted = FALSE
</select> </select>
</mapper> </mapper>

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
@@ -8,7 +8,7 @@
* *
from uc_lite_code_config from uc_lite_code_config
where where
deleted = 0 deleted = FALSE
<if test="param.id != null"> <if test="param.id != null">
and id = #{param.id} and id = #{param.id}
</if> </if>

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
@@ -7,9 +7,9 @@
select select
lc.* lc.*
from uc_lite_code lc from uc_lite_code lc
LEFT JOIN uc_lite_code_config lcc on lcc.id = lc.lite_code_config_id AND lcc.deleted = 0 LEFT JOIN uc_lite_code_config lcc on lcc.id = lc.lite_code_config_id AND lcc.deleted = FALSE
where where
lc.deleted = 0 lc.deleted = FALSE
<if test="param.id != null"> <if test="param.id != null">
and lc.id = #{param.id} and lc.id = #{param.id}
</if> </if>

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
@@ -16,8 +16,8 @@
xs_permission p xs_permission p
LEFT JOIN xs_url u ON u.id = p.resource_id LEFT JOIN xs_url u ON u.id = p.resource_id
<where> <where>
AND p.deleted = 0 AND p.deleted = FALSE
AND p.resource_type = 1 AND p.resource_type = '1'
AND u.link IS NOT NULL AND u.link IS NOT NULL
AND u.link &lt;&gt; '' AND u.link &lt;&gt; ''
AND p.role_id IN AND p.role_id IN
@@ -34,15 +34,15 @@
p.* p.*
from xs_permission p from xs_permission p
inner join xs_component c on p.resource_id = c.id inner join xs_component c on p.resource_id = c.id
where p.resource_type = 2 where p.resource_type = '2'
<if test="param.orgId != null"> <if test="param.orgId != null">
and p.org_id = #{param.orgId} and p.org_id = #{param.orgId}
</if> </if>
<if test="param.systemCode != null"> <if test="param.systemCode != null">
and p.platform_code = #{param.systemCode} and p.platform_code = #{param.systemCode}
</if> </if>
and p.deleted = 0 and p.deleted = FALSE
and c.deleted = 0 and c.deleted = FALSE
</select> </select>
<select id="findUrl" resultType="com.senmesh.usercenter.authority.dto.UrlPermissionDTO"> <select id="findUrl" resultType="com.senmesh.usercenter.authority.dto.UrlPermissionDTO">
@@ -53,12 +53,12 @@
u.type resourceType, u.type resourceType,
u.link link u.link link
from xs_url u from xs_url u
left join xs_permission p on p.resource_id = u.id and p.deleted = 0 and p.resource_type in (1,3) left join xs_permission p on p.resource_id = u.id and p.deleted = FALSE and p.resource_type in ('1','3')
<if test="param.orgId != null"> <if test="param.orgId != null">
and p.org_id = #{param.orgId} and p.org_id = #{param.orgId}
</if> </if>
where where
u.deleted = 0 u.deleted = FALSE
<if test="param.systemCode != null"> <if test="param.systemCode != null">
and u.platform_code = #{param.systemCode} and u.platform_code = #{param.systemCode}
</if> </if>
@@ -79,7 +79,7 @@
</foreach> </foreach>
</if> </if>
and deleted = 0 and deleted = FALSE
</select> </select>
<select id="urlComponentList" resultType="com.senmesh.usercenter.authority.dto.PermissionDTO"> <select id="urlComponentList" resultType="com.senmesh.usercenter.authority.dto.PermissionDTO">
SELECT SELECT
@@ -96,26 +96,26 @@
FROM FROM
xs_component t1 xs_component t1
LEFT JOIN xs_permission t4 ON LEFT JOIN xs_permission t4 ON
t4.deleted = 0 t4.deleted = FALSE
AND t4.resource_id = t1.id AND t4.resource_id = t1.id
AND t4.resource_type = 2 AND t4.resource_type = '2'
AND t4.platform_code = t1.platform_code AND t4.platform_code = t1.platform_code
AND t4.role_id = #{param.roleId} AND t4.role_id = #{param.roleId}
WHERE WHERE
t1.deleted = 0 t1.deleted = FALSE
AND t1.platform_code = #{param.platformCode} AND t1.platform_code = #{param.platformCode}
<if test="param.orgId!=null and param.orgId!=1 "> <if test="param.orgId!=null and param.orgId!=1 ">
and exists(select t2.* from xs_permission_resources t2 and exists(select t2.* from xs_permission_resources t2
INNER JOIN xs_permission_organization t3 ON INNER JOIN xs_permission_organization t3 ON
t3.permission_package_id = t2.permission_package_id t3.permission_package_id = t2.permission_package_id
AND t3.deleted = 0 AND t3.deleted = FALSE
INNER JOIN xs_permission_package xpp ON INNER JOIN xs_permission_package xpp ON
xpp.id = t3.permission_package_id xpp.id = t3.permission_package_id
AND xpp.deleted = 0 AND xpp.deleted = FALSE
AND xpp.platform_code = t1.platform_code AND xpp.platform_code = t1.platform_code
where t2.resource_id = t1.id where t2.resource_id = t1.id
AND t2.deleted = 0 AND t2.deleted = FALSE
AND t2.resource_type = 2 AND t2.resource_type = '2'
AND t3.allocation_org_id = #{param.orgId} AND t3.allocation_org_id = #{param.orgId}
) )
</if> </if>
@@ -146,26 +146,26 @@
<if test="param.orgId!=null and param.orgId!=1 "> <if test="param.orgId!=null and param.orgId!=1 ">
INNER JOIN xs_permission_resources t2 ON INNER JOIN xs_permission_resources t2 ON
t2.resource_id = t1.id t2.resource_id = t1.id
AND t2.deleted = 0 AND t2.deleted = FALSE
AND t2.resource_type = 3 AND t2.resource_type = '3'
INNER JOIN xs_permission_organization t3 ON INNER JOIN xs_permission_organization t3 ON
t3.permission_package_id = t2.permission_package_id t3.permission_package_id = t2.permission_package_id
AND t3.deleted = 0 AND t3.deleted = FALSE
INNER JOIN xs_permission_package t4 ON INNER JOIN xs_permission_package t4 ON
t4.id = t3.permission_package_id t4.id = t3.permission_package_id
AND t4.deleted = 0 AND t4.deleted = FALSE
AND t4.platform_code =#{param.platformCode} AND t4.platform_code =#{param.platformCode}
</if> </if>
left JOIN xs_permission t5 ON left JOIN xs_permission t5 ON
t5.resource_id = t1.id t5.resource_id = t1.id
AND t5.resource_type = 3 AND t5.resource_type = '3'
AND t5.deleted=0 AND t5.deleted = FALSE
AND t5.platform_code = #{param.platformCode} AND t5.platform_code = #{param.platformCode}
AND t5.role_id = #{param.roleId} AND t5.role_id = #{param.roleId}
WHERE WHERE
t1.parent_id = #{param.urlId} t1.parent_id = #{param.urlId}
AND t1.type = 2 AND t1.type = 2
AND t1.deleted = 0 AND t1.deleted = FALSE
AND t1.platform_code =#{param.platformCode} AND t1.platform_code =#{param.platformCode}
<if test="param.orgId!=null and param.orgId!=1 "> <if test="param.orgId!=null and param.orgId!=1 ">
AND t3.allocation_org_id = #{param.orgId} AND t3.allocation_org_id = #{param.orgId}

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
@@ -8,14 +8,14 @@
select * from xs_role_allocation select * from xs_role_allocation
where allocation_type = #{allocationType} where allocation_type = #{allocationType}
and allocation_id = #{allocationId} and allocation_id = #{allocationId}
and deleted = 0 and deleted = FALSE
</select> </select>
<select id="selectRoleIds"> <select id="selectRoleIds">
select distinct role_id from xs_role_allocation select distinct role_id from xs_role_allocation
where allocation_type = #{allocationType} where allocation_type = #{allocationType}
and allocation_id = #{allocationId} and allocation_id = #{allocationId}
and deleted = 0 and deleted = FALSE
</select> </select>
<select id="selectAllocationListByUsername" parameterType="java.lang.String" <select id="selectAllocationListByUsername" parameterType="java.lang.String"
@@ -24,24 +24,24 @@
a.* a.*
FROM FROM
xs_role_allocation a xs_role_allocation a
INNER JOIN uc_user u ON u.id = a.allocation_id AND u.enabled = 1 AND u.deleted = 0 INNER JOIN uc_user u ON u.id = a.allocation_id AND u.enabled = TRUE AND u.deleted = FALSE
WHERE WHERE
a.allocation_type = 1 a.allocation_type = '1'
AND u.username = #{username} AND u.username = #{username}
AND a.deleted = 0 AND a.deleted = FALSE
</select> </select>
<update id="deleteByRoleIds"> <update id="deleteByRoleIds">
update update
xs_role_allocation xs_role_allocation
set set
deleted = 1, deleted = TRUE,
update_by = #{operateUserId}, update_by = #{operateUserId},
update_time = now() update_time = now()
where where
allocation_type = #{allocationType} allocation_type = #{allocationType}
and allocation_id = #{allocationId} and allocation_id = #{allocationId}
and deleted = 0 and deleted = FALSE
and role_id in and role_id in
<foreach collection="roleIds" open="(" separator="," close=")" item="roleId"> <foreach collection="roleIds" open="(" separator="," close=")" item="roleId">
#{roleId} #{roleId}
@@ -49,12 +49,12 @@
</update> </update>
<select id="findByUserId" resultType="com.senmesh.usercenter.authority.dto.RoleAllocationDTO"> <select id="findByUserId" resultType="com.senmesh.usercenter.authority.dto.RoleAllocationDTO">
select * select *
from xs_role_allocation from xs_role_allocation
where where
allocation_type = 1 allocation_type = '1'
and allocation_id = (select id from uc_user where id = #{userId} and enabled = 1 and deleted = 0) and allocation_id = (select id from uc_user where id = #{userId} and enabled = TRUE and deleted = FALSE)
and deleted = 0 and deleted = FALSE
</select> </select>
<select id="getAllocatedBusinessRoles" <select id="getAllocatedBusinessRoles"
@@ -65,9 +65,9 @@
r.standard_type r.standard_type
FROM FROM
xs_role_allocation ra xs_role_allocation ra
INNER JOIN xs_role r ON ra.role_id = r.id AND r.deleted = 0 INNER JOIN xs_role r ON ra.role_id = r.id AND r.deleted = FALSE
WHERE WHERE
ra.deleted = 0 ra.deleted = FALSE
AND ra.allocation_id = #{param.allocationId} AND ra.allocation_id = #{param.allocationId}
AND ra.allocation_type = #{param.allocationType} AND ra.allocation_type = #{param.allocationType}
AND r.org_id = #{param.orgId} AND r.org_id = #{param.orgId}

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
@@ -6,7 +6,7 @@
<sql id="queryFrom"> <sql id="queryFrom">
FROM xs_role FROM xs_role
<where> <where>
org_id = #{orgId} and deleted = 0 org_id = #{orgId} and deleted = FALSE
<if test='param.name != null and param.name.trim() != ""'> <if test='param.name != null and param.name.trim() != ""'>
<bind name="nameLike" value="'%' + param.name + '%'"/> <bind name="nameLike" value="'%' + param.name + '%'"/>
AND name like #{nameLike} AND name like #{nameLike}
@@ -29,16 +29,16 @@
xs_permission xp xs_permission xp
LEFT JOIN xs_component xc ON LEFT JOIN xs_component xc ON
xp.resource_id = xc.id xp.resource_id = xc.id
AND xc.deleted = 0 AND xc.deleted = FALSE
LEFT JOIN xs_permission xp2 ON LEFT JOIN xs_permission xp2 ON
xp2.resource_id = xc.url_id xp2.resource_id = xc.url_id
AND xp2.role_id = xp.role_id AND xp2.role_id = xp.role_id
AND xp2.deleted = 0 AND xp2.deleted = FALSE
SET xp.deleted =1,xp.update_by = #{loginUserId}, xp.update_time = now() SET xp.deleted = TRUE,xp.update_by = #{loginUserId}, xp.update_time = now()
WHERE WHERE
xp.deleted = 0 xp.deleted = FALSE
AND xp2.id IS null AND xp2.id IS null
AND xp.resource_type = 2 AND xp.resource_type = '2'
</update> </update>
<update id="cleanRoleInterface"> <update id="cleanRoleInterface">
@@ -48,16 +48,16 @@
LEFT JOIN xs_url xc ON LEFT JOIN xs_url xc ON
xp.resource_id = xc.id xp.resource_id = xc.id
AND xc.type = 2 AND xc.type = 2
AND xc.deleted = 0 AND xc.deleted = FALSE
LEFT JOIN xs_permission xp2 ON LEFT JOIN xs_permission xp2 ON
xp2.resource_id = xc.parent_id xp2.resource_id = xc.parent_id
AND xp2.role_id = xp.role_id AND xp2.role_id = xp.role_id
AND xp2.deleted = 0 AND xp2.deleted = FALSE
SET xp.deleted =1,xp.update_by = #{loginUserId} , xp.update_time = now() SET xp.deleted = TRUE,xp.update_by = #{loginUserId} , xp.update_time = now()
WHERE WHERE
xp.deleted = 0 xp.deleted = FALSE
AND xp2.id IS NULL AND xp2.id IS NULL
AND xp.resource_type = 3 AND xp.resource_type = '3'
</update> </update>
@@ -74,7 +74,7 @@
<select id="existRoleName" resultType="int"> <select id="existRoleName" resultType="int">
select count(*) select count(*)
from xs_role from xs_role
where name = #{roleName} and deleted = 0 where name = #{roleName} and deleted = FALSE
<if test="roleId != null"> <if test="roleId != null">
and id != #{roleId} and id != #{roleId}
</if> </if>
@@ -89,16 +89,16 @@
rst.name as standard_role_name rst.name as standard_role_name
FROM FROM
xs_role r xs_role r
LEFT JOIN xs_role_standard_type rst ON rst.role_code = r.standard_type and rst.platform_code = r.platform_code AND rst.deleted=0 LEFT JOIN xs_role_standard_type rst ON rst.role_code = r.standard_type and rst.platform_code = r.platform_code AND rst.deleted = FALSE
WHERE WHERE
r.org_id = #{param.orgId} r.org_id = #{param.orgId}
AND r.deleted=0 AND r.deleted = FALSE
<choose> <choose>
<when test="param.roleType != null and param.roleType != ''"> <when test="param.roleType != null and param.roleType != ''">
AND r.type = #{param.roleType} AND r.type = #{param.roleType}
</when> </when>
<otherwise> <otherwise>
AND r.type != 1 AND r.type != '1'
</otherwise> </otherwise>
</choose> </choose>
<if test="param.standardType != null and param.standardType != ''"> <if test="param.standardType != null and param.standardType != ''">
@@ -121,17 +121,17 @@
<select id="getSellerRoleCanNotBeDeleted" resultType="java.lang.Long"> <select id="getSellerRoleCanNotBeDeleted" resultType="java.lang.Long">
SELECT DISTINCT ra.role_id SELECT DISTINCT ra.role_id
FROM xs_role_allocation ra FROM xs_role_allocation ra
WHERE ra.deleted = 0 WHERE ra.deleted = FALSE
AND ra.allocation_type = 1 AND ra.allocation_type = '1'
AND ra.role_id IN (SELECT r.id FROM xs_role r WHERE r.deleted = 0 AND r.standard_type = 2) AND ra.role_id IN (SELECT r.id FROM xs_role r WHERE r.deleted = FALSE AND r.standard_type = '2')
AND ra.allocation_id = #{userId} AND ra.allocation_id = #{userId}
AND EXISTS(SELECT ce.id AND EXISTS(SELECT ce.id
FROM xs_company_extend ce FROM xs_company_extend ce
WHERE ce.deleted = 0 WHERE ce.deleted = FALSE
AND ce.seller_id = ra.allocation_id AND ce.seller_id = ra.allocation_id
AND ce.org_id not IN (SELECT ou.org_id AND ce.org_id not IN (SELECT ou.org_id
FROM uc_org_user ou FROM uc_org_user ou
WHERE ou.deleted = 0 WHERE ou.deleted = FALSE
AND ou.user_id = #{userId} AND ou.user_id = #{userId}
)) ))
</select> </select>
@@ -142,9 +142,9 @@
from from
xs_role_allocation t1,xs_role t2 xs_role_allocation t1,xs_role t2
where where
t1.deleted = 0 t1.deleted = FALSE
AND t1.role_id=t2.id AND t1.role_id=t2.id
AND t2.deleted=0 AND t2.deleted = FALSE
<if test="platformCode != null"> <if test="platformCode != null">
AND t2.platform_code= #{platformCode} AND t2.platform_code= #{platformCode}
</if> </if>
@@ -157,7 +157,7 @@
from from
xs_role xs_role
where where
deleted = 0 deleted = FALSE
and org_id = #{orgId} and org_id = #{orgId}
<if test="platformCode != null"> <if test="platformCode != null">
and platform_code = #{platformCode} and platform_code = #{platformCode}
@@ -170,12 +170,12 @@
from from
xs_role xs_role
where where
deleted = 0 deleted = FALSE
and org_id = #{orgId} and org_id = #{orgId}
<if test="platformCode != null"> <if test="platformCode != null">
and platform_code = #{platformCode} and platform_code = #{platformCode}
</if> </if>
and type != 1 and type != '1'
</select> </select>
</mapper> </mapper>

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
@@ -8,7 +8,7 @@
* *
from uc_slick_param from uc_slick_param
where where
deleted = 0 deleted = FALSE
<if test="param.id != null"> <if test="param.id != null">
and id = #{param.id} and id = #{param.id}
</if> </if>

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.senmesh.usercenter.district.dao.DistrictMapper"> <mapper namespace="com.senmesh.usercenter.district.dao.DistrictMapper">
@@ -8,7 +8,7 @@
FROM FROM
xs_district xs_district
WHERE WHERE
deleted = 0 deleted = FALSE
AND code IN AND code IN
<foreach open="(" separator="," close=")" collection="codes" index="index" item="code" > <foreach open="(" separator="," close=")" collection="codes" index="index" item="code" >
#{code} #{code}
@@ -22,7 +22,7 @@
FROM FROM
xs_district xs_district
WHERE WHERE
deleted = 0 deleted = FALSE
and parent_id=#{districtId} and parent_id=#{districtId}
ORDER BY code ASC ORDER BY code ASC
</select> </select>

View File

@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.senmesh.usercenter.face.dao.FaceMapper"> <mapper namespace="com.senmesh.usercenter.face.dao.FaceMapper">
<select id="page" resultType="com.senmesh.usercenter.face.dto.FaceInfoDTO"> <select id="page" resultType="com.senmesh.usercenter.face.dto.FaceInfoDTO">
select * from uc_user_face f where f.deleted = 0 select * from uc_user_face f where f.deleted = FALSE
and f.user_id = #{userId} and f.user_id = #{userId}
<if test="type != null"> <if test="type != null">
and f.type = #{type} and f.type = #{type}

View File

@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.senmesh.usercenter.dao.XsRoleStandardTypeMapper"> <mapper namespace="com.senmesh.usercenter.dao.XsRoleStandardTypeMapper">
<select id="page" resultType="com.senmesh.usercenter.dto.RoleStandardTypeDTO"> <select id="page" resultType="com.senmesh.usercenter.dto.RoleStandardTypeDTO">
select * from xs_role_standard_type where deleted = 0 select * from xs_role_standard_type where deleted = FALSE
<if test="roleCode != null"> <if test="roleCode != null">
and role_code = #{roleCode} and role_code = #{roleCode}
</if> </if>

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
@@ -8,7 +8,7 @@
* *
from notice_content_template from notice_content_template
where where
deleted = 0 deleted = FALSE
<if test='param.id != null'> <if test='param.id != null'>
and id = #{param.id} and id = #{param.id}
</if> </if>

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
@@ -12,9 +12,9 @@
FROM FROM
notice_receiver_setting s notice_receiver_setting s
LEFT JOIN uc_user u ON u.id = s.receiver_union_id LEFT JOIN uc_user u ON u.id = s.receiver_union_id
AND u.deleted = 0 AND u.deleted = FALSE
WHERE WHERE
s.deleted = 0 s.deleted = FALSE
AND s.receiver_union_type = 1 AND s.receiver_union_type = 1
<if test='param.id != null'> <if test='param.id != null'>
and s.id = #{param.id} and s.id = #{param.id}
@@ -40,9 +40,9 @@
FROM FROM
notice_receiver_setting s notice_receiver_setting s
LEFT JOIN xs_role r ON r.id = s.receiver_union_id LEFT JOIN xs_role r ON r.id = s.receiver_union_id
AND r.deleted = 0 AND r.deleted = FALSE
WHERE WHERE
s.deleted = 0 s.deleted = FALSE
AND s.receiver_union_type = 2 AND s.receiver_union_type = 2
<if test='param.id != null'> <if test='param.id != null'>
and s.id = #{param.id} and s.id = #{param.id}
@@ -65,14 +65,14 @@
update update
notice_receiver_setting notice_receiver_setting
set set
deleted = 1, deleted = TRUE,
update_time = now(), update_time = now(),
update_by = #{param.operateUserId} update_by = #{param.operateUserId}
where where
template_id = #{param.templateId} template_id = #{param.templateId}
and receiver_union_type = #{param.receiverUnionType} and receiver_union_type = #{param.receiverUnionType}
and org_id = #{param.operateOrgId} and org_id = #{param.operateOrgId}
and deleted = 0 and deleted = FALSE
<if test="param.receiverUnionIds != null"> <if test="param.receiverUnionIds != null">
and receiver_union_id in and receiver_union_id in
<foreach collection="param.receiverUnionIds" item="receiverUnionId" open="(" separator="," close=")"> <foreach collection="param.receiverUnionIds" item="receiverUnionId" open="(" separator="," close=")">
@@ -86,7 +86,7 @@
receiver_union_id receiver_union_id
from notice_receiver_setting from notice_receiver_setting
where where
deleted = 0 deleted = FALSE
and template_id = #{param.templateId} and template_id = #{param.templateId}
and receiver_union_type = #{param.receiverUnionType} and receiver_union_type = #{param.receiverUnionType}
and org_id = #{param.operateOrgId} and org_id = #{param.operateOrgId}
@@ -118,15 +118,15 @@
select select
distinct u.id distinct u.id
from uc_user u from uc_user u
inner join xs_role_allocation ra on ra.allocation_id = u.id and ra.allocation_type = 1 inner join xs_role_allocation ra on ra.allocation_id = u.id and ra.allocation_type = '1'
inner join xs_role r on r.id = ra.role_id inner join xs_role r on r.id = ra.role_id
where where
u.deleted = 0 u.deleted = FALSE
and ra.deleted = 0 and ra.deleted = FALSE
and r.deleted = 0 and r.deleted = FALSE
and r.org_id = #{orgId} and r.org_id = #{orgId}
<!-- 机构内角色 --> <!-- 机构内角色 -->
and r.type = 1 and r.type = '1'
<if test="unionType == 2"> <if test="unionType == 2">
and r.id in and r.id in
<foreach collection="unionIds" item="unionId" open="(" separator="," close=")"> <foreach collection="unionIds" item="unionId" open="(" separator="," close=")">
@@ -147,8 +147,8 @@
from uc_org_user ou from uc_org_user ou
inner join uc_user u on ou.user_id = u.id inner join uc_user u on ou.user_id = u.id
where where
ou.deleted = 0 ou.deleted = FALSE
and u.deleted = 0 and u.deleted = FALSE
and ou.org_id = #{orgId} and ou.org_id = #{orgId}
and u.id in and u.id in
<foreach collection="userIds" item="userId" open="(" separator="," close=")"> <foreach collection="userIds" item="userId" open="(" separator="," close=")">
@@ -161,9 +161,9 @@
select select
distinct id distinct id
from xs_role from xs_role
where where
deleted = 0 deleted = FALSE
and type = 1 and type = '1'
and org_id = #{orgId} and org_id = #{orgId}
and id in and id in
<foreach collection="roleIds" item="roleId" open="(" separator="," close=")"> <foreach collection="roleIds" item="roleId" open="(" separator="," close=")">
@@ -180,8 +180,8 @@
from notice_receiver_setting s from notice_receiver_setting s
inner join uc_user u on s.receiver_union_id = u.id inner join uc_user u on s.receiver_union_id = u.id
where where
s.deleted = 0 s.deleted = FALSE
and u.deleted = 0 and u.deleted = FALSE
and s.template_id = #{param.templateId} and s.template_id = #{param.templateId}
and s.org_id = #{param.orgId} and s.org_id = #{param.orgId}
and s.receiver_union_type = 1 and s.receiver_union_type = 1
@@ -197,8 +197,8 @@
from notice_receiver_setting s from notice_receiver_setting s
inner join xs_role r on s.receiver_union_id = r.id inner join xs_role r on s.receiver_union_id = r.id
where where
s.deleted = 0 s.deleted = FALSE
and r.deleted = 0 and r.deleted = FALSE
and s.template_id = #{param.templateId} and s.template_id = #{param.templateId}
and s.org_id = #{param.orgId} and s.org_id = #{param.orgId}
and s.receiver_union_type = 2 and s.receiver_union_type = 2

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
@@ -13,11 +13,11 @@
from notice_send_record_detail rd from notice_send_record_detail rd
inner join notice_send_record r on r.id = rd.record_id inner join notice_send_record r on r.id = rd.record_id
inner join notice_template t on t.id = r.template_id inner join notice_template t on t.id = r.template_id
left join notice_content_template ct on ct.id = r.content_template_id and ct.deleted = 0 left join notice_content_template ct on ct.id = r.content_template_id and ct.deleted = FALSE
where where
rd.deleted = 0 rd.deleted = FALSE
and r.deleted = 0 and r.deleted = FALSE
and t.deleted = 0 and t.deleted = FALSE
<if test='param.id != null'> <if test='param.id != null'>
and rd.id = #{param.id} and rd.id = #{param.id}
</if> </if>
@@ -53,11 +53,11 @@
from notice_send_record_detail rd from notice_send_record_detail rd
inner join notice_send_record r on r.id = rd.record_id inner join notice_send_record r on r.id = rd.record_id
inner join notice_template t on t.id = r.template_id inner join notice_template t on t.id = r.template_id
left join notice_content_template ct on ct.id = r.content_template_id and ct.deleted = 0 left join notice_content_template ct on ct.id = r.content_template_id and ct.deleted = FALSE
where where
rd.deleted = 0 rd.deleted = FALSE
and r.deleted = 0 and r.deleted = FALSE
and t.deleted = 0 and t.deleted = FALSE
<if test='param.id != null'> <if test='param.id != null'>
and rd.id = #{param.id} and rd.id = #{param.id}
</if> </if>
@@ -97,11 +97,11 @@
from notice_send_record_detail rd from notice_send_record_detail rd
inner join notice_send_record r on r.id = rd.record_id inner join notice_send_record r on r.id = rd.record_id
inner join notice_template t on t.id = r.template_id inner join notice_template t on t.id = r.template_id
left join notice_content_template ct on ct.id = r.content_template_id and ct.deleted = 0 left join notice_content_template ct on ct.id = r.content_template_id and ct.deleted = FALSE
where where
rd.deleted = 0 rd.deleted = FALSE
and r.deleted = 0 and r.deleted = FALSE
and t.deleted = 0 and t.deleted = FALSE
<if test='param.id != null'> <if test='param.id != null'>
and rd.id = #{param.id} and rd.id = #{param.id}
</if> </if>
@@ -141,13 +141,13 @@
rd.update_time = now() rd.update_time = now()
where where
rd.receiver_status = #{param.oldStatus} rd.receiver_status = #{param.oldStatus}
and rd.deleted = 0 and rd.deleted = FALSE
<!-- 通道 --> <!-- 通道 -->
and exists ( and exists (
select * select *
from notice_send_record r from notice_send_record r
where r.id = rd.record_id where r.id = rd.record_id
and r.deleted = 0 and r.deleted = FALSE
and r.channel_type = #{param.channelType} and r.channel_type = #{param.channelType}
) )
<!-- 已读只能本人读 --> <!-- 已读只能本人读 -->

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
@@ -10,9 +10,9 @@
inner join notice_template t on t.id = r.template_id inner join notice_template t on t.id = r.template_id
inner join notice_content_template ct on ct.id = r.content_template_id inner join notice_content_template ct on ct.id = r.content_template_id
where where
r.deleted = 0 r.deleted = FALSE
and t.deleted = 0 and t.deleted = FALSE
and ct.deleted = 0 and ct.deleted = FALSE
<if test='param.id != null'> <if test='param.id != null'>
and r.id = #{param.id} and r.id = #{param.id}
</if> </if>
@@ -32,7 +32,7 @@
and exists ( and exists (
select 1 select 1
from notice_send_record_detail rd from notice_send_record_detail rd
where rd.deleted = 0 where rd.deleted = FALSE
and rd.record_id = r.id and rd.record_id = r.id
and rd.user_id = #{param.userId} and rd.user_id = #{param.userId}
) )
@@ -53,6 +53,6 @@
where where
id = #{param.id} id = #{param.id}
and status = #{param.oldStatus} and status = #{param.oldStatus}
and deleted = 0 and deleted = FALSE
</update> </update>
</mapper> </mapper>

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
@@ -8,7 +8,7 @@
* *
from notice_template from notice_template
where where
deleted = 0 deleted = FALSE
<if test='param.id != null'> <if test='param.id != null'>
and id = #{param.id} and id = #{param.id}
</if> </if>

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
@@ -17,7 +17,7 @@
<sql id="queryFromSql"> <sql id="queryFromSql">
FROM FROM
hr_import_detail_org t hr_import_detail_org t
WHERE t.deleted = 0 WHERE t.deleted = FALSE
<if test='param.id != null'> <if test='param.id != null'>
AND t.id = #{param.id} AND t.id = #{param.id}
</if> </if>

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.senmesh.usercenter.org.dao.OrgMapper"> <mapper namespace="com.senmesh.usercenter.org.dao.OrgMapper">
@@ -17,7 +17,7 @@
trade = #{param.trade}, trade = #{param.trade},
description = #{param.description}, description = #{param.description},
enable = #{param.enable} enable = #{param.enable}
where id = #{param.id} and deleted = 0 where id = #{param.id} and deleted = FALSE
</update> </update>
<select id="listOrgDTO" resultType="com.senmesh.usercenter.org.dto.OrgDTO"> <select id="listOrgDTO" resultType="com.senmesh.usercenter.org.dto.OrgDTO">
@@ -51,9 +51,9 @@
u.phone, u.phone,
(select org_name from xs_org po where o.parent_id = po.id) parentName (select org_name from xs_org po where o.parent_id = po.id) parentName
from xs_org o from xs_org o
left join uc_org_user ou on o.id = ou.org_id and ou.deleted = 0 and ou.administrator = 1 left join uc_org_user ou on o.id = ou.org_id and ou.deleted = FALSE and ou.administrator = TRUE
left join uc_user u on ou.user_id = u.id and u.deleted = 0 left join uc_user u on ou.user_id = u.id and u.deleted = FALSE
where o.deleted = 0 where o.deleted = FALSE
<if test="param.id != null"> <if test="param.id != null">
and o.id = #{param.id} and o.id = #{param.id}
</if> </if>
@@ -112,13 +112,12 @@
u.real_name u.real_name
FROM xs_org o FROM xs_org o
LEFT JOIN uc_org_user ou ON ou.org_id = o.id LEFT JOIN uc_org_user ou ON ou.org_id = o.id
AND ou.administrator = 1 AND ou.administrator = TRUE
AND ou.deleted = AND ou.deleted = FALSE
0
LEFT JOIN uc_user u ON u.id = ou.user_id LEFT JOIN uc_user u ON u.id = ou.user_id
AND u.deleted = 0 AND u.deleted = FALSE
WHERE o.enable = 1 WHERE o.enable = TRUE
AND o.deleted = 0 AND o.deleted = FALSE
AND o.id = #{param.orgId} AND o.id = #{param.orgId}
</select> </select>
<select id="orgPartInfoList" resultType="com.senmesh.usercenter.org.dto.UcOrgPartInfoDTO"> <select id="orgPartInfoList" resultType="com.senmesh.usercenter.org.dto.UcOrgPartInfoDTO">
@@ -127,14 +126,14 @@
FROM FROM
xs_org o xs_org o
WHERE WHERE
o.deleted = 0 o.deleted = FALSE
<if test='param.orgName != null and param.orgName.trim() != ""'> <if test='param.orgName != null and param.orgName.trim() != ""'>
<bind name="orgNameLike" value="'%' + param.orgName + '%'"/> <bind name="orgNameLike" value="'%' + param.orgName + '%'"/>
AND o.org_name like #{orgNameLike} AND o.org_name like #{orgNameLike}
</if> </if>
</select> </select>
<select id="findAllOrg" resultType="com.senmesh.usercenter.org.dto.UcOrgInfoResDTO"> <select id="findAllOrg" resultType="com.senmesh.usercenter.org.dto.UcOrgInfoResDTO">
select id orgId from xs_org where deleted = 0 select id orgId from xs_org where deleted = FALSE
</select> </select>
<select id="openOrgPartInfoList" resultType="com.senmesh.usercenter.org.dto.UcOrgPartInfoDTO"> <select id="openOrgPartInfoList" resultType="com.senmesh.usercenter.org.dto.UcOrgPartInfoDTO">
@@ -146,19 +145,19 @@
ci.phone, ci.phone,
i.name categoryName i.name categoryName
FROM xs_company_product pc FROM xs_company_product pc
INNER JOIN xs_product p ON p.id = pc.product_id AND p.deleted = 0 INNER JOIN xs_product p ON p.id = pc.product_id AND p.deleted = FALSE
INNER JOIN xs_org o ON o.id = pc.org_id AND o.deleted = 0 INNER JOIN xs_org o ON o.id = pc.org_id AND o.deleted = FALSE
LEFT JOIN xs_company_invoice ci ON o.id = ci.org_id AND ci.deleted = 0 LEFT JOIN xs_company_invoice ci ON o.id = ci.org_id AND ci.deleted = FALSE
LEFT JOIN xs_invoice_item_allocate ia ON pc.id = ia.union_id AND ia.deleted = 0 AND ia.status = 1 AND ia.union_type = 3 LEFT JOIN xs_invoice_item_allocate ia ON pc.id = ia.union_id AND ia.deleted = FALSE AND ia.status = 1 AND ia.union_type = 3
LEFT JOIN xs_invoice_item i ON i.id = ia.invoice_item_id AND i.deleted = 0 AND i.parent_id != 0 LEFT JOIN xs_invoice_item i ON i.id = ia.invoice_item_id AND i.deleted = FALSE AND i.parent_id != 0
WHERE pc.deleted = 0 AND o.type = 3 WHERE pc.deleted = FALSE AND o.type = '3'
AND p.product_code = #{param.productCode} AND p.product_code = #{param.productCode}
AND EXISTS ( AND EXISTS (
SELECT * FROM xs_company_product pc SELECT * FROM xs_company_product pc
INNER JOIN xs_product p ON p.id = pc.product_id AND p.deleted = 0 INNER JOIN xs_product p ON p.id = pc.product_id AND p.deleted = FALSE
INNER JOIN xs_org o ON o.id = pc.org_id AND o.deleted = 0 INNER JOIN xs_org o ON o.id = pc.org_id AND o.deleted = FALSE
WHERE pc.deleted = 0 AND o.id = #{param.operateOrgId} AND p.product_code = #{param.productCode} WHERE pc.deleted = FALSE AND o.id = #{param.operateOrgId} AND p.product_code = #{param.productCode}
) )
</select> </select>
</mapper> </mapper>

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
@@ -8,7 +8,7 @@
* *
from uc_org_relation from uc_org_relation
where where
deleted = 0 deleted = FALSE
<if test="param.id != null"> <if test="param.id != null">
and id = #{param.id} and id = #{param.id}
</if> </if>
@@ -29,7 +29,7 @@
from uc_org_relation uor from uc_org_relation uor
inner join xs_org o on o.id = uor.org_id inner join xs_org o on o.id = uor.org_id
where where
uor.deleted = 0 uor.deleted = FALSE
and FIND_IN_SET(#{orgId}, uor.path) and FIND_IN_SET(#{orgId}, uor.path)
<if test="param.orgType != null"> <if test="param.orgType != null">
and uor.org_type = #{param.orgType} and uor.org_type = #{param.orgType}

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
@@ -26,11 +26,11 @@
<if test="param.orgId!=null"> <if test="param.orgId!=null">
LEFT JOIN xs_permission_organization t2 ON LEFT JOIN xs_permission_organization t2 ON
t1.id = t2.permission_package_id t1.id = t2.permission_package_id
AND t2.deleted=0 AND t2.deleted = FALSE
AND t2.allocation_org_id= #{param.orgId} AND t2.allocation_org_id= #{param.orgId}
</if> </if>
WHERE WHERE
t1.deleted = 0 t1.deleted = FALSE
<if test="param.platformCode!=null"> <if test="param.platformCode!=null">
AND t1.platform_code = #{param.platformCode} AND t1.platform_code = #{param.platformCode}
</if> </if>

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
@@ -11,7 +11,7 @@
FROM FROM
xs_org t1 xs_org t1
WHERE WHERE
t1.deleted = 0 t1.deleted = FALSE
AND NOT EXISTS ( AND NOT EXISTS (
SELECT SELECT
1 1
@@ -19,10 +19,10 @@
xs_permission_package a1 xs_permission_package a1
INNER JOIN xs_permission_organization a2 ON INNER JOIN xs_permission_organization a2 ON
a1.id = a2.permission_package_id a1.id = a2.permission_package_id
AND a2.deleted = 0 AND a2.deleted = FALSE
WHERE WHERE
a1.id = #{param.permissionPackageId} a1.id = #{param.permissionPackageId}
AND a1.deleted = 0 AND a1.deleted = FALSE
AND a2.allocation_org_id = t1.id ) AND a2.allocation_org_id = t1.id )
<if test="param.orgCode!=null and param.orgCode.trim() !=''"> <if test="param.orgCode!=null and param.orgCode.trim() !=''">
AND t1.org_code like CONCAT('%', #{param.orgCode}, '%') AND t1.org_code like CONCAT('%', #{param.orgCode}, '%')
@@ -52,13 +52,13 @@
xs_permission_package t1 xs_permission_package t1
INNER JOIN xs_permission_organization t2 ON INNER JOIN xs_permission_organization t2 ON
t1.id = t2.permission_package_id t1.id = t2.permission_package_id
AND t2.deleted = 0 AND t2.deleted = FALSE
INNER JOIN xs_org t3 ON INNER JOIN xs_org t3 ON
t3.id = t2.allocation_org_id t3.id = t2.allocation_org_id
AND t3.deleted = 0 AND t3.deleted = FALSE
WHERE WHERE
t1.deleted = 0 t1.deleted = FALSE
AND t1.id =#{param.permissionPackageId} AND t1.id =#{param.permissionPackageId}
<if test="param.orgCode!=null and param.orgCode.trim() !=''"> <if test="param.orgCode!=null and param.orgCode.trim() !=''">
AND t3.org_code like CONCAT('%', #{param.orgCode}, '%') AND t3.org_code like CONCAT('%', #{param.orgCode}, '%')

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
@@ -10,13 +10,13 @@
xs_permission_package t1 xs_permission_package t1
INNER JOIN xs_permission_resources t2 ON INNER JOIN xs_permission_resources t2 ON
t2.permission_package_id = t1.id t2.permission_package_id = t1.id
AND t2.deleted = 0 AND t2.deleted = FALSE
AND t2.resource_type = 1 AND t2.resource_type = 1
INNER JOIN xs_url t3 ON INNER JOIN xs_url t3 ON
t3.id = t2.resource_id t3.id = t2.resource_id
AND t3.deleted = 0 AND t3.deleted = FALSE
WHERE t1.id= #{permissionPackageId} WHERE t1.id= #{permissionPackageId}
AND t1.deleted=0 AND t1.deleted = FALSE
</select> </select>
<select id="urlComponentList" <select id="urlComponentList"
@@ -44,10 +44,10 @@
AND t3.resource_type = 2 AND t3.resource_type = 2
WHERE WHERE
t2.id = #{param.permissionPackageId} t2.id = #{param.permissionPackageId}
and t2.deleted = 0 and t2.deleted = FALSE
and t3.deleted = 0) t4 ON t1.id = t4.resource_id and t3.deleted = FALSE) t4 ON t1.id = t4.resource_id
WHERE WHERE
t1.deleted = 0 t1.deleted = FALSE
AND t1.url_id = #{param.urlId} AND t1.url_id = #{param.urlId}
<if test="param.selected == true"> <if test="param.selected == true">
and t4.id is not null and t4.id is not null
@@ -79,16 +79,16 @@
xs_permission_package t2 xs_permission_package t2
INNER JOIN xs_permission_resources t3 ON INNER JOIN xs_permission_resources t3 ON
t2.id = t3.permission_package_id t2.id = t3.permission_package_id
AND t3.deleted = 0 AND t3.deleted = FALSE
AND t3.resource_type = 3 AND t3.resource_type = 3
WHERE t2.id= #{param.permissionPackageId} WHERE t2.id= #{param.permissionPackageId}
and t2.deleted = 0 and t2.deleted = FALSE
and t3.deleted = 0 and t3.deleted = FALSE
) t4 ON ) t4 ON
t4.resource_id = t1.id t4.resource_id = t1.id
WHERE WHERE
t1.parent_id = #{param.urlId} t1.parent_id = #{param.urlId}
AND t1.deleted = 0 AND t1.deleted = FALSE
AND t1.type = 2 AND t1.type = 2
<if test="param.selected == true"> <if test="param.selected == true">
and t4.id is not null and t4.id is not null
@@ -102,9 +102,9 @@
UPDATE UPDATE
xs_permission_resources xs_permission_resources
SET SET
deleted = 1 deleted = TRUE
WHERE WHERE
deleted = 0 deleted = FALSE
AND resource_type = 1 AND resource_type = 1
AND permission_package_id= #{permissionPackageId} AND permission_package_id= #{permissionPackageId}
</update> </update>
@@ -114,18 +114,18 @@
xs_permission_package t1 xs_permission_package t1
INNER JOIN xs_permission_resources t2 ON INNER JOIN xs_permission_resources t2 ON
t2.permission_package_id = t1.id t2.permission_package_id = t1.id
AND t2.deleted = 0 AND t2.deleted = FALSE
AND t2.resource_type = 2 AND t2.resource_type = 2
LEFT JOIN xs_component t3 ON LEFT JOIN xs_component t3 ON
t3.id = t2.resource_id t3.id = t2.resource_id
AND t3.deleted = 0 AND t3.deleted = FALSE
LEFT JOIN xs_permission_resources t4 ON LEFT JOIN xs_permission_resources t4 ON
t4.permission_package_id=t1.id t4.permission_package_id=t1.id
AND t4.resource_id=t3.url_id AND t4.resource_id=t3.url_id
AND t4.resource_type=1 AND t4.resource_type=1
AND t4.deleted=0 AND t4.deleted = FALSE
SET t2.deleted=1 SET t2.deleted = TRUE
WHERE t1.deleted=0 AND t4.id IS NULL AND t1.id=#{permissionPackageId} WHERE t1.deleted = FALSE AND t4.id IS NULL AND t1.id=#{permissionPackageId}
</update> </update>
<update id="refreshUrlResourcesInfo"> <update id="refreshUrlResourcesInfo">
@@ -133,18 +133,18 @@
xs_permission_package t1 xs_permission_package t1
INNER JOIN xs_permission_resources t2 ON INNER JOIN xs_permission_resources t2 ON
t2.permission_package_id = t1.id t2.permission_package_id = t1.id
AND t2.deleted = 0 AND t2.deleted = FALSE
AND t2.resource_type = 3 AND t2.resource_type = 3
LEFT JOIN xs_url t3 ON LEFT JOIN xs_url t3 ON
t3.id = t2.resource_id t3.id = t2.resource_id
AND t3.deleted = 0 AND t3.deleted = FALSE
LEFT JOIN xs_permission_resources t4 ON LEFT JOIN xs_permission_resources t4 ON
t4.permission_package_id=t1.id t4.permission_package_id=t1.id
AND t4.resource_id=t3.parent_id AND t4.resource_id=t3.parent_id
AND t4.resource_type=1 AND t4.resource_type=1
AND t4.deleted=0 AND t4.deleted = FALSE
SET t2.deleted=1 SET t2.deleted = TRUE
WHERE t1.deleted=0 AND t4.id IS NULL AND t1.id=#{permissionPackageId} WHERE t1.deleted = FALSE AND t4.id IS NULL AND t1.id=#{permissionPackageId}
</update> </update>
@@ -152,11 +152,11 @@
UPDATE UPDATE
xs_permission_resources t xs_permission_resources t
SET SET
t.deleted = 1, t.deleted = TRUE,
t.update_by = #{usrId}, t.update_by = #{usrId},
t.update_time = now() t.update_time = now()
WHERE WHERE
t.deleted = 0 t.deleted = FALSE
AND t.permission_package_id = #{permissionPackageId} AND t.permission_package_id = #{permissionPackageId}
<if test="removeResourceIds!=null and removeResourceIds.size()>0"> <if test="removeResourceIds!=null and removeResourceIds.size()>0">
AND t.resource_id IN AND t.resource_id IN

View File

@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.senmesh.usercenter.resource.dao.UcComponentMapper"> <mapper namespace="com.senmesh.usercenter.resource.dao.UcComponentMapper">
<select id="list" resultType="com.senmesh.usercenter.resource.dto.ComponentDTO"> <select id="list" resultType="com.senmesh.usercenter.resource.dto.ComponentDTO">
select * from xs_component where deleted = 0 select * from xs_component where deleted = FALSE
<if test="param.urlId != null"> <if test="param.urlId != null">
AND url_id = #{param.urlId} AND url_id = #{param.urlId}
</if> </if>
@@ -18,7 +18,7 @@
FROM FROM
xs_component t1 xs_component t1
WHERE WHERE
t1.deleted = 0 and t1.platform_code = #{systemCode} t1.deleted = FALSE and t1.platform_code = #{systemCode}
<if test="orgId != null"> <if test="orgId != null">
AND t1.id IN ( AND t1.id IN (
SELECT SELECT
@@ -26,11 +26,11 @@
FROM FROM
xs_permission_resources t2 xs_permission_resources t2
INNER JOIN xs_permission_package t3 ON t3.id = t2.permission_package_id INNER JOIN xs_permission_package t3 ON t3.id = t2.permission_package_id
AND t3.deleted = 0 AND t3.deleted = FALSE
INNER JOIN xs_permission_organization t4 ON t4.permission_package_id = t3.id INNER JOIN xs_permission_organization t4 ON t4.permission_package_id = t3.id
AND t4.deleted = 0 AND t4.deleted = FALSE
WHERE WHERE
t2.deleted = 0 AND t2.resource_type = 2 t2.deleted = FALSE AND t2.resource_type = '2'
AND t3.platform_code = #{systemCode} AND t3.platform_code = #{systemCode}
AND t4.allocation_org_id = #{orgId} AND t4.allocation_org_id = #{orgId}
) )

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
@@ -24,7 +24,7 @@
<select id="findAllUrl" resultType="com.senmesh.usercenter.resource.dto.UrlDTO"> <select id="findAllUrl" resultType="com.senmesh.usercenter.resource.dto.UrlDTO">
<include refid="menuListColumn"></include> <include refid="menuListColumn"></include>
WHERE WHERE
deleted = 0 deleted = FALSE
AND platform_code = #{platformCode} AND platform_code = #{platformCode}
AND type = 1 AND type = 1
<if test=" orgId!=null and orgId!=1 "> <if test=" orgId!=null and orgId!=1 ">
@@ -35,12 +35,12 @@
xs_permission_package xpp xs_permission_package xpp
INNER JOIN xs_permission_resources xpr ON INNER JOIN xs_permission_resources xpr ON
xpp.id = xpr.permission_package_id xpp.id = xpr.permission_package_id
AND xpr.deleted = 0 AND xpr.deleted = FALSE
INNER JOIN xs_permission_organization xpo ON INNER JOIN xs_permission_organization xpo ON
xpo.allocation_org_id = #{orgId} xpo.allocation_org_id = #{orgId}
AND xpp.id=xpo.permission_package_id AND xpp.id=xpo.permission_package_id
AND xpo.deleted =0 AND xpo.deleted = FALSE
WHERE xpp.deleted =0 WHERE xpp.deleted = FALSE
) )
</if> </if>
ORDER BY parent_id ORDER BY parent_id
@@ -70,7 +70,7 @@
<select id="list" resultType="com.senmesh.usercenter.resource.dto.UrlDTO"> <select id="list" resultType="com.senmesh.usercenter.resource.dto.UrlDTO">
<include refid="menuListColumn"/> <include refid="menuListColumn"/>
where deleted = 0 where deleted = FALSE
<if test='param.platformCode != null'> <if test='param.platformCode != null'>
AND platform_code = #{param.platformCode} AND platform_code = #{param.platformCode}
</if> </if>
@@ -84,12 +84,12 @@
</select> </select>
<update id="batchDeleted" parameterType="java.util.Set"> <update id="batchDeleted" parameterType="java.util.Set">
update xs_url set deleted = 1 update xs_url set deleted = TRUE
where id in where id in
<foreach collection="urlIds" open="(" separator="," close=")" item="urlId"> <foreach collection="urlIds" open="(" separator="," close=")" item="urlId">
#{urlId} #{urlId}
</foreach> </foreach>
AND deleted = 0 AND deleted = FALSE
</update> </update>
<select id="listUrlDTO" resultType="com.senmesh.usercenter.resource.dto.UrlDTO"> <select id="listUrlDTO" resultType="com.senmesh.usercenter.resource.dto.UrlDTO">
@@ -98,7 +98,7 @@
FROM FROM
xs_url t1 xs_url t1
WHERE WHERE
t1.deleted = 0 t1.deleted = FALSE
and t1.platform_code = #{systemCode} and t1.platform_code = #{systemCode}
and t1.type =1 and t1.type =1
<if test="orgId != null"> <if test="orgId != null">
@@ -108,11 +108,11 @@
FROM FROM
xs_permission_resources t2 xs_permission_resources t2
INNER JOIN xs_permission_package t3 ON t3.id = t2.permission_package_id INNER JOIN xs_permission_package t3 ON t3.id = t2.permission_package_id
AND t3.deleted = 0 AND t3.deleted = FALSE
INNER JOIN xs_permission_organization t4 ON t4.permission_package_id = t3.id INNER JOIN xs_permission_organization t4 ON t4.permission_package_id = t3.id
AND t4.deleted = 0 AND t4.deleted = FALSE
WHERE WHERE
t2.deleted = 0 AND t2.resource_type in (1,3) t2.deleted = FALSE AND t2.resource_type in ('1','3')
AND t3.platform_code = #{systemCode} AND t3.platform_code = #{systemCode}
AND t4.allocation_org_id = #{orgId} AND t4.allocation_org_id = #{orgId}
) )

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
@@ -11,7 +11,7 @@
FROM FROM
xs_search_history sh xs_search_history sh
WHERE WHERE
sh.deleted = 0 AND sh.user_id = #{userId} sh.deleted = FALSE AND sh.user_id = #{userId}
GROUP BY GROUP BY
sh.context sh.context
ORDER BY ORDER BY

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
@@ -11,11 +11,10 @@
FROM FROM
uc_domain_auth da uc_domain_auth da
LEFT JOIN uc_auth_client ac ON ac.id = da.auth_client_id LEFT JOIN uc_auth_client ac ON ac.id = da.auth_client_id
AND ac.deleted = AND ac.deleted = FALSE LEFT JOIN uc_auth_type atp ON atp.auth_type_code = da.auth_type_code
0 LEFT JOIN uc_auth_type atp ON atp.auth_type_code = da.auth_type_code AND atp.deleted = FALSE
AND atp.deleted = 0
WHERE WHERE
da.deleted = 0 da.deleted = FALSE
<if test="param.domainId != null"> <if test="param.domainId != null">
and da.domain_id = #{param.domainId} and da.domain_id = #{param.domainId}
</if> </if>
@@ -28,16 +27,16 @@
FROM FROM
uc_auth_client ac uc_auth_client ac
LEFT JOIN uc_auth_type atp ON atp.auth_type_code = ac.auth_type_code LEFT JOIN uc_auth_type atp ON atp.auth_type_code = ac.auth_type_code
AND atp.deleted = 0 AND atp.deleted = FALSE
WHERE WHERE
ac.deleted = 0 ac.deleted = FALSE
AND ac.id NOT IN ( AND ac.id NOT IN (
SELECT DISTINCT SELECT DISTINCT
auth_client_id auth_client_id
FROM FROM
uc_domain_auth uc_domain_auth
WHERE WHERE
deleted = 0) deleted = FALSE)
</select> </select>
</mapper> </mapper>

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
@@ -7,9 +7,9 @@
select select
d.*,o.org_name d.*,o.org_name
from uc_domain d from uc_domain d
LEFT JOIN xs_org o on d.org_id = o.id AND o.deleted = 0 LEFT JOIN xs_org o on d.org_id = o.id AND o.deleted = FALSE
where where
d.deleted = 0 d.deleted = FALSE
<if test="param.id != null"> <if test="param.id != null">
and d.id = #{param.id} and d.id = #{param.id}
</if> </if>
@@ -25,7 +25,7 @@
d.* d.*
from uc_domain d from uc_domain d
where where
d.deleted = 0 d.deleted = FALSE
<if test="domainOrIp != null and domainOrIp != ''"> <if test="domainOrIp != null and domainOrIp != ''">
and (d.domain_name = #{domainOrIp} or d.ip_port = #{domainOrIp}) and (d.domain_name = #{domainOrIp} or d.ip_port = #{domainOrIp})
</if> </if>

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.senmesh.usercenter.sys.dao.DomainSettingMapper"> <mapper namespace="com.senmesh.usercenter.sys.dao.DomainSettingMapper">
@@ -13,9 +13,9 @@
<if test=' param.domainOrIp != null and param.domainOrIp.trim() != "" '> <if test=' param.domainOrIp != null and param.domainOrIp.trim() != "" '>
LEFT JOIN uc_domain d ON d.id = ds.domain_id LEFT JOIN uc_domain d ON d.id = ds.domain_id
</if> </if>
WHERE ds.deleted = 0 WHERE ds.deleted = FALSE
<if test=' param.domainOrIp != null and param.domainOrIp.trim() != "" '> <if test=' param.domainOrIp != null and param.domainOrIp.trim() != "" '>
AND d.deleted = 0 AND d.deleted = FALSE
</if> </if>
<if test=' param.domainOrIp != null and param.domainOrIp.trim() != "" '> <if test=' param.domainOrIp != null and param.domainOrIp.trim() != "" '>
AND (d.domain_name = #{param.domainOrIp} or d.ip_port = #{param.domainOrIp}) AND (d.domain_name = #{param.domainOrIp} or d.ip_port = #{param.domainOrIp})

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
@@ -8,7 +8,7 @@
* *
from uc_faq_file from uc_faq_file
where where
deleted = 0 and question_id = #{param.questionId} deleted = FALSE and question_id = #{param.questionId}
order by id desc order by id desc
</select> </select>
</mapper> </mapper>

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
@@ -8,7 +8,7 @@
* *
from uc_faq from uc_faq
where where
deleted = 0 deleted = FALSE
<if test="param.faqType != null"> <if test="param.faqType != null">
and faq_type = #{param.faqType} and faq_type = #{param.faqType}
</if> </if>

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
@@ -8,7 +8,7 @@
f.*,u.nickname f.*,u.nickname
from uc_feedback f left join uc_user u on f.user_id = u.id from uc_feedback f left join uc_user u on f.user_id = u.id
where where
f.deleted = 0 f.deleted = FALSE
<if test='param.nickname != null and param.nickname.trim() != ""'> <if test='param.nickname != null and param.nickname.trim() != ""'>
<bind name="nicknameLike" value="'%' + param.nickname + '%'" /> <bind name="nicknameLike" value="'%' + param.nickname + '%'" />
AND u.nickname like #{nicknameLike} AND u.nickname like #{nicknameLike}

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
@@ -8,7 +8,7 @@
* *
from uc_platform from uc_platform
where where
deleted = 0 deleted = FALSE
<if test="param.id != null"> <if test="param.id != null">
and id = #{param.id} and id = #{param.id}
</if> </if>
@@ -21,7 +21,7 @@
* *
from uc_platform from uc_platform
where where
deleted = 0 deleted = FALSE
<if test="param.id != null"> <if test="param.id != null">
and id = #{param.id} and id = #{param.id}
</if> </if>

View File

@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.senmesh.usercenter.tag.dao.TagMapper"> <mapper namespace="com.senmesh.usercenter.tag.dao.TagMapper">
<select id="page" resultType="com.senmesh.usercenter.tag.dto.TagDTO"> <select id="page" resultType="com.senmesh.usercenter.tag.dto.TagDTO">
select t.* from xs_tag t select t.* from xs_tag t
where t.deleted = 0 where t.deleted = FALSE
<if test="tagType != null"> <if test="tagType != null">
and t.tag_type = #{tagType} and t.tag_type = #{tagType}
</if> </if>

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.senmesh.usercenter.tag.dao.TagRelationshipMapper"> <mapper namespace="com.senmesh.usercenter.tag.dao.TagRelationshipMapper">
<update id="updatePost"> <update id="updatePost">
@@ -6,7 +6,7 @@
set update_time = now(), set update_time = now(),
update_by = 1, update_by = 1,
affiliation_tags = #{affiliationTags} affiliation_tags = #{affiliationTags}
where deleted = 0 where deleted = FALSE
and id = #{id} and id = #{id}
</update> </update>
@@ -14,7 +14,7 @@
select id, select id,
affiliation_tags affiliationTags affiliation_tags affiliationTags
from hr_operating_post from hr_operating_post
where deleted = 0 where deleted = FALSE
and id = #{id} and id = #{id}
</select> </select>
<select id="sourceIdMap" resultType="com.senmesh.usercenter.tag.dto.TagRelationshipInfoDTO"> <select id="sourceIdMap" resultType="com.senmesh.usercenter.tag.dto.TagRelationshipInfoDTO">
@@ -26,8 +26,8 @@
xs_tag_relationship tr xs_tag_relationship tr
LEFT JOIN xs_tag t ON t.id = tr.tag_id LEFT JOIN xs_tag t ON t.id = tr.tag_id
WHERE WHERE
tr.deleted = 0 tr.deleted = FALSE
AND t.deleted = 0 AND t.deleted = FALSE
AND tr.source_type = #{sourceType} AND tr.source_type = #{sourceType}
<if test="sourceIds != null"> <if test="sourceIds != null">
AND tr.source_id in AND tr.source_id in
@@ -43,8 +43,8 @@
xs_tag_relationship tr xs_tag_relationship tr
LEFT JOIN xs_tag t ON t.id = tr.tag_id LEFT JOIN xs_tag t ON t.id = tr.tag_id
WHERE WHERE
tr.deleted = 0 tr.deleted = FALSE
AND t.deleted = 0 AND t.deleted = FALSE
AND tr.source_type = #{sourceType} AND tr.source_type = #{sourceType}
<if test="tagNames != null"> <if test="tagNames != null">
AND t.tag_name in AND t.tag_name in

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
@@ -10,7 +10,7 @@
* *
from uc_org_user from uc_org_user
where where
deleted = 0 deleted = FALSE
<if test="param.id != null"> <if test="param.id != null">
and id = #{param.id} and id = #{param.id}
</if> </if>
@@ -33,9 +33,9 @@
select select
CASE WHEN count(*) = 0 THEN 1 ELSE 0 end CASE WHEN count(*) = 0 THEN 1 ELSE 0 end
from uc_org_user from uc_org_user
where deleted = 0 where deleted = FALSE
and org_id = #{orgId} and org_id = #{orgId}
and (user_id = #{userId} or administrator = 1) and (user_id = #{userId} or administrator = TRUE)
</select> </select>
<select id="existOrgUser" resultType="boolean"> <select id="existOrgUser" resultType="boolean">
@@ -43,15 +43,15 @@
CASE WHEN count(*) > 0 THEN 1 ELSE 0 end CASE WHEN count(*) > 0 THEN 1 ELSE 0 end
from uc_user u from uc_user u
where u.type = 1 where u.type = 1
and u.deleted = 0 and u.deleted = FALSE
and u.phone = #{phone} and u.phone = #{phone}
and exists and exists
(select * (select *
from uc_org_user ou from uc_org_user ou
inner join xs_org o on o.id = ou.org_id inner join xs_org o on o.id = ou.org_id
where ou.user_id = u.id where ou.user_id = u.id
and ou.deleted = 0 and ou.deleted = FALSE
and o.enable = 1 and o.enable = TRUE
) )
</select> </select>
@@ -67,12 +67,12 @@
FROM FROM
xs_org t1 xs_org t1
INNER JOIN uc_org_user t2 ON t1.id = t2.org_id INNER JOIN uc_org_user t2 ON t1.id = t2.org_id
AND t2.deleted = 0 AND t2.deleted = FALSE
INNER JOIN uc_user t3 ON t2.user_id = t3.id INNER JOIN uc_user t3 ON t2.user_id = t3.id
AND t3.deleted = 0 AND t3.deleted = FALSE
WHERE WHERE
t1.deleted = 0 t1.deleted = FALSE
and t1.enable = 1 and t1.enable = TRUE
AND t3.id = #{userId} AND t3.id = #{userId}
<if test="orgId != null"> <if test="orgId != null">
and t1.id = #{orgId} and t1.id = #{orgId}
@@ -103,8 +103,8 @@
uc_user u uc_user u
LEFT JOIN uc_org_user ou ON u.id = ou.user_id LEFT JOIN uc_org_user ou ON u.id = ou.user_id
WHERE WHERE
u.deleted = 0 u.deleted = FALSE
AND ou.deleted = 0 AND ou.deleted = FALSE
<if test="param.userId != null"> <if test="param.userId != null">
AND u.id = #{param.userId} AND u.id = #{param.userId}
</if> </if>

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
@@ -8,7 +8,7 @@
* *
from uc_user_auth from uc_user_auth
where where
deleted = 0 deleted = FALSE
<if test="param.id != null"> <if test="param.id != null">
and id = #{param.id} and id = #{param.id}
</if> </if>
@@ -36,6 +36,6 @@
update_time = now() update_time = now()
where where
user_id = #{deletedUserId} user_id = #{deletedUserId}
and deleted = 0 and deleted = FALSE
</update> </update>
</mapper> </mapper>

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
@@ -12,8 +12,8 @@
uc_user uu uc_user uu
LEFT JOIN uc_user_bank_account uuba ON uuba.user_id = uu.id LEFT JOIN uc_user_bank_account uuba ON uuba.user_id = uu.id
WHERE WHERE
uu.deleted = 0 uu.deleted = FALSE
AND uuba.deleted = 0 AND uuba.deleted = FALSE
AND uuba.default_account = 1 AND uuba.default_account = 1
AND uu.card_no IN AND uu.card_no IN
<foreach collection="cardNos" item="cardNo" open="(" close=")" separator=","> <foreach collection="cardNos" item="cardNo" open="(" close=")" separator=",">
@@ -27,7 +27,7 @@
FROM FROM
uc_user_bank_account uc_user_bank_account
WHERE WHERE
deleted = 0 deleted = FALSE
<if test="param.id != null"> <if test="param.id != null">
and id = #{param.id} and id = #{param.id}
</if> </if>
@@ -53,7 +53,7 @@
and exists ( and exists (
select 1 from uc_user u select 1 from uc_user u
where u.id = user_id where u.id = user_id
and u.deleted = 0 and u.status != 3 and u.deleted = FALSE and u.status != 3
) )
</if> </if>
</select> </select>
@@ -71,7 +71,7 @@
</if> </if>
</set> </set>
where user_id = #{param.operateUserId} where user_id = #{param.operateUserId}
and deleted = 0 and deleted = FALSE
and (id = #{param.id} and (id = #{param.id}
<if test="param.defaultAccount == true"> <if test="param.defaultAccount == true">
or default_account = 1 or default_account = 1

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
@@ -9,7 +9,7 @@
* *
from uc_user_bank_card_four_verification from uc_user_bank_card_four_verification
where where
deleted = 0 deleted = FALSE
<if test="param.id != null"> <if test="param.id != null">
and id = #{param.id} and id = #{param.id}
</if> </if>

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
@@ -8,7 +8,7 @@
* *
from uc_user_bank_card_three_verification from uc_user_bank_card_three_verification
where where
deleted = 0 deleted = FALSE
<if test="param.id != null"> <if test="param.id != null">
and id = #{param.id} and id = #{param.id}
</if> </if>

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
@@ -13,7 +13,7 @@
uc_user_cancel ucc uc_user_cancel ucc
LEFT JOIN uc_user uc ON uc.id = ucc.user_id LEFT JOIN uc_user uc ON uc.id = ucc.user_id
WHERE WHERE
ucc.deleted = 0 ucc.deleted = FALSE
<if test="param.userId != null"> <if test="param.userId != null">
and ucc.user_id = #{param.userId} and ucc.user_id = #{param.userId}
</if> </if>
@@ -33,7 +33,7 @@
uc.card_no uc.card_no
FROM uc_user_cancel ucc FROM uc_user_cancel ucc
LEFT JOIN uc_user uc ON uc.id = ucc.user_id LEFT JOIN uc_user uc ON uc.id = ucc.user_id
WHERE ucc.deleted = 0 WHERE ucc.deleted = FALSE
AND ucc.status = 1 AND ucc.status = 1
AND TO_DAYS( AND TO_DAYS(
NOW()) - TO_DAYS(ucc.create_time) = 1 NOW()) - TO_DAYS(ucc.create_time) = 1
@@ -44,7 +44,7 @@
uc.phone, uc.phone,
uc.card_no uc.card_no
FROM uc_user uc FROM uc_user uc
WHERE uc.deleted = 0 WHERE uc.deleted = FALSE
AND uc.id = #{userId} AND uc.id = #{userId}
</select> </select>
</mapper> </mapper>

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
@@ -8,7 +8,7 @@
* *
from uc_user_config from uc_user_config
where where
deleted = 0 deleted = FALSE
<if test="param.id != null"> <if test="param.id != null">
and id = #{param.id} and id = #{param.id}
</if> </if>

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
@@ -8,7 +8,7 @@
uip.* uip.*
from uc_user_identity_photo uip from uc_user_identity_photo uip
where where
uip.deleted = 0 uip.deleted = FALSE
<if test="param.id != null"> <if test="param.id != null">
and uip.id = #{param.id} and uip.id = #{param.id}
</if> </if>

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
@@ -10,19 +10,19 @@
update_by = #{operateUserId}, update_by = #{operateUserId},
update_time = now() update_time = now()
where id = #{userId} where id = #{userId}
and deleted = 0 and deleted = FALSE
and status != 3 and status != 3
</update> </update>
<select id="listUserDTO" resultType="com.senmesh.usercenter.user.dto.UserDTO"> <select id="listUserDTO" resultType="com.senmesh.usercenter.user.dto.UserDTO">
select * from ( select * from (
select select
(select platform_code from uc_user_register ur where ur.deleted = 0 and ur.user_id = uu.id order by id limit 1) (select platform_code from uc_user_register ur where ur.deleted = FALSE and ur.user_id = uu.id order by id limit 1)
as platform_code, as platform_code,
uu.*,IFNULL(ucc.status,-1) cancelStatus uu.*,COALESCE(ucc.status,-1) cancelStatus
from uc_user uu from uc_user uu
LEFT JOIN uc_user_cancel ucc ON ucc.user_id = uu.id AND ucc.deleted = 0 LEFT JOIN uc_user_cancel ucc ON ucc.user_id = uu.id AND ucc.deleted = FALSE
where where
uu.deleted = 0 uu.deleted = FALSE
<!-- 非api用户 --> <!-- 非api用户 -->
and uu.type != 3 and uu.type != 3
<if test="param.id != null"> <if test="param.id != null">
@@ -75,7 +75,7 @@
and uu.status = #{param.status} and uu.status = #{param.status}
</if> </if>
<if test="param.cancelStatus != null"> <if test="param.cancelStatus != null">
and IFNULL(ucc.status,-1) = #{param.cancelStatus} and COALESCE(ucc.status,-1) = #{param.cancelStatus}
</if> </if>
<if test="param.authenticated != null"> <if test="param.authenticated != null">
and uu.authenticated = #{param.authenticated} and uu.authenticated = #{param.authenticated}
@@ -101,7 +101,7 @@
update_time = now() update_time = now()
where where
id = #{operateUserId} id = #{operateUserId}
and deleted = 0 and status != 3 and deleted = FALSE and status != 3
and (password is null or password = '') and (password is null or password = '')
</update> </update>
@@ -112,7 +112,7 @@
FROM FROM
uc_user u uc_user u
WHERE WHERE
u.deleted = 0 and u.status != 3 u.deleted = FALSE and u.status != 3
<if test="param.username!=null and param.username!=''"> <if test="param.username!=null and param.username!=''">
and u.username = #{param.username} and u.username = #{param.username}
</if> </if>
@@ -124,13 +124,13 @@
<if test="param.userType == 2"> <if test="param.userType == 2">
<!-- 个人用户(绑定用户|不存在绑定用户) --> <!-- 个人用户(绑定用户|不存在绑定用户) -->
and ( and (
u.phone_binding = 1 u.phone_binding = TRUE
or not exists (select 1 or not exists (select 1
from uc_user pu from uc_user pu
where pu.phone = #{param.phone} where pu.phone = #{param.phone}
and pu.phone_binding = 1 and pu.phone_binding = TRUE
and pu.type = 2 and pu.type = 2
and pu.deleted = 0) and pu.deleted = FALSE)
) )
</if> </if>
@@ -157,7 +157,7 @@
from uc_org_user ou from uc_org_user ou
where ou.user_id = u.id where ou.user_id = u.id
and ou.org_id = #{param.orgId} and ou.org_id = #{param.orgId}
and ou.deleted = 0 and ou.deleted = FALSE
) )
</if> </if>
</select> </select>
@@ -168,7 +168,7 @@
from uc_user_auth ua from uc_user_auth ua
inner join uc_user u on ua.user_id = u.id inner join uc_user u on ua.user_id = u.id
where where
ua.deleted = 0 and u.deleted = 0 and u.status != 3 ua.deleted = FALSE and u.deleted = FALSE and u.status != 3
<if test="param.id != null"> <if test="param.id != null">
and ua.id = #{param.id} and ua.id = #{param.id}
</if> </if>
@@ -191,7 +191,7 @@
update_time = now() update_time = now()
where where
id != #{userId} id != #{userId}
and deleted = 0 and status != 3 and deleted = FALSE and status != 3
and type = 2 and type = 2
and phone = #{phone} and phone = #{phone}
</update> </update>
@@ -204,15 +204,15 @@
card_no = #{param.cardNo}, card_no = #{param.cardNo},
birthday = SUBSTR(#{param.cardNo},7,8), birthday = SUBSTR(#{param.cardNo},7,8),
gender = CASE WHEN SUBSTR(#{param.cardNo},17,1)%2 =1 THEN 1 ELSE 2 END, gender = CASE WHEN SUBSTR(#{param.cardNo},17,1)%2 =1 THEN 1 ELSE 2 END,
authenticated = 1, authenticated = TRUE,
update_time = now() update_time = now()
where where
type = 2 type = 2
<if test="param.userId == null"> <if test="param.userId == null">
and card_no = #{param.cardNo} and card_no = #{param.cardNo}
</if> </if>
and deleted = 0 and status != 3 and deleted = FALSE and status != 3
and authenticated = 0 and authenticated = FALSE
<if test="param.userId != null"> <if test="param.userId != null">
and id = #{param.userId} and id = #{param.userId}
</if> </if>
@@ -221,7 +221,7 @@
<update id="bindingPhone"> <update id="bindingPhone">
update uc_user update uc_user
set set
phone_binding = 1, phone_binding = TRUE,
<if test="phone != null"> <if test="phone != null">
phone = #{phone}, phone = #{phone},
</if> </if>
@@ -231,23 +231,23 @@
<if test="phone == null"> <if test="phone == null">
and length(phone) = 11 and length(phone) = 11
</if> </if>
and deleted = 0 and status != 3 and deleted = FALSE and status != 3
</update> </update>
<select id="getUserExtendStatus" resultType="com.senmesh.usercenter.user.dto.UserExtendStatusDTO"> <select id="getUserExtendStatus" resultType="com.senmesh.usercenter.user.dto.UserExtendStatusDTO">
SELECT SELECT
uu.id AS userId, uu.id AS userId,
IFNULL(authenticated,0) AS authenticatedStatus, COALESCE(authenticated,0) AS authenticatedStatus,
IFNULL(phone_binding,0) AS phoneBindStatus, COALESCE(phone_binding,0) AS phoneBindStatus,
(select IF(MAX(id) is null || id = '',0,true) from uc_user_identity_photo where (select IF(MAX(id) is null || id = '',0,true) from uc_user_identity_photo where
deleted = 0 and user_id = uu.id) AS cardUploadStatus, deleted = FALSE and user_id = uu.id) AS cardUploadStatus,
(select IF(MAX(id) is null,0,true) from uc_user_auth where deleted = 0 and user_id = uu.id) AS wxBindStatus, (select IF(MAX(id) is null,0,true) from uc_user_auth where deleted = FALSE and user_id = uu.id) AS wxBindStatus,
(select IFNULL(MAX(status),1) from uc_user_bank_card_three_verification where (select COALESCE(MAX(status),1) from uc_user_bank_card_three_verification where
deleted = 0 and user_id = uu.id) AS bankCardAuthStatus deleted = FALSE and user_id = uu.id) AS bankCardAuthStatus
FROM FROM
uc_user uu uc_user uu
WHERE WHERE
uu.deleted = 0 uu.deleted = FALSE
and uu.id = #{userId} and uu.id = #{userId}
</select> </select>
<select id="pagePlatformUser" resultType="com.senmesh.usercenter.user.dto.PlatformUserInfoDTO"> <select id="pagePlatformUser" resultType="com.senmesh.usercenter.user.dto.PlatformUserInfoDTO">
@@ -266,11 +266,11 @@
ue.wechat_qr_code ue.wechat_qr_code
FROM FROM
uc_user u uc_user u
LEFT JOIN uc_user_extension ue ON u.id = ue.user_id AND ue.deleted = 0 LEFT JOIN uc_user_extension ue ON u.id = ue.user_id AND ue.deleted = FALSE
WHERE WHERE
u.deleted = 0 u.deleted = FALSE
AND u.type = 1 AND u.type = 1
AND u.id IN ( SELECT ou.user_id FROM uc_org_user ou WHERE ou.deleted = 0 AND ou.org_id = #{param.orgId} AND administrator = 0 ) AND u.id IN ( SELECT ou.user_id FROM uc_org_user ou WHERE ou.deleted = FALSE AND ou.org_id = #{param.orgId} AND administrator = FALSE )
<if test="param.username != null and param.username.trim() != ''"> <if test="param.username != null and param.username.trim() != ''">
<bind name="usernameLike" value="'%' + param.username+ '%'" /> <bind name="usernameLike" value="'%' + param.username+ '%'" />
and u.username like #{usernameLike} and u.username like #{usernameLike}
@@ -310,13 +310,13 @@
in in
</if> </if>
( (
select ifnull(allocation_id,'') select COALESCE(allocation_id,'')
from from
xs_role_allocation t1,xs_role t2 xs_role_allocation t1,xs_role t2
where where
t1.deleted = 0 t1.deleted = FALSE
AND t1.role_id=t2.id AND t1.role_id=t2.id
AND t2.deleted=0 AND t2.deleted = FALSE
AND t2.platform_code= #{param.platformCode} AND t2.platform_code= #{param.platformCode}
and role_id = #{param.roleId} and role_id = #{param.roleId}
) )
@@ -341,24 +341,24 @@
uc_user u uc_user u
LEFT JOIN uc_org_user ou ON u.id = ou.user_id LEFT JOIN uc_org_user ou ON u.id = ou.user_id
WHERE WHERE
u.deleted = 0 u.deleted = FALSE
AND ou.deleted = 0 AND ou.deleted = FALSE
AND u.type = 1 AND u.type = 1
AND u.enabled = 1 AND u.enabled = TRUE
AND u.id = #{userId} AND u.id = #{userId}
AND ou.org_id = #{existLoginOrgId} AND ou.org_id = #{existLoginOrgId}
</select> </select>
<update id="mergeUser"> <update id="mergeUser">
<!-- 将手机状态同步到选择的用户上 --> <!-- 将手机状态同步到选择的用户上 -->
update uc_user u update uc_user
set u.phone = (select temp.phone from (select phone from uc_user where id = #{phoneUserId}) temp), set phone = (select phone from uc_user where id = #{phoneUserId}),
u.phone_binding = 1, phone_binding = TRUE,
u.update_time = now() update_time = now()
where where
u.id = #{retainUserId} id = #{retainUserId}
and u.deleted = 0 and u.status != 3 and deleted = FALSE and status != 3
and u.phone_binding = 0 and phone_binding = FALSE
</update> </update>
<select id="findUserInfo" resultType="com.senmesh.security.dto.UserInfoDTO"> <select id="findUserInfo" resultType="com.senmesh.security.dto.UserInfoDTO">
@@ -375,10 +375,10 @@
case when u.password is null or password = '' then 0 else 1 end initialedPassword, case when u.password is null or password = '' then 0 else 1 end initialedPassword,
o.recruit_position_type o.recruit_position_type
FROM uc_user u FROM uc_user u
LEFT JOIN uc_org_user ou ON ou.user_id = u.id AND ou.deleted = 0 LEFT JOIN uc_org_user ou ON ou.user_id = u.id AND ou.deleted = FALSE
LEFT JOIN xs_org o ON o.id = ou.org_id AND o.deleted = 0 LEFT JOIN xs_org o ON o.id = ou.org_id AND o.deleted = FALSE
WHERE u.deleted = 0 WHERE u.deleted = FALSE
and u.enabled = 1 and u.enabled = TRUE
and u.status != 3 and u.status != 3
AND o.id = #{orgId} AND o.id = #{orgId}
AND u.id = #{userId} AND u.id = #{userId}
@@ -387,15 +387,15 @@
<select id="existUsername" resultType="boolean"> <select id="existUsername" resultType="boolean">
SELECT CASE WHEN count(id)>0 THEN 1 ELSE 0 end FROM uc_user SELECT CASE WHEN count(id)>0 THEN 1 ELSE 0 end FROM uc_user
WHERE username = #{username} and id != #{userId} WHERE username = #{username} and id != #{userId}
and deleted = 0 and status != 3 and deleted = FALSE and status != 3
</select> </select>
<select id="personInCharge" resultType="com.senmesh.usercenter.user.dto.UserDTO"> <select id="personInCharge" resultType="com.senmesh.usercenter.user.dto.UserDTO">
select select
u.id,u.nickname,u.phone,u.avatar, u.id,u.nickname,u.phone,u.avatar,
ue.wechat_qr_code ue.wechat_qr_code
from uc_user u from uc_user u
left join uc_user_extension ue on u.id = ue.user_id and ue.deleted = 0 left join uc_user_extension ue on u.id = ue.user_id and ue.deleted = FALSE
where u.deleted = 0 and u.type = 1 and u.status = 2 and u.id in where u.deleted = FALSE and u.type = 1 and u.status = 2 and u.id in
<foreach close=")" collection="userIds" index="index" item="id" open="(" separator=","> <foreach close=")" collection="userIds" index="index" item="id" open="(" separator=",">
#{id} #{id}
</foreach> </foreach>
@@ -429,11 +429,11 @@
<select id="listByRole" resultType="com.senmesh.usercenter.user.dto.SelectUserDTO"> <select id="listByRole" resultType="com.senmesh.usercenter.user.dto.SelectUserDTO">
SELECT distinct u.id, u.nickname, u.real_name SELECT distinct u.id, u.nickname, u.real_name
from uc_user u from uc_user u
inner join xs_role_allocation ra on u.id = ra.allocation_id and allocation_type = 1 inner join xs_role_allocation ra on u.id = ra.allocation_id and allocation_type = '1'
inner join xs_role r on ra.role_id = r.id inner join xs_role r on ra.role_id = r.id
where u.deleted = 0 where u.deleted = FALSE
and ra.deleted = 0 and ra.deleted = FALSE
and r.deleted = 0 and r.deleted = FALSE
and r.standard_type = #{param.roleStandardTypeCode} and r.standard_type = #{param.roleStandardTypeCode}
and r.platform_code = #{param.platformCode} and r.platform_code = #{param.platformCode}
and r.org_id = #{param.orgId} and r.org_id = #{param.orgId}
@@ -454,11 +454,11 @@
FROM FROM
uc_user u uc_user u
WHERE WHERE
u.deleted = 0 u.deleted = FALSE
AND u.type = 1 AND u.type = 1
AND u.id IN ( SELECT ou.user_id FROM uc_org_user ou WHERE ou.deleted = 0 AND ou.org_id = #{param.orgId} AND u.id IN ( SELECT ou.user_id FROM uc_org_user ou WHERE ou.deleted = FALSE AND ou.org_id = #{param.orgId}
<if test="param.allUser == null"> <if test="param.allUser == null">
AND administrator = 0 AND administrator = FALSE
</if> </if>
) )
<if test="param.username != null and param.username.trim() != ''"> <if test="param.username != null and param.username.trim() != ''">
@@ -500,13 +500,13 @@
in in
</if> </if>
( (
select ifnull(allocation_id,'') select COALESCE(allocation_id,'')
from from
xs_role_allocation t1,xs_role t2 xs_role_allocation t1,xs_role t2
where where
t1.deleted = 0 t1.deleted = FALSE
AND t1.role_id=t2.id AND t1.role_id=t2.id
AND t2.deleted=0 AND t2.deleted = FALSE
AND t2.platform_code= #{param.platformCode} AND t2.platform_code= #{param.platformCode}
and role_id = #{param.roleId} and role_id = #{param.roleId}
) )
@@ -517,10 +517,10 @@
<select id="listByRealNameOrPhone" resultType="com.senmesh.usercenter.user.dto.UserDTO"> <select id="listByRealNameOrPhone" resultType="com.senmesh.usercenter.user.dto.UserDTO">
select u.id,u.real_name,u.phone from uc_user u select u.id,u.real_name,u.phone from uc_user u
left join uc_org_user ou on u.id = ou.user_id and ou.deleted = 0 left join uc_org_user ou on u.id = ou.user_id and ou.deleted = FALSE
where where
u.deleted = 0 u.deleted = FALSE
AND u.status != 3 AND u.status != 3
AND u.type = 1 AND u.type = 1
and ou.org_id = #{orgId} and ou.org_id = #{orgId}
@@ -569,7 +569,7 @@
set status = 2, set status = 2,
update_time = now() update_time = now()
where id = #{userId} where id = #{userId}
and deleted = 0 and deleted = FALSE
and status != 3 and status != 3
</update> </update>

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
@@ -8,7 +8,7 @@
* *
from uc_user_phone_three_verification from uc_user_phone_three_verification
where where
deleted = 0 deleted = FALSE
<if test="param.id != null"> <if test="param.id != null">
and id = #{param.id} and id = #{param.id}
</if> </if>

View File

@@ -1,17 +1,17 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.senmesh.usercenter.user.dao.UserPostalInfoMapper"> <mapper namespace="com.senmesh.usercenter.user.dao.UserPostalInfoMapper">
<update id="cancelDefaultedById"> <update id="cancelDefaultedById">
update uc_user_postal_info set defaulted = 0 where create_by = #{userId} and id != #{id} and deleted = 0 update uc_user_postal_info set defaulted = FALSE where create_by = #{userId} and id != #{id} and deleted = FALSE
</update> </update>
<select id="listUserPostalInfoDTO" resultType="com.senmesh.usercenter.user.dto.UserPostalInfoDTO"> <select id="listUserPostalInfoDTO" resultType="com.senmesh.usercenter.user.dto.UserPostalInfoDTO">
select select
* *
from uc_user_postal_info from uc_user_postal_info
where where
deleted = 0 deleted = FALSE
<if test="param.id != null"> <if test="param.id != null">
and id = #{param.id} and id = #{param.id}
</if> </if>

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
@@ -8,7 +8,7 @@
* *
from uc_user_register from uc_user_register
where where
deleted = 0 deleted = FALSE
<if test="param.id != null"> <if test="param.id != null">
and id = #{param.id} and id = #{param.id}
</if> </if>
@@ -28,9 +28,9 @@
from uc_user_register ur from uc_user_register ur
inner join uc_user ru on ur.user_id = ru.id inner join uc_user ru on ur.user_id = ru.id
where where
ur.deleted = 0 and ru.deleted = 0 ur.deleted = FALSE and ru.deleted = FALSE
<!-- 手机号已绑定才算注册完成 --> <!-- 手机号已绑定才算注册完成 -->
and ru.phone_binding = 1 and ru.phone_binding = TRUE
<if test="param.platformCode != null"> <if test="param.platformCode != null">
and ur.platform_code = #{param.platformCode} and ur.platform_code = #{param.platformCode}
</if> </if>

View File

@@ -56,7 +56,7 @@ public interface UserMapMapper {
@Mappings( @Mappings(
value = { value = {
@Mapping(target = "type", @Mapping(target = "type",
expression = "java(com.newyetai.usercenter.user.constant.UserTypeEnum.ORG.getType())"), expression = "java(com.senmesh.usercenter.user.constant.UserTypeEnum.ORG.getType())"),
@Mapping(target = "phoneBinding", @Mapping(target = "phoneBinding",
constant = "false"), constant = "false"),
}) })
@@ -71,7 +71,7 @@ public interface UserMapMapper {
@Mappings( @Mappings(
value = { value = {
@Mapping(target = "type", @Mapping(target = "type",
expression = "java(com.newyetai.usercenter.user.constant.UserTypeEnum.PERSON.getType())"), expression = "java(com.senmesh.usercenter.user.constant.UserTypeEnum.PERSON.getType())"),
@Mapping(target = "phoneBinding", @Mapping(target = "phoneBinding",
constant = "false"), constant = "false"),
}) })

Some files were not shown because too many files have changed in this diff Show More