兼容+功能

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,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">
<mapper namespace="com.senmesh.codesetting.dao.CodeSettingMapper">
@@ -16,7 +16,7 @@
<sql id="queryFromSql">
FROM
xs_code_setting t
WHERE t.deleted = 0
WHERE t.deleted = FALSE
<if test='param.id != null'>
AND t.id = #{param.id}
</if>

View File

@@ -13,16 +13,16 @@ public class RandomUtils {
/**
* 随机六位数
* @return
* @author sr on 2020-01-02
* @author sr on 2020-01-02
*/
public static int nextSixInt() {
return org.apache.commons.lang3.RandomUtils.nextInt(100000, 1000000);
}
/**
* 随机六位验证码
* @return
* @author sr on 2020-01-02
* @author sr on 2020-01-02
*/
public static String nextSixVerificationCode() {
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
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
@@ -8,7 +8,7 @@
*
from uc_action_detail
where
deleted = 0
deleted = FALSE
<if test="param.id != null">
and id = #{param.id}
</if>

View File

@@ -1,13 +1,13 @@
<?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">
<mapper namespace="com.senmesh.component.action.dao.ActionMapper">
<select id="listActionDTO" resultType="com.senmesh.component.action.dto.ActionDTO">
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
t1.deleted = 0
t1.deleted = FALSE
<if test="param.id != null">
and id = #{param.id}
</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">
@@ -8,7 +8,7 @@
*
from async_task_notice
where
deleted = 0
deleted = FALSE
<if test="param.id != null">
and id = #{param.id}
</if>
@@ -30,7 +30,7 @@
,biz_status_str = #{param.bizStatusStr}
</if>
where
deleted = 0
deleted = FALSE
and union_type = #{param.unionType}
and union_id = #{param.unionId}
and flow_status = 1
@@ -40,7 +40,7 @@
update async_task_notice
set notice_status = 2,update_time = now(), update_by = #{param.operateUserId}
where
deleted = 0
deleted = FALSE
and create_by = #{param.operateUserId}
and notice_status = 1
<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
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.senmesh.component.cardbin.dao.CardBinMapper">
<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 id="selectAllCardBinList" resultType="com.senmesh.component.cardbin.entity.CardBin">
@@ -20,7 +20,7 @@
FROM
xs_card_bin
WHERE
deleted = 0
deleted = FALSE
</select>
</mapper>

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">
@@ -14,7 +14,7 @@
inner join xs_org o on o.id = c.org_id
inner join uc_user u on u.id = c.person_user_id
where
c.deleted = 0
c.deleted = FALSE
<if test="param.id != null">
and c.id = #{param.id}
</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">
@@ -8,7 +8,7 @@
*
from xs_chat_msg
where
deleted = 0
deleted = FALSE
<if test="param.id != null">
and id = #{param.id}
</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">
@@ -8,7 +8,7 @@
*
from uc_import_main
where
deleted = 0
deleted = FALSE
<if test="param.id != null">
and id = #{param.id}
</if>
@@ -69,7 +69,7 @@
</if>
update_by = #{param.operateUserId},
update_time = now()
where deleted = 0
where deleted = FALSE
and id = #{param.id}
and import_status in
<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
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
@@ -9,7 +9,7 @@
xs_dict dict
inner join xs_dict_detail detail on dict.id = detail.dict_id
where
dict.deleted = 0 and detail.deleted = 0
dict.deleted = FALSE and detail.deleted = FALSE
<if test='param.dictName != null and param.dictName.trim() != ""'>
<bind name="dictNameLike" value="'%' + param.dictName + '%'" />
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
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
@@ -7,7 +7,7 @@
<select id="list" resultType="com.senmesh.component.dict.dto.DictDTO">
SELECT * FROM xs_dict
<where>
deleted = 0
deleted = FALSE
<if test='param.dictId != null'>
AND id = #{param.dictId}
</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">
@@ -8,7 +8,7 @@
*
from uc_dynamic_table
where
deleted = 0
deleted = FALSE
<if test="param.id != null">
and id = #{param.id}
</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">
@@ -6,7 +6,7 @@
<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>
</mapper>

View File

@@ -13,16 +13,25 @@ public class FileProperties {
/** 文件上传路径 **/
private String uploadDir;
/** 传输发送目录 **/
private String transferSendDir;
/** 传输接收目录 **/
private String transferReceiveDir;
private final Storage storage = new Storage();
/** 文件位置:1内网2外网 **/
private String location;
@Data
@NoArgsConstructor
public static class Storage{
private String type;
private final AliStorage ali = new AliStorage();
}
@Data
@NoArgsConstructor
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
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
@@ -12,7 +12,7 @@
AND deleted = #{param.deleted}
</when>
<otherwise>
AND deleted = 0
AND deleted = FALSE
</otherwise>
</choose>
<if test='param.classCode != null and param.classCode.trim() != ""'>
@@ -35,7 +35,7 @@
AND deleted = #{param.deleted}
</when>
<otherwise>
AND deleted = 0
AND deleted = FALSE
</otherwise>
</choose>
<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
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
@@ -18,7 +18,7 @@
<select id="find" resultType="com.senmesh.component.file.entity.FileRecord">
SELECT * FROM xs_file_record
<where>
deleted = 0
deleted = FALSE
<if test='param.fileCode != null'>
AND file_code = #{param.fileCode}
</if>
@@ -35,7 +35,7 @@
<select id="findFilePathByCode" resultType="java.lang.String">
SELECT file_path FROM xs_file_record
<where>
deleted = 0
deleted = FALSE
<if test='param.fileCode != null'>
AND file_code = #{param.fileCode}
</if>

View File

@@ -106,10 +106,10 @@ public interface FileService {
* @param fileName
* @param is
* @return
* @author sr on 2023-12-07
* @author sr on 2023-12-07
*/
FileRecord uploadTemp(String fileName, InputStream is);
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
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
@@ -8,7 +8,7 @@
SET deleted = TRUE,
update_time = NOW(),
update_by = #{userId}
WHERE deleted = 0
WHERE deleted = FALSE
AND config_code = #{configCode}
</update>
@@ -21,8 +21,8 @@
SELECT t.* ,o.org_name,o.id orgId
FROM
xs_config t
LEFT JOIN xs_org o ON t.org_id = o.id AND o.deleted = 0
WHERE t.deleted = 0
LEFT JOIN xs_org o ON t.org_id = o.id AND o.deleted = FALSE
WHERE t.deleted = FALSE
<if test='param.id != null'>
AND t.id = #{param.id}
</if>
@@ -67,7 +67,7 @@
<sql id="queryFromSql">
FROM
xs_config t
WHERE t.deleted = 0
WHERE t.deleted = FALSE
<if test='param.id != null'>
AND t.id = #{param.id}
</if>
@@ -113,7 +113,7 @@
AND deleted = #{param.deleted}
</when>
<otherwise>
AND deleted = 0
AND deleted = FALSE
</otherwise>
</choose>
<choose>
@@ -121,7 +121,7 @@
AND enable = #{param.enable}
</when>
<otherwise>
AND enable = 1
AND enable = TRUE
</otherwise>
</choose>
<if test='param.orgId != null'>
@@ -139,8 +139,8 @@
FROM
xs_config c
WHERE
c.deleted = 0
AND c.enable = 1
c.deleted = FALSE
AND c.enable = TRUE
<if test="orgIds != null">
AND org_id in
<foreach close=")" collection="orgIds" index="index" item="orgId" open="("
@@ -155,7 +155,7 @@
<select id="existConfigCode" resultType="int">
select count(*)
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">
and id != #{configId}
</if>
@@ -167,19 +167,19 @@
from xs_config
where config_code = #{configCode}
and org_id = #{orgId}
and deleted = 0
and deleted = FALSE
union
select *
from xs_config
where config_code = #{configCode}
and org_id = #{platformOrgId}
and deleted = 0) a limit 1
and deleted = FALSE) a limit 1
</select>
<select id="queryOrgConfigByCode" resultType="com.senmesh.config.dto.ConfigDTO">
select *
from xs_config
where deleted = 0
where deleted = FALSE
and org_id = #{orgId}
and config_code = #{configCode} limit 1
</select>
@@ -187,11 +187,11 @@
SELECT o.id,
o.org_name
FROM xs_org o
WHERE o.deleted = 0
AND o.enable = 1
WHERE o.deleted = FALSE
AND o.enable = TRUE
AND o.id NOT IN (SELECT t.org_id
FROM xs_config t
WHERE t.deleted = 0
WHERE t.deleted = FALSE
AND t.config_code = #{configCode})
</select>
@@ -217,6 +217,6 @@
FROM xs_config
WHERE org_id = #{param.orgId}
and config_code = #{param.configCode}
and deleted = 0)
and deleted = FALSE)
</insert>
</mapper>

View File

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

View File

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

View File

@@ -22,7 +22,7 @@ public interface UserMapMapper {
* @return
* @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);

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")
@ApiOperation("创建")
public AlitaResult<Long> create(@Validated @RequestBody UserFileCreateDTO createDTO) {
public AlitaResult<UserFileDTO> create(@Validated @RequestBody UserFileCreateDTO 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
private UserFileService userFileService;
@PostMapping("/create")
/* @PostMapping("/create")
@ApiOperation("创建")
public AlitaResult<Long> create(@Validated @RequestBody UserFileCreateDTO createDTO) {
return AlitaResult.success(userFileService.create(createDTO));
}
}*/
@PostMapping("/modify")
@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")
@Data
@SuperBuilder
@Builder
@NoArgsConstructor
@AllArgsConstructor
@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;
@ApiModelProperty("用户id")
@NotNull(message = "用户id不能为空")
// @NotNull(message = "用户id不能为空")
private Long userId;
@ApiModelProperty("根类型:1普通/2内穿外/3外传内/4我的分享")

View File

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

View File

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

View File

@@ -4,6 +4,7 @@ import com.senmesh.common.dto.PageQueryDTO;
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;
@@ -14,7 +15,7 @@ import lombok.experimental.SuperBuilder;
*/
@ApiModel("用户空间查询DTO")
@Data
@SuperBuilder
@Builder
@NoArgsConstructor
@AllArgsConstructor
@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">
<mapper namespace="com.senmesh.sfile.dao.FileCategoryMapper">
@@ -11,7 +11,7 @@
<sql id="queryFromSql">
FROM x_file_category t
WHERE t.deleted = 0
WHERE t.deleted = FALSE
<if test='param.id != null'>
AND t.id = #{param.id}
</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">
<mapper namespace="com.senmesh.sfile.dao.UserFileMapper">
<select id="list" resultType="com.senmesh.sfile.dto.UserFileDTO">
SELECT t.*
SELECT t.*, fr.file_size
<include refid="queryFromSql"></include>
ORDER BY t.id DESC
</select>
<sql id="queryFromSql">
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'>
AND t.id = #{param.id}
</if>
@@ -48,12 +49,10 @@
<update id="updatePathByParentIdChange">
UPDATE x_user_file child
INNER JOIN x_user_file current ON current.id = #{fileId} AND current.deleted = 0
LEFT JOIN x_user_file parent ON parent.id = #{newParentId} AND parent.deleted = 0
SET child.path = CASE
SET path = CASE
WHEN child.id = #{fileId} THEN
CASE
WHEN #{newParentId} = 0 THEN CAST(#{fileId} AS CHAR)
WHEN #{newParentId} = 0 THEN CAST(#{fileId} AS VARCHAR)
ELSE CONCAT(parent.path, ',', #{fileId})
END
ELSE
@@ -63,35 +62,44 @@
WHEN #{newParentId} = 0 THEN CONCAT(#{fileId}, ',')
ELSE CONCAT(parent.path, ',', #{fileId}, ',')
END)
END
WHERE (child.id = #{fileId} OR child.path LIKE CONCAT(current.path, ',%'))
AND child.deleted = 0
END,
update_by = #{operateUserId},
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.root_type = current.root_type
</update>
<update id="deleteFileWithChildren">
UPDATE x_user_file child
INNER JOIN x_user_file current ON current.id = #{fileId} AND current.deleted = 0
SET child.deleted = 1,
child.update_by = #{operateUserId},
child.update_time = NOW()
WHERE (child.id = #{fileId} OR child.path LIKE CONCAT(current.path, ',%'))
AND child.deleted = 0
SET deleted = TRUE,
update_by = #{operateUserId},
update_time = NOW()
FROM x_user_file current
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.root_type = current.root_type
</update>
<update id="updateStatusWithChildren">
UPDATE x_user_file child
INNER JOIN x_user_file current ON current.id = #{fileId}
AND current.deleted = 0
SET file_status = #{newStatus},
update_by = #{operateUserId},
update_time = NOW()
FROM x_user_file current
WHERE current.id = #{fileId}
AND current.deleted = FALSE
AND current.file_status = #{oldStatus}
SET child.file_status = #{newStatus},
child.update_by = #{operateUserId},
child.update_time = NOW()
WHERE (child.id = #{fileId} OR child.path LIKE CONCAT(current.path, ',%'))
AND child.deleted = 0
AND (child.id = #{fileId} OR child.path LIKE CONCAT(current.path, ',%'))
AND child.deleted = FALSE
AND child.user_id = current.user_id
AND child.root_type = current.root_type
</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">
<mapper namespace="com.senmesh.sfile.dao.UserSpaceMapper">
@@ -11,7 +11,7 @@
<sql id="queryFromSql">
FROM x_user_space t
WHERE t.deleted = 0
WHERE t.deleted = FALSE
<if test='param.id != null'>
AND t.id = #{param.id}
</if>

View File

@@ -1,6 +1,7 @@
package com.senmesh.sfile.service;
import com.senmesh.sfile.dto.UserFileCreateDTO;
import com.senmesh.sfile.dto.UserFileDTO;
/**
* 普通用户文件Service
@@ -11,8 +12,8 @@ public interface NormalUserFileService {
* 创建普通用户文件
*
* @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;
import com.senmesh.sfile.dto.ExpandUserFileCreateDTO;
import com.senmesh.sfile.dto.ExpandUserFileDTO;
import com.senmesh.sfile.dto.UserFileCreateDTO;
import com.senmesh.sfile.dto.UserFileDTO;
import com.senmesh.sfile.dto.UserFileModifyDTO;
@@ -18,18 +19,30 @@ public interface UserFileService {
* 创建用户文件
*
* @param createDTO 创建DTO
* @return 主键ID
* @return UserFileDTO
*/
Long create(UserFileCreateDTO createDTO);
UserFileDTO create(UserFileCreateDTO createDTO);
/**
* 根据普通文件创建新的文件(复制)
* 创建一个文件夹,文件名为原文件名+时间戳,然后复制原文件下所有文件类型的子文件
*
* @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.RootTypeEnum;
import com.senmesh.sfile.dto.UserFileCreateDTO;
import com.senmesh.sfile.dto.UserFileDTO;
import com.senmesh.sfile.service.NormalUserFileService;
import com.senmesh.sfile.service.UserFileService;
import org.springframework.beans.factory.annotation.Autowired;
@@ -21,7 +22,7 @@ public class NormalUserFileServiceImpl implements NormalUserFileService {
@Override
@Transactional
public Long create(UserFileCreateDTO createDTO) {
public UserFileDTO create(UserFileCreateDTO createDTO) {
createDTO.setUserId(UserContextHolder.getExistLoginUserId());
// 设置根类型为普通
createDTO.setRootType(RootTypeEnum.NORMAL.getType());

View File

@@ -1,5 +1,6 @@
package com.senmesh.sfile.service.impl;
import com.senmesh.common.util.RandomUtils;
import com.senmesh.common.util.UserContextHolder;
import com.senmesh.sfile.constant.FileStatusEnum;
import com.senmesh.sfile.constant.RootTypeEnum;
@@ -36,15 +37,19 @@ public class ShareUserFileServiceImpl implements ShareUserFileService {
calendar.add(Calendar.DAY_OF_MONTH, validDays);
Date endTime = calendar.getTime();
// 生成随机6位数字访问码
String accessCode = RandomUtils.nextSixVerificationCode();
// 调用UserFileService的重载create方法,根据普通文件创建分享文件
ExpandUserFileCreateDTO expandCreateDTO = ExpandUserFileCreateDTO.builder()
.userFileId(userFileId)
.userId(userId)
.rootType(RootTypeEnum.SHARE.getType())
.fileStatus(FileStatusEnum.NORMAL.getStatus())
.accessCode(accessCode)
.endTime(endTime)
.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.util.ListUtil;
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.RootTypeEnum;
import com.senmesh.sfile.convert.UserFileConvert;
import com.senmesh.sfile.dao.UserFileMapper;
import com.senmesh.sfile.dto.ExpandUserFileCreateDTO;
import com.senmesh.sfile.dto.ExpandUserFileDTO;
import com.senmesh.sfile.dto.UserFileCreateDTO;
import com.senmesh.sfile.dto.UserFileDTO;
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.entity.UserFile;
import com.senmesh.sfile.service.UserFileService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.io.InputStream;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* 用户文件ServiceImpl
*/
@Slf4j
@Service
public class UserFileServiceImpl implements UserFileService {
@Autowired
private UserFileMapper userFileMapper;
@Autowired
private FileService fileService;
@Override
@Transactional
public Long create(UserFileCreateDTO createDTO) {
public UserFileDTO create(UserFileCreateDTO createDTO) {
Long parentId = createDTO.getParentId();
String parentPath = createDTO.getParentPath();
Long userId = createDTO.getUserId();
String rootType = createDTO.getRootType();
// 1. 校验文件类型时fileCode不能为空
// 1. 校验 userId 和 rootType 不能为空
Assert.notNull(userId, "用户ID不能为空");
Assert.notBlank(rootType, "根类型不能为空");
// 2. 校验文件类型时fileCode不能为空
if (FileTypeEnum.isFile(createDTO.getFileType())) {
Assert.notBlank(createDTO.getFileCode(), "文件编码不能为空");
}
// 2. 校验父节点(如果不是根目录)
if (parentId != null && parentId != 0L) {
// 如果没有提供parentPath,需要查询父节点
if (StringUtils.isBlank(parentPath)) {
UserFileDTO parentFile = this.findOne(UserFileQueryDTO.builder()
.id(parentId)
.userId(userId)
.rootType(rootType)
.build());
Assert.isTrue(FileTypeEnum.isFolder(parentFile.getFileType()), "父节点必须是文件夹");
// 获取父路径用于后续拼接
parentPath = parentFile.getPath();
}
// 如果提供了parentPath,信任调用方,不做校验
// 3. 处理 parentPath(性能优化:如果提供了 parentPath,直接使用,避免查询)
if (StringUtils.isBlank(parentPath) && parentId != null && parentId != 0L) {
// 如果没有提供 parentPath,但提供了 parentId,需要查询父节点获取 parentPath
UserFileDTO parentFile = this.findOne(UserFileQueryDTO.builder()
.id(parentId)
.userId(userId)
.rootType(rootType)
.build());
Assert.isTrue(FileTypeEnum.isFolder(parentFile.getFileType()), "父节点必须是文件夹");
// 获取父路径用于后续拼接
parentPath = parentFile.getPath();
}
// 如果提供了 parentPath,直接信任调用方,不做校验
// 3. 插入数据获取ID
// 4. 插入数据获取ID
UserFile userFile = UserFileConvert.INSTANCE.toEntity(createDTO);
userFileMapper.saveEntity(userFile);
Long newId = userFile.getId();
// 4. 构建path
// 5. 构建path
String path = StringUtils.isNotBlank(parentPath)
? parentPath + CommonConstants.COMMA + newId
: String.valueOf(newId);
// 5. 更新path
// 6. 更新path
userFile.setPath(path);
userFileMapper.updateEntitySelective(userFile);
return newId;
// 7. 转换为DTO返回
return UserFileConvert.INSTANCE.toDto(userFile);
}
@Override
@Transactional
public Long create(ExpandUserFileCreateDTO expandCreateDTO) {
public ExpandUserFileDTO create(ExpandUserFileCreateDTO expandCreateDTO) {
Long userFileId = expandCreateDTO.getUserFileId();
Long userId = expandCreateDTO.getUserId();
String rootType = expandCreateDTO.getRootType();
@@ -94,26 +108,7 @@ public class UserFileServiceImpl implements UserFileService {
.rootType(RootTypeEnum.NORMAL.getType())
.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. 查询需要复制的文件列表
// 查询条件:path LIKE 'xxx%' AND fileType = '1'
// 如果是文件:会查到自己
// 如果是文件夹:会查到其下所有文件类型的子文件
UserFileQueryDTO queryDTO = UserFileQueryDTO.builder()
.userId(userId)
.rootType(RootTypeEnum.NORMAL.getType())
@@ -122,23 +117,98 @@ public class UserFileServiceImpl implements UserFileService {
.build();
queryDTO.disablePage();
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. 在文件夹下创建文件对象
List<UserFileDTO> createdFiles = new java.util.ArrayList<>();
for (UserFileDTO fileDTO : filesToCopy) {
UserFileCreateDTO fileCreateDTO = UserFileCreateDTO.builder()
.userId(userId)
.rootType(rootType)
.fileStatus(expandCreateDTO.getFileStatus())
.fileType(FileTypeEnum.FILE.getType())
.fileName(fileDTO.getFileName())
.fileCode(fileDTO.getFileCode())
.parentId(folderId)
.parentPath(folderPath)
.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
@Transactional

View File

@@ -13,9 +13,6 @@ import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
/**
* @author guhong
*/
@Configuration
@EnableSwagger2
public class SwaggerConfig {
@@ -37,7 +34,7 @@ public class SwaggerConfig {
// 设置是否开启swagger,生产环境关闭
.enable(swaggerEnable).select()
// 当前包路径
.apis(RequestHandlerSelectors.basePackage("com.newyetai"))
.apis(RequestHandlerSelectors.basePackage("com.senmesh"))
.apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class))
.paths(PathSelectors.any()).build();
}
@@ -52,7 +49,7 @@ public class SwaggerConfig {
// 页面标题
.title("接口文档")
// 创建人
.contact(new Contact("雷佳平", "", ""))
.contact(new Contact("ljp", "", ""))
// 版本号
.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">
<mapper namespace="com.senmesh.usercenter.annex.dao.UserAnnexDao">
<select id="page" resultType="com.senmesh.usercenter.annex.dto.UserAnnexDTO">
select *
from xs_user_annex
where deleted = 0
where deleted = FALSE
<if test="param.userId != null">
and user_id = #{param.userId}
</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">
@@ -7,10 +7,10 @@
select
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 d on da.domain_id = d.id and d.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 = FALSE
where
ac.deleted = 0
ac.deleted = FALSE
<if test="param.id != null">
and ac.id = #{param.id}
</if>
@@ -28,9 +28,9 @@
FROM
uc_auth_client ac
LEFT JOIN uc_auth_type atp ON atp.auth_type_code = ac.auth_type_code
AND atp.deleted = 0
AND atp.deleted = FALSE
WHERE
ac.deleted = 0
ac.deleted = FALSE
<if test="param.id != null">
and ac.id = #{param.id}
</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">
@@ -8,7 +8,7 @@
*
from uc_auth_detail_entrypoint
where
deleted = 0
deleted = FALSE
<if test="param.id != null">
and id = #{param.id}
</if>
@@ -42,19 +42,19 @@
r.person_in_charge resumePersonInCharge
FROM
uc_auth_detail_entrypoint ade
INNER JOIN uc_lite_code lc on ade.union_id = lc.id AND lc.deleted = 0
INNER JOIN uc_auth_detail ad on ade.auth_detail_id = ad.id AND ad.deleted = 0
INNER JOIN uc_user_auth ua on ua.unique_id = ad.unique_id AND ua.deleted = 0
INNER JOIN uc_user u on u.id = ua.user_id AND u.deleted = 0
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}
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_position_type pt on pt.code = r.job_intention AND pt.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 = FALSE
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 = FALSE
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 = FALSE
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">
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>
WHERE
ade.deleted = 0
ade.deleted = FALSE
AND lc.user_id = #{userId}
AND lc.org_id = #{orgId}
<if test="param.lifeCodeId != null">
@@ -81,7 +81,7 @@
select pt.name
from hr_job_expect je left join hr_position_type pt on je.type_code = pt.code
where
je.deleted = 0
je.deleted = FALSE
and je.user_id = u.id order by je.create_time desc limit 1
) as job_intention,
ur.inviter_id, -- 邀请人id
@@ -91,14 +91,14 @@
lc.name as liteName
FROM
uc_auth_detail_entrypoint ade
INNER JOIN uc_lite_code lc on ade.union_id = lc.id AND lc.deleted = 0
INNER JOIN uc_auth_detail ad on ade.auth_detail_id = ad.id AND ad.deleted = 0
INNER JOIN uc_user_auth ua on ua.unique_id = ad.unique_id AND ua.deleted = 0
INNER JOIN uc_user u on u.id = ua.user_id AND u.deleted = 0
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_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 = FALSE
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 = FALSE
INNER JOIN uc_user_register ur on ur.user_id = ua.user_id AND ur.union_id = lc.id AND ur.deleted = FALSE
WHERE
ade.deleted = 0
ade.deleted = FALSE
AND lc.org_id = #{orgId}
<if test="param.userId != null">
AND u.id = #{param.userId}
@@ -151,11 +151,11 @@
FROM
uc_auth_detail_entrypoint ade
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_user_auth ua on ua.unique_id = ad.unique_id AND ua.deleted = 0
LEFT JOIN uc_user_register ur on ur.user_id = ua.user_id AND ur.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 = FALSE
LEFT JOIN uc_user_register ur on ur.user_id = ua.user_id AND ur.deleted = FALSE
WHERE
ade.deleted = 0 AND lc.deleted = 0
ade.deleted = FALSE AND lc.deleted = FALSE
AND lc.org_id = #{orgId}
<if test="param.userId != null">
AND ur.inviter_id = #{param.userId}
@@ -173,12 +173,12 @@
count(DISTINCT ur.user_id)
FROM
uc_auth_detail_entrypoint ade
INNER JOIN uc_lite_code lc on ade.union_id = lc.id AND lc.deleted = 0
INNER JOIN uc_auth_detail ad on ade.auth_detail_id = ad.id AND ad.deleted = 0
INNER JOIN uc_user_auth ua on ua.unique_id = ad.unique_id AND ua.deleted = 0
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_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 = FALSE
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 = FALSE AND ur.union_id = lc.id
WHERE
ade.deleted = 0
ade.deleted = FALSE
AND lc.org_id = #{orgId}
<if test="param.userId != null">
AND ur.inviter_id = #{param.userId}
@@ -203,18 +203,18 @@
uc_auth_detail_entrypoint ade
INNER JOIN uc_lite_code lc on ade.union_id = lc.id
<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_user_auth ua on ua.unique_id = ad.unique_id AND ua.deleted = 0
INNER JOIN uc_user u on u.id = ua.user_id AND u.deleted = 0
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_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 = FALSE
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 = FALSE
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
</if>
WHERE
ade.deleted = 0 AND lc.deleted = 0
ade.deleted = FALSE AND lc.deleted = FALSE
AND lc.org_id = #{orgId}
<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}
</if>
<if test="param.userId != null">
@@ -236,7 +236,7 @@
FROM
hr_position_registration pr
WHERE
pr.deleted = 0
pr.deleted = FALSE
AND pr.user_id IN
<foreach collection="userIds" open="(" separator="," close=")" item="userId">
#{userId}

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">
@@ -11,11 +11,10 @@
FROM
uc_auth_detail ad
LEFT JOIN uc_auth_client ac ON ac.id = ad.auth_client_id
AND ac.deleted =
0 LEFT JOIN uc_auth_type atp ON atp.auth_type_code = ac.auth_type_code
AND atp.deleted = 0
AND ac.deleted = FALSE LEFT JOIN uc_auth_type atp ON atp.auth_type_code = ac.auth_type_code
AND atp.deleted = FALSE
WHERE
ad.deleted = 0
ad.deleted = FALSE
<if test="param.id != null">
and ad.id = #{param.id}
</if>
@@ -41,7 +40,7 @@
from uc_user u
inner join uc_user_auth ua on u.id = ua.user_id
where u.id = #{param.userId}
and ua.deleted = 0 and u.deleted = 0
and ua.deleted = FALSE and u.deleted = FALSE
)
</if>
</select>

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">
@@ -8,7 +8,7 @@
*
from uc_auth_subscribe_detail
where
deleted = 0
deleted = FALSE
<if test="param.id != null">
and id = #{param.id}
</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">
@@ -9,6 +9,6 @@
FROM
uc_auth_type atp
WHERE
atp.deleted = 0
atp.deleted = FALSE
</select>
</mapper>

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">
@@ -8,7 +8,7 @@
*
from uc_lite_code_config
where
deleted = 0
deleted = FALSE
<if test="param.id != null">
and id = #{param.id}
</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">
@@ -7,9 +7,9 @@
select
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
lc.deleted = 0
lc.deleted = FALSE
<if test="param.id != null">
and lc.id = #{param.id}
</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">
@@ -16,8 +16,8 @@
xs_permission p
LEFT JOIN xs_url u ON u.id = p.resource_id
<where>
AND p.deleted = 0
AND p.resource_type = 1
AND p.deleted = FALSE
AND p.resource_type = '1'
AND u.link IS NOT NULL
AND u.link &lt;&gt; ''
AND p.role_id IN
@@ -34,15 +34,15 @@
p.*
from xs_permission p
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">
and p.org_id = #{param.orgId}
</if>
<if test="param.systemCode != null">
and p.platform_code = #{param.systemCode}
</if>
and p.deleted = 0
and c.deleted = 0
and p.deleted = FALSE
and c.deleted = FALSE
</select>
<select id="findUrl" resultType="com.senmesh.usercenter.authority.dto.UrlPermissionDTO">
@@ -53,12 +53,12 @@
u.type resourceType,
u.link link
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">
and p.org_id = #{param.orgId}
</if>
where
u.deleted = 0
u.deleted = FALSE
<if test="param.systemCode != null">
and u.platform_code = #{param.systemCode}
</if>
@@ -79,7 +79,7 @@
</foreach>
</if>
and deleted = 0
and deleted = FALSE
</select>
<select id="urlComponentList" resultType="com.senmesh.usercenter.authority.dto.PermissionDTO">
SELECT
@@ -96,26 +96,26 @@
FROM
xs_component t1
LEFT JOIN xs_permission t4 ON
t4.deleted = 0
t4.deleted = FALSE
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.role_id = #{param.roleId}
WHERE
t1.deleted = 0
t1.deleted = FALSE
AND t1.platform_code = #{param.platformCode}
<if test="param.orgId!=null and param.orgId!=1 ">
and exists(select t2.* from xs_permission_resources t2
INNER JOIN xs_permission_organization t3 ON
t3.permission_package_id = t2.permission_package_id
AND t3.deleted = 0
AND t3.deleted = FALSE
INNER JOIN xs_permission_package xpp ON
xpp.id = t3.permission_package_id
AND xpp.deleted = 0
AND xpp.deleted = FALSE
AND xpp.platform_code = t1.platform_code
where t2.resource_id = t1.id
AND t2.deleted = 0
AND t2.resource_type = 2
AND t2.deleted = FALSE
AND t2.resource_type = '2'
AND t3.allocation_org_id = #{param.orgId}
)
</if>
@@ -146,26 +146,26 @@
<if test="param.orgId!=null and param.orgId!=1 ">
INNER JOIN xs_permission_resources t2 ON
t2.resource_id = t1.id
AND t2.deleted = 0
AND t2.resource_type = 3
AND t2.deleted = FALSE
AND t2.resource_type = '3'
INNER JOIN xs_permission_organization t3 ON
t3.permission_package_id = t2.permission_package_id
AND t3.deleted = 0
AND t3.deleted = FALSE
INNER JOIN xs_permission_package t4 ON
t4.id = t3.permission_package_id
AND t4.deleted = 0
AND t4.deleted = FALSE
AND t4.platform_code =#{param.platformCode}
</if>
left JOIN xs_permission t5 ON
t5.resource_id = t1.id
AND t5.resource_type = 3
AND t5.deleted=0
AND t5.resource_type = '3'
AND t5.deleted = FALSE
AND t5.platform_code = #{param.platformCode}
AND t5.role_id = #{param.roleId}
WHERE
t1.parent_id = #{param.urlId}
AND t1.type = 2
AND t1.deleted = 0
AND t1.deleted = FALSE
AND t1.platform_code =#{param.platformCode}
<if test="param.orgId!=null and param.orgId!=1 ">
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
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
@@ -8,14 +8,14 @@
select * from xs_role_allocation
where allocation_type = #{allocationType}
and allocation_id = #{allocationId}
and deleted = 0
and deleted = FALSE
</select>
<select id="selectRoleIds">
select distinct role_id from xs_role_allocation
where allocation_type = #{allocationType}
and allocation_id = #{allocationId}
and deleted = 0
and deleted = FALSE
</select>
<select id="selectAllocationListByUsername" parameterType="java.lang.String"
@@ -24,24 +24,24 @@
a.*
FROM
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
a.allocation_type = 1
a.allocation_type = '1'
AND u.username = #{username}
AND a.deleted = 0
AND a.deleted = FALSE
</select>
<update id="deleteByRoleIds">
update
xs_role_allocation
set
deleted = 1,
deleted = TRUE,
update_by = #{operateUserId},
update_time = now()
where
allocation_type = #{allocationType}
and allocation_id = #{allocationId}
and deleted = 0
and deleted = FALSE
and role_id in
<foreach collection="roleIds" open="(" separator="," close=")" item="roleId">
#{roleId}
@@ -49,12 +49,12 @@
</update>
<select id="findByUserId" resultType="com.senmesh.usercenter.authority.dto.RoleAllocationDTO">
select *
from xs_role_allocation
where
allocation_type = 1
and allocation_id = (select id from uc_user where id = #{userId} and enabled = 1 and deleted = 0)
and deleted = 0
select *
from xs_role_allocation
where
allocation_type = '1'
and allocation_id = (select id from uc_user where id = #{userId} and enabled = TRUE and deleted = FALSE)
and deleted = FALSE
</select>
<select id="getAllocatedBusinessRoles"
@@ -65,9 +65,9 @@
r.standard_type
FROM
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
ra.deleted = 0
ra.deleted = FALSE
AND ra.allocation_id = #{param.allocationId}
AND ra.allocation_type = #{param.allocationType}
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
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
@@ -6,7 +6,7 @@
<sql id="queryFrom">
FROM xs_role
<where>
org_id = #{orgId} and deleted = 0
org_id = #{orgId} and deleted = FALSE
<if test='param.name != null and param.name.trim() != ""'>
<bind name="nameLike" value="'%' + param.name + '%'"/>
AND name like #{nameLike}
@@ -29,16 +29,16 @@
xs_permission xp
LEFT JOIN xs_component xc ON
xp.resource_id = xc.id
AND xc.deleted = 0
AND xc.deleted = FALSE
LEFT JOIN xs_permission xp2 ON
xp2.resource_id = xc.url_id
AND xp2.role_id = xp.role_id
AND xp2.deleted = 0
SET xp.deleted =1,xp.update_by = #{loginUserId}, xp.update_time = now()
AND xp2.deleted = FALSE
SET xp.deleted = TRUE,xp.update_by = #{loginUserId}, xp.update_time = now()
WHERE
xp.deleted = 0
xp.deleted = FALSE
AND xp2.id IS null
AND xp.resource_type = 2
AND xp.resource_type = '2'
</update>
<update id="cleanRoleInterface">
@@ -48,16 +48,16 @@
LEFT JOIN xs_url xc ON
xp.resource_id = xc.id
AND xc.type = 2
AND xc.deleted = 0
AND xc.deleted = FALSE
LEFT JOIN xs_permission xp2 ON
xp2.resource_id = xc.parent_id
AND xp2.role_id = xp.role_id
AND xp2.deleted = 0
SET xp.deleted =1,xp.update_by = #{loginUserId} , xp.update_time = now()
AND xp2.deleted = FALSE
SET xp.deleted = TRUE,xp.update_by = #{loginUserId} , xp.update_time = now()
WHERE
xp.deleted = 0
xp.deleted = FALSE
AND xp2.id IS NULL
AND xp.resource_type = 3
AND xp.resource_type = '3'
</update>
@@ -74,7 +74,7 @@
<select id="existRoleName" resultType="int">
select count(*)
from xs_role
where name = #{roleName} and deleted = 0
where name = #{roleName} and deleted = FALSE
<if test="roleId != null">
and id != #{roleId}
</if>
@@ -89,16 +89,16 @@
rst.name as standard_role_name
FROM
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
r.org_id = #{param.orgId}
AND r.deleted=0
AND r.deleted = FALSE
<choose>
<when test="param.roleType != null and param.roleType != ''">
AND r.type = #{param.roleType}
</when>
<otherwise>
AND r.type != 1
AND r.type != '1'
</otherwise>
</choose>
<if test="param.standardType != null and param.standardType != ''">
@@ -121,17 +121,17 @@
<select id="getSellerRoleCanNotBeDeleted" resultType="java.lang.Long">
SELECT DISTINCT ra.role_id
FROM xs_role_allocation ra
WHERE ra.deleted = 0
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)
WHERE ra.deleted = FALSE
AND ra.allocation_type = '1'
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 EXISTS(SELECT ce.id
FROM xs_company_extend ce
WHERE ce.deleted = 0
WHERE ce.deleted = FALSE
AND ce.seller_id = ra.allocation_id
AND ce.org_id not IN (SELECT ou.org_id
FROM uc_org_user ou
WHERE ou.deleted = 0
WHERE ou.deleted = FALSE
AND ou.user_id = #{userId}
))
</select>
@@ -142,9 +142,9 @@
from
xs_role_allocation t1,xs_role t2
where
t1.deleted = 0
t1.deleted = FALSE
AND t1.role_id=t2.id
AND t2.deleted=0
AND t2.deleted = FALSE
<if test="platformCode != null">
AND t2.platform_code= #{platformCode}
</if>
@@ -157,7 +157,7 @@
from
xs_role
where
deleted = 0
deleted = FALSE
and org_id = #{orgId}
<if test="platformCode != null">
and platform_code = #{platformCode}
@@ -170,12 +170,12 @@
from
xs_role
where
deleted = 0
deleted = FALSE
and org_id = #{orgId}
<if test="platformCode != null">
and platform_code = #{platformCode}
</if>
and type != 1
and type != '1'
</select>
</mapper>

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">
@@ -8,7 +8,7 @@
*
from uc_slick_param
where
deleted = 0
deleted = FALSE
<if test="param.id != null">
and id = #{param.id}
</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">
<mapper namespace="com.senmesh.usercenter.district.dao.DistrictMapper">
@@ -8,7 +8,7 @@
FROM
xs_district
WHERE
deleted = 0
deleted = FALSE
AND code IN
<foreach open="(" separator="," close=")" collection="codes" index="index" item="code" >
#{code}
@@ -22,7 +22,7 @@
FROM
xs_district
WHERE
deleted = 0
deleted = FALSE
and parent_id=#{districtId}
ORDER BY code ASC
</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">
<mapper namespace="com.senmesh.usercenter.face.dao.FaceMapper">
<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}
<if test="type != null">
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
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.senmesh.usercenter.dao.XsRoleStandardTypeMapper">
<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">
and role_code = #{roleCode}
</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">
@@ -8,7 +8,7 @@
*
from notice_content_template
where
deleted = 0
deleted = FALSE
<if test='param.id != null'>
and id = #{param.id}
</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">
@@ -12,9 +12,9 @@
FROM
notice_receiver_setting s
LEFT JOIN uc_user u ON u.id = s.receiver_union_id
AND u.deleted = 0
AND u.deleted = FALSE
WHERE
s.deleted = 0
s.deleted = FALSE
AND s.receiver_union_type = 1
<if test='param.id != null'>
and s.id = #{param.id}
@@ -40,9 +40,9 @@
FROM
notice_receiver_setting s
LEFT JOIN xs_role r ON r.id = s.receiver_union_id
AND r.deleted = 0
AND r.deleted = FALSE
WHERE
s.deleted = 0
s.deleted = FALSE
AND s.receiver_union_type = 2
<if test='param.id != null'>
and s.id = #{param.id}
@@ -65,14 +65,14 @@
update
notice_receiver_setting
set
deleted = 1,
deleted = TRUE,
update_time = now(),
update_by = #{param.operateUserId}
where
template_id = #{param.templateId}
and receiver_union_type = #{param.receiverUnionType}
and org_id = #{param.operateOrgId}
and deleted = 0
and deleted = FALSE
<if test="param.receiverUnionIds != null">
and receiver_union_id in
<foreach collection="param.receiverUnionIds" item="receiverUnionId" open="(" separator="," close=")">
@@ -86,7 +86,7 @@
receiver_union_id
from notice_receiver_setting
where
deleted = 0
deleted = FALSE
and template_id = #{param.templateId}
and receiver_union_type = #{param.receiverUnionType}
and org_id = #{param.operateOrgId}
@@ -118,15 +118,15 @@
select
distinct u.id
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
where
u.deleted = 0
and ra.deleted = 0
and r.deleted = 0
where
u.deleted = FALSE
and ra.deleted = FALSE
and r.deleted = FALSE
and r.org_id = #{orgId}
<!-- 机构内角色 -->
and r.type = 1
and r.type = '1'
<if test="unionType == 2">
and r.id in
<foreach collection="unionIds" item="unionId" open="(" separator="," close=")">
@@ -147,8 +147,8 @@
from uc_org_user ou
inner join uc_user u on ou.user_id = u.id
where
ou.deleted = 0
and u.deleted = 0
ou.deleted = FALSE
and u.deleted = FALSE
and ou.org_id = #{orgId}
and u.id in
<foreach collection="userIds" item="userId" open="(" separator="," close=")">
@@ -161,9 +161,9 @@
select
distinct id
from xs_role
where
deleted = 0
and type = 1
where
deleted = FALSE
and type = '1'
and org_id = #{orgId}
and id in
<foreach collection="roleIds" item="roleId" open="(" separator="," close=")">
@@ -180,8 +180,8 @@
from notice_receiver_setting s
inner join uc_user u on s.receiver_union_id = u.id
where
s.deleted = 0
and u.deleted = 0
s.deleted = FALSE
and u.deleted = FALSE
and s.template_id = #{param.templateId}
and s.org_id = #{param.orgId}
and s.receiver_union_type = 1
@@ -197,8 +197,8 @@
from notice_receiver_setting s
inner join xs_role r on s.receiver_union_id = r.id
where
s.deleted = 0
and r.deleted = 0
s.deleted = FALSE
and r.deleted = FALSE
and s.template_id = #{param.templateId}
and s.org_id = #{param.orgId}
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
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
@@ -13,11 +13,11 @@
from notice_send_record_detail rd
inner join notice_send_record r on r.id = rd.record_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
rd.deleted = 0
and r.deleted = 0
and t.deleted = 0
rd.deleted = FALSE
and r.deleted = FALSE
and t.deleted = FALSE
<if test='param.id != null'>
and rd.id = #{param.id}
</if>
@@ -53,11 +53,11 @@
from notice_send_record_detail rd
inner join notice_send_record r on r.id = rd.record_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
rd.deleted = 0
and r.deleted = 0
and t.deleted = 0
rd.deleted = FALSE
and r.deleted = FALSE
and t.deleted = FALSE
<if test='param.id != null'>
and rd.id = #{param.id}
</if>
@@ -97,11 +97,11 @@
from notice_send_record_detail rd
inner join notice_send_record r on r.id = rd.record_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
rd.deleted = 0
and r.deleted = 0
and t.deleted = 0
rd.deleted = FALSE
and r.deleted = FALSE
and t.deleted = FALSE
<if test='param.id != null'>
and rd.id = #{param.id}
</if>
@@ -141,13 +141,13 @@
rd.update_time = now()
where
rd.receiver_status = #{param.oldStatus}
and rd.deleted = 0
and rd.deleted = FALSE
<!-- 通道 -->
and exists (
select *
from notice_send_record r
where r.id = rd.record_id
and r.deleted = 0
and r.deleted = FALSE
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
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"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_content_template ct on ct.id = r.content_template_id
where
r.deleted = 0
and t.deleted = 0
and ct.deleted = 0
r.deleted = FALSE
and t.deleted = FALSE
and ct.deleted = FALSE
<if test='param.id != null'>
and r.id = #{param.id}
</if>
@@ -32,7 +32,7 @@
and exists (
select 1
from notice_send_record_detail rd
where rd.deleted = 0
where rd.deleted = FALSE
and rd.record_id = r.id
and rd.user_id = #{param.userId}
)
@@ -53,6 +53,6 @@
where
id = #{param.id}
and status = #{param.oldStatus}
and deleted = 0
and deleted = FALSE
</update>
</mapper>

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">
@@ -8,7 +8,7 @@
*
from notice_template
where
deleted = 0
deleted = FALSE
<if test='param.id != null'>
and id = #{param.id}
</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">
@@ -17,7 +17,7 @@
<sql id="queryFromSql">
FROM
hr_import_detail_org t
WHERE t.deleted = 0
WHERE t.deleted = FALSE
<if test='param.id != null'>
AND t.id = #{param.id}
</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">
<mapper namespace="com.senmesh.usercenter.org.dao.OrgMapper">
@@ -17,7 +17,7 @@
trade = #{param.trade},
description = #{param.description},
enable = #{param.enable}
where id = #{param.id} and deleted = 0
where id = #{param.id} and deleted = FALSE
</update>
<select id="listOrgDTO" resultType="com.senmesh.usercenter.org.dto.OrgDTO">
@@ -51,9 +51,9 @@
u.phone,
(select org_name from xs_org po where o.parent_id = po.id) parentName
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_user u on ou.user_id = u.id and u.deleted = 0
where o.deleted = 0
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 = FALSE
where o.deleted = FALSE
<if test="param.id != null">
and o.id = #{param.id}
</if>
@@ -112,13 +112,12 @@
u.real_name
FROM xs_org o
LEFT JOIN uc_org_user ou ON ou.org_id = o.id
AND ou.administrator = 1
AND ou.deleted =
0
AND ou.administrator = TRUE
AND ou.deleted = FALSE
LEFT JOIN uc_user u ON u.id = ou.user_id
AND u.deleted = 0
WHERE o.enable = 1
AND o.deleted = 0
AND u.deleted = FALSE
WHERE o.enable = TRUE
AND o.deleted = FALSE
AND o.id = #{param.orgId}
</select>
<select id="orgPartInfoList" resultType="com.senmesh.usercenter.org.dto.UcOrgPartInfoDTO">
@@ -127,14 +126,14 @@
FROM
xs_org o
WHERE
o.deleted = 0
o.deleted = FALSE
<if test='param.orgName != null and param.orgName.trim() != ""'>
<bind name="orgNameLike" value="'%' + param.orgName + '%'"/>
AND o.org_name like #{orgNameLike}
</if>
</select>
<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 id="openOrgPartInfoList" resultType="com.senmesh.usercenter.org.dto.UcOrgPartInfoDTO">
@@ -146,19 +145,19 @@
ci.phone,
i.name categoryName
FROM xs_company_product pc
INNER JOIN xs_product p ON p.id = pc.product_id AND p.deleted = 0
INNER JOIN xs_org o ON o.id = pc.org_id AND o.deleted = 0
LEFT JOIN xs_company_invoice ci ON o.id = ci.org_id AND ci.deleted = 0
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 i ON i.id = ia.invoice_item_id AND i.deleted = 0 AND i.parent_id != 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 = FALSE
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 = 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 = 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 EXISTS (
SELECT * FROM xs_company_product pc
INNER JOIN xs_product p ON p.id = pc.product_id AND p.deleted = 0
INNER JOIN xs_org o ON o.id = pc.org_id AND o.deleted = 0
WHERE pc.deleted = 0 AND o.id = #{param.operateOrgId} AND p.product_code = #{param.productCode}
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 = FALSE
WHERE pc.deleted = FALSE AND o.id = #{param.operateOrgId} AND p.product_code = #{param.productCode}
)
</select>
</mapper>

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">
@@ -8,7 +8,7 @@
*
from uc_org_relation
where
deleted = 0
deleted = FALSE
<if test="param.id != null">
and id = #{param.id}
</if>
@@ -29,7 +29,7 @@
from uc_org_relation uor
inner join xs_org o on o.id = uor.org_id
where
uor.deleted = 0
uor.deleted = FALSE
and FIND_IN_SET(#{orgId}, uor.path)
<if test="param.orgType != null">
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
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
@@ -26,11 +26,11 @@
<if test="param.orgId!=null">
LEFT JOIN xs_permission_organization t2 ON
t1.id = t2.permission_package_id
AND t2.deleted=0
AND t2.deleted = FALSE
AND t2.allocation_org_id= #{param.orgId}
</if>
WHERE
t1.deleted = 0
t1.deleted = FALSE
<if test="param.platformCode!=null">
AND t1.platform_code = #{param.platformCode}
</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">
@@ -11,7 +11,7 @@
FROM
xs_org t1
WHERE
t1.deleted = 0
t1.deleted = FALSE
AND NOT EXISTS (
SELECT
1
@@ -19,10 +19,10 @@
xs_permission_package a1
INNER JOIN xs_permission_organization a2 ON
a1.id = a2.permission_package_id
AND a2.deleted = 0
AND a2.deleted = FALSE
WHERE
a1.id = #{param.permissionPackageId}
AND a1.deleted = 0
AND a1.deleted = FALSE
AND a2.allocation_org_id = t1.id )
<if test="param.orgCode!=null and param.orgCode.trim() !=''">
AND t1.org_code like CONCAT('%', #{param.orgCode}, '%')
@@ -52,13 +52,13 @@
xs_permission_package t1
INNER JOIN xs_permission_organization t2 ON
t1.id = t2.permission_package_id
AND t2.deleted = 0
AND t2.deleted = FALSE
INNER JOIN xs_org t3 ON
t3.id = t2.allocation_org_id
AND t3.deleted = 0
AND t3.deleted = FALSE
WHERE
t1.deleted = 0
t1.deleted = FALSE
AND t1.id =#{param.permissionPackageId}
<if test="param.orgCode!=null and param.orgCode.trim() !=''">
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
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
@@ -10,13 +10,13 @@
xs_permission_package t1
INNER JOIN xs_permission_resources t2 ON
t2.permission_package_id = t1.id
AND t2.deleted = 0
AND t2.deleted = FALSE
AND t2.resource_type = 1
INNER JOIN xs_url t3 ON
t3.id = t2.resource_id
AND t3.deleted = 0
AND t3.deleted = FALSE
WHERE t1.id= #{permissionPackageId}
AND t1.deleted=0
AND t1.deleted = FALSE
</select>
<select id="urlComponentList"
@@ -44,10 +44,10 @@
AND t3.resource_type = 2
WHERE
t2.id = #{param.permissionPackageId}
and t2.deleted = 0
and t3.deleted = 0) t4 ON t1.id = t4.resource_id
and t2.deleted = FALSE
and t3.deleted = FALSE) t4 ON t1.id = t4.resource_id
WHERE
t1.deleted = 0
t1.deleted = FALSE
AND t1.url_id = #{param.urlId}
<if test="param.selected == true">
and t4.id is not null
@@ -79,16 +79,16 @@
xs_permission_package t2
INNER JOIN xs_permission_resources t3 ON
t2.id = t3.permission_package_id
AND t3.deleted = 0
AND t3.deleted = FALSE
AND t3.resource_type = 3
WHERE t2.id= #{param.permissionPackageId}
and t2.deleted = 0
and t3.deleted = 0
and t2.deleted = FALSE
and t3.deleted = FALSE
) t4 ON
t4.resource_id = t1.id
WHERE
t1.parent_id = #{param.urlId}
AND t1.deleted = 0
AND t1.deleted = FALSE
AND t1.type = 2
<if test="param.selected == true">
and t4.id is not null
@@ -102,9 +102,9 @@
UPDATE
xs_permission_resources
SET
deleted = 1
deleted = TRUE
WHERE
deleted = 0
deleted = FALSE
AND resource_type = 1
AND permission_package_id= #{permissionPackageId}
</update>
@@ -114,18 +114,18 @@
xs_permission_package t1
INNER JOIN xs_permission_resources t2 ON
t2.permission_package_id = t1.id
AND t2.deleted = 0
AND t2.deleted = FALSE
AND t2.resource_type = 2
LEFT JOIN xs_component t3 ON
t3.id = t2.resource_id
AND t3.deleted = 0
AND t3.deleted = FALSE
LEFT JOIN xs_permission_resources t4 ON
t4.permission_package_id=t1.id
AND t4.resource_id=t3.url_id
AND t4.resource_type=1
AND t4.deleted=0
SET t2.deleted=1
WHERE t1.deleted=0 AND t4.id IS NULL AND t1.id=#{permissionPackageId}
AND t4.deleted = FALSE
SET t2.deleted = TRUE
WHERE t1.deleted = FALSE AND t4.id IS NULL AND t1.id=#{permissionPackageId}
</update>
<update id="refreshUrlResourcesInfo">
@@ -133,18 +133,18 @@
xs_permission_package t1
INNER JOIN xs_permission_resources t2 ON
t2.permission_package_id = t1.id
AND t2.deleted = 0
AND t2.deleted = FALSE
AND t2.resource_type = 3
LEFT JOIN xs_url t3 ON
t3.id = t2.resource_id
AND t3.deleted = 0
AND t3.deleted = FALSE
LEFT JOIN xs_permission_resources t4 ON
t4.permission_package_id=t1.id
AND t4.resource_id=t3.parent_id
AND t4.resource_type=1
AND t4.deleted=0
SET t2.deleted=1
WHERE t1.deleted=0 AND t4.id IS NULL AND t1.id=#{permissionPackageId}
AND t4.deleted = FALSE
SET t2.deleted = TRUE
WHERE t1.deleted = FALSE AND t4.id IS NULL AND t1.id=#{permissionPackageId}
</update>
@@ -152,11 +152,11 @@
UPDATE
xs_permission_resources t
SET
t.deleted = 1,
t.deleted = TRUE,
t.update_by = #{usrId},
t.update_time = now()
WHERE
t.deleted = 0
t.deleted = FALSE
AND t.permission_package_id = #{permissionPackageId}
<if test="removeResourceIds!=null and removeResourceIds.size()>0">
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
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.senmesh.usercenter.resource.dao.UcComponentMapper">
<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">
AND url_id = #{param.urlId}
</if>
@@ -18,7 +18,7 @@
FROM
xs_component t1
WHERE
t1.deleted = 0 and t1.platform_code = #{systemCode}
t1.deleted = FALSE and t1.platform_code = #{systemCode}
<if test="orgId != null">
AND t1.id IN (
SELECT
@@ -26,11 +26,11 @@
FROM
xs_permission_resources t2
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
AND t4.deleted = 0
AND t4.deleted = FALSE
WHERE
t2.deleted = 0 AND t2.resource_type = 2
t2.deleted = FALSE AND t2.resource_type = '2'
AND t3.platform_code = #{systemCode}
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
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
@@ -24,7 +24,7 @@
<select id="findAllUrl" resultType="com.senmesh.usercenter.resource.dto.UrlDTO">
<include refid="menuListColumn"></include>
WHERE
deleted = 0
deleted = FALSE
AND platform_code = #{platformCode}
AND type = 1
<if test=" orgId!=null and orgId!=1 ">
@@ -35,12 +35,12 @@
xs_permission_package xpp
INNER JOIN xs_permission_resources xpr ON
xpp.id = xpr.permission_package_id
AND xpr.deleted = 0
AND xpr.deleted = FALSE
INNER JOIN xs_permission_organization xpo ON
xpo.allocation_org_id = #{orgId}
AND xpp.id=xpo.permission_package_id
AND xpo.deleted =0
WHERE xpp.deleted =0
AND xpo.deleted = FALSE
WHERE xpp.deleted = FALSE
)
</if>
ORDER BY parent_id
@@ -70,7 +70,7 @@
<select id="list" resultType="com.senmesh.usercenter.resource.dto.UrlDTO">
<include refid="menuListColumn"/>
where deleted = 0
where deleted = FALSE
<if test='param.platformCode != null'>
AND platform_code = #{param.platformCode}
</if>
@@ -84,12 +84,12 @@
</select>
<update id="batchDeleted" parameterType="java.util.Set">
update xs_url set deleted = 1
update xs_url set deleted = TRUE
where id in
<foreach collection="urlIds" open="(" separator="," close=")" item="urlId">
#{urlId}
</foreach>
AND deleted = 0
AND deleted = FALSE
</update>
<select id="listUrlDTO" resultType="com.senmesh.usercenter.resource.dto.UrlDTO">
@@ -98,7 +98,7 @@
FROM
xs_url t1
WHERE
t1.deleted = 0
t1.deleted = FALSE
and t1.platform_code = #{systemCode}
and t1.type =1
<if test="orgId != null">
@@ -108,11 +108,11 @@
FROM
xs_permission_resources t2
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
AND t4.deleted = 0
AND t4.deleted = FALSE
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 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
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
@@ -11,7 +11,7 @@
FROM
xs_search_history sh
WHERE
sh.deleted = 0 AND sh.user_id = #{userId}
sh.deleted = FALSE AND sh.user_id = #{userId}
GROUP BY
sh.context
ORDER BY

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">
@@ -11,11 +11,10 @@
FROM
uc_domain_auth da
LEFT JOIN uc_auth_client ac ON ac.id = da.auth_client_id
AND ac.deleted =
0 LEFT JOIN uc_auth_type atp ON atp.auth_type_code = da.auth_type_code
AND atp.deleted = 0
AND ac.deleted = FALSE LEFT JOIN uc_auth_type atp ON atp.auth_type_code = da.auth_type_code
AND atp.deleted = FALSE
WHERE
da.deleted = 0
da.deleted = FALSE
<if test="param.domainId != null">
and da.domain_id = #{param.domainId}
</if>
@@ -28,16 +27,16 @@
FROM
uc_auth_client ac
LEFT JOIN uc_auth_type atp ON atp.auth_type_code = ac.auth_type_code
AND atp.deleted = 0
AND atp.deleted = FALSE
WHERE
ac.deleted = 0
ac.deleted = FALSE
AND ac.id NOT IN (
SELECT DISTINCT
auth_client_id
FROM
uc_domain_auth
WHERE
deleted = 0)
deleted = FALSE)
</select>
</mapper>

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">
@@ -7,9 +7,9 @@
select
d.*,o.org_name
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
d.deleted = 0
d.deleted = FALSE
<if test="param.id != null">
and d.id = #{param.id}
</if>
@@ -25,7 +25,7 @@
d.*
from uc_domain d
where
d.deleted = 0
d.deleted = FALSE
<if test="domainOrIp != null and domainOrIp != ''">
and (d.domain_name = #{domainOrIp} or d.ip_port = #{domainOrIp})
</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">
<mapper namespace="com.senmesh.usercenter.sys.dao.DomainSettingMapper">
@@ -13,9 +13,9 @@
<if test=' param.domainOrIp != null and param.domainOrIp.trim() != "" '>
LEFT JOIN uc_domain d ON d.id = ds.domain_id
</if>
WHERE ds.deleted = 0
WHERE ds.deleted = FALSE
<if test=' param.domainOrIp != null and param.domainOrIp.trim() != "" '>
AND d.deleted = 0
AND d.deleted = FALSE
</if>
<if test=' param.domainOrIp != null and param.domainOrIp.trim() != "" '>
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
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
@@ -8,7 +8,7 @@
*
from uc_faq_file
where
deleted = 0 and question_id = #{param.questionId}
deleted = FALSE and question_id = #{param.questionId}
order by id desc
</select>
</mapper>

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">
@@ -8,7 +8,7 @@
*
from uc_faq
where
deleted = 0
deleted = FALSE
<if test="param.faqType != null">
and faq_type = #{param.faqType}
</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">
@@ -8,7 +8,7 @@
f.*,u.nickname
from uc_feedback f left join uc_user u on f.user_id = u.id
where
f.deleted = 0
f.deleted = FALSE
<if test='param.nickname != null and param.nickname.trim() != ""'>
<bind name="nicknameLike" value="'%' + param.nickname + '%'" />
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
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
@@ -8,7 +8,7 @@
*
from uc_platform
where
deleted = 0
deleted = FALSE
<if test="param.id != null">
and id = #{param.id}
</if>
@@ -21,7 +21,7 @@
*
from uc_platform
where
deleted = 0
deleted = FALSE
<if test="param.id != null">
and id = #{param.id}
</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">
<mapper namespace="com.senmesh.usercenter.tag.dao.TagMapper">
<select id="page" resultType="com.senmesh.usercenter.tag.dto.TagDTO">
select t.* from xs_tag t
where t.deleted = 0
where t.deleted = FALSE
<if test="tagType != null">
and t.tag_type = #{tagType}
</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">
<mapper namespace="com.senmesh.usercenter.tag.dao.TagRelationshipMapper">
<update id="updatePost">
@@ -6,7 +6,7 @@
set update_time = now(),
update_by = 1,
affiliation_tags = #{affiliationTags}
where deleted = 0
where deleted = FALSE
and id = #{id}
</update>
@@ -14,7 +14,7 @@
select id,
affiliation_tags affiliationTags
from hr_operating_post
where deleted = 0
where deleted = FALSE
and id = #{id}
</select>
<select id="sourceIdMap" resultType="com.senmesh.usercenter.tag.dto.TagRelationshipInfoDTO">
@@ -26,8 +26,8 @@
xs_tag_relationship tr
LEFT JOIN xs_tag t ON t.id = tr.tag_id
WHERE
tr.deleted = 0
AND t.deleted = 0
tr.deleted = FALSE
AND t.deleted = FALSE
AND tr.source_type = #{sourceType}
<if test="sourceIds != null">
AND tr.source_id in
@@ -43,8 +43,8 @@
xs_tag_relationship tr
LEFT JOIN xs_tag t ON t.id = tr.tag_id
WHERE
tr.deleted = 0
AND t.deleted = 0
tr.deleted = FALSE
AND t.deleted = FALSE
AND tr.source_type = #{sourceType}
<if test="tagNames != null">
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
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
@@ -10,7 +10,7 @@
*
from uc_org_user
where
deleted = 0
deleted = FALSE
<if test="param.id != null">
and id = #{param.id}
</if>
@@ -33,9 +33,9 @@
select
CASE WHEN count(*) = 0 THEN 1 ELSE 0 end
from uc_org_user
where deleted = 0
where deleted = FALSE
and org_id = #{orgId}
and (user_id = #{userId} or administrator = 1)
and (user_id = #{userId} or administrator = TRUE)
</select>
<select id="existOrgUser" resultType="boolean">
@@ -43,15 +43,15 @@
CASE WHEN count(*) > 0 THEN 1 ELSE 0 end
from uc_user u
where u.type = 1
and u.deleted = 0
and u.deleted = FALSE
and u.phone = #{phone}
and exists
(select *
from uc_org_user ou
inner join xs_org o on o.id = ou.org_id
where ou.user_id = u.id
and ou.deleted = 0
and o.enable = 1
and ou.deleted = FALSE
and o.enable = TRUE
)
</select>
@@ -67,12 +67,12 @@
FROM
xs_org t1
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
AND t3.deleted = 0
AND t3.deleted = FALSE
WHERE
t1.deleted = 0
and t1.enable = 1
t1.deleted = FALSE
and t1.enable = TRUE
AND t3.id = #{userId}
<if test="orgId != null">
and t1.id = #{orgId}
@@ -103,8 +103,8 @@
uc_user u
LEFT JOIN uc_org_user ou ON u.id = ou.user_id
WHERE
u.deleted = 0
AND ou.deleted = 0
u.deleted = FALSE
AND ou.deleted = FALSE
<if test="param.userId != null">
AND u.id = #{param.userId}
</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">
@@ -8,7 +8,7 @@
*
from uc_user_auth
where
deleted = 0
deleted = FALSE
<if test="param.id != null">
and id = #{param.id}
</if>
@@ -36,6 +36,6 @@
update_time = now()
where
user_id = #{deletedUserId}
and deleted = 0
and deleted = FALSE
</update>
</mapper>

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">
@@ -12,8 +12,8 @@
uc_user uu
LEFT JOIN uc_user_bank_account uuba ON uuba.user_id = uu.id
WHERE
uu.deleted = 0
AND uuba.deleted = 0
uu.deleted = FALSE
AND uuba.deleted = FALSE
AND uuba.default_account = 1
AND uu.card_no IN
<foreach collection="cardNos" item="cardNo" open="(" close=")" separator=",">
@@ -27,7 +27,7 @@
FROM
uc_user_bank_account
WHERE
deleted = 0
deleted = FALSE
<if test="param.id != null">
and id = #{param.id}
</if>
@@ -53,7 +53,7 @@
and exists (
select 1 from uc_user u
where u.id = user_id
and u.deleted = 0 and u.status != 3
and u.deleted = FALSE and u.status != 3
)
</if>
</select>
@@ -71,7 +71,7 @@
</if>
</set>
where user_id = #{param.operateUserId}
and deleted = 0
and deleted = FALSE
and (id = #{param.id}
<if test="param.defaultAccount == true">
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
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
@@ -9,7 +9,7 @@
*
from uc_user_bank_card_four_verification
where
deleted = 0
deleted = FALSE
<if test="param.id != null">
and id = #{param.id}
</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">
@@ -8,7 +8,7 @@
*
from uc_user_bank_card_three_verification
where
deleted = 0
deleted = FALSE
<if test="param.id != null">
and id = #{param.id}
</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">
@@ -13,7 +13,7 @@
uc_user_cancel ucc
LEFT JOIN uc_user uc ON uc.id = ucc.user_id
WHERE
ucc.deleted = 0
ucc.deleted = FALSE
<if test="param.userId != null">
and ucc.user_id = #{param.userId}
</if>
@@ -33,7 +33,7 @@
uc.card_no
FROM uc_user_cancel ucc
LEFT JOIN uc_user uc ON uc.id = ucc.user_id
WHERE ucc.deleted = 0
WHERE ucc.deleted = FALSE
AND ucc.status = 1
AND TO_DAYS(
NOW()) - TO_DAYS(ucc.create_time) = 1
@@ -44,7 +44,7 @@
uc.phone,
uc.card_no
FROM uc_user uc
WHERE uc.deleted = 0
WHERE uc.deleted = FALSE
AND uc.id = #{userId}
</select>
</mapper>

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

View File

@@ -1,17 +1,17 @@
<?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">
<mapper namespace="com.senmesh.usercenter.user.dao.UserPostalInfoMapper">
<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>
<select id="listUserPostalInfoDTO" resultType="com.senmesh.usercenter.user.dto.UserPostalInfoDTO">
select
*
from uc_user_postal_info
where
deleted = 0
deleted = FALSE
<if test="param.id != null">
and id = #{param.id}
</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">
@@ -8,7 +8,7 @@
*
from uc_user_register
where
deleted = 0
deleted = FALSE
<if test="param.id != null">
and id = #{param.id}
</if>
@@ -28,9 +28,9 @@
from uc_user_register ur
inner join uc_user ru on ur.user_id = ru.id
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">
and ur.platform_code = #{param.platformCode}
</if>

View File

@@ -56,7 +56,7 @@ public interface UserMapMapper {
@Mappings(
value = {
@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",
constant = "false"),
})
@@ -71,7 +71,7 @@ public interface UserMapMapper {
@Mappings(
value = {
@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",
constant = "false"),
})

View File

@@ -2,5 +2,4 @@ org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
com.senmesh.common.CommonConfiguration,\
com.senmesh.codegenerator.config.CodeConfiguration,\
com.senmesh.frame.redis.config.RedisCacheConfig,\
com.senmesh.frame.redis.redisson.RedissonConfig,\
com.senmesh.mq.config.RabbitMqConfiguration
com.senmesh.frame.redis.redisson.RedissonConfig

View File

@@ -9,11 +9,11 @@ spring.datasource.driverClassName=org.postgresql.Driver
spring.datasource.type=com.alibaba.druid.pool.DruidDataSource
# 初始化时建立物理连接的个数
spring.datasource.druid.initial-size=50
spring.datasource.druid.initial-size=20
# 最大连接池数量
spring.datasource.druid.max-active=500
spring.datasource.druid.max-active=50
# 最小连接池数量
spring.datasource.druid.min-idle=50
spring.datasource.druid.min-idle=20
# 获取连接时最大等待时间,单位毫秒
spring.datasource.druid.max-wait=60000
spring.servlet.multipart.max-file-size=50MB
@@ -22,41 +22,48 @@ spring.cloud.config.allowOverride=true
spring.cloud.config.overrideNone=true
# mybatis
mybatis.mapperLocations=classpath*:com/newyetai/**/mapper/*Mapper.xml
mybatis.mapperLocations=classpath*:com/senmesh/**/mapper/*Mapper.xml
mybatis.configuration.map-underscore-to-camel-case=true
pagehelper.helperDialect=postgresql
pagehelper.reasonable=true
#mybatis plus
mybatis-plus.mapper-locations=classpath*:com/newyetai/**/mapper/*.xml
mybatis-plus.mapper-locations=classpath*:com/senmesh/**/mapper/*.xml
mybatis-plus.configuration.default-enum-type-handler=com.baomidou.mybatisplus.extension.handlers.MybatisEnumTypeHandler
mybatis-plus.type-aliases-package=com.newyetai.**.entity
mybatis-plus.type-enums-package=com.newyetai.**.enums
mybatis-plus.type-aliases-package=com.senmesh.**.entity
mybatis-plus.type-enums-package=com.senmesh.**.enums
### 日志文件
logging.file.name=/usr/local/logs/${spring.application.name}.log
logging.file.name=D:/work/git/demo/logs/${spring.application.name}.log
logging.pattern.console:%d{yyyy/MM/dd-HH:mm:ss} %X{traceId:-} [%thread] %-5level %logger- %msg%n
logging.pattern.file:%d{yyyy/MM/dd-HH:mm:ss} %X{traceId:-} [%thread] %-5level %logger- %msg%n
### 文件路径
file.upload-dir=/var/${spring.application.name}/upload
file.upload-dir=D:/work/git/demo/upload
java.io.tmpdir=/var/${spring.application.name}/upload/tmpdir
#文件存储配置
file.storage.type=local
### 文件位置:1内网2外网
file.location=1
### 传输发送目录
file.transfer-send-dir=D:/work/git/demo/transfer/send
### 传输接收目录
file.transfer-receive-dir=D:/work/git/demo/transfer/receive
#发号器
#机器id:根据ip自己定义
code.snowflake.workid.192.168.31.135=23
code.snowflake.workid.192.168.1.66=24
code.snowflake.workid.192.168.71.5=23
code.snowflake.workid.192.168.1.47=24
code.snowflake.workid.121.37.2.171=1
code.snowflake.workid.139.159.237.199=2
##redis配置
spring.redis.password=
spring.redis.host=139.159.237.199
spring.redis.port=8607
spring.redis.password=Nm6uHJQLWQ17qwct
spring.redis.host=121.37.2.171
spring.redis.port=3004
spring.redis.lettuce.pool.min-idle=2
spring.redis.lettuce.pool.max-idle=8
spring.redis.lettuce.pool.max-active=10
@@ -111,6 +118,7 @@ security.oauth2.enable=false
#oauth配置类型:true使用数据库配置,否则配置文件
#security.oauth2.usedb=true
swagger.enable=true
#websocket配置
websocket.enable=true

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