新闻采集修改,完成发送邮件

This commit is contained in:
2025-11-18 17:56:10 +08:00
parent 049b6f2cf3
commit 9f3176194b
50 changed files with 3929 additions and 322 deletions

View File

@@ -2,55 +2,138 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.xyzh.system.mapper.SysConfigMapper">
<!-- 基础结果映射 -->
<!-- 结果映射 -->
<resultMap id="BaseResultMap" type="org.xyzh.common.dto.system.TbSysConfig">
<id column="id" property="id" jdbcType="VARCHAR"/>
<result column="config_key" property="configKey" jdbcType="VARCHAR"/>
<result column="config_value" property="configValue" jdbcType="LONGVARCHAR"/>
<result column="config_type" property="configType" jdbcType="VARCHAR"/>
<result column="config_group" property="configGroup" jdbcType="VARCHAR"/>
<result column="description" property="description" jdbcType="VARCHAR"/>
<result column="is_system" property="isSystem" jdbcType="BOOLEAN"/>
<result column="creator" property="creator" jdbcType="VARCHAR"/>
<result column="updater" property="updater" jdbcType="VARCHAR"/>
<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/>
<result column="delete_time" property="deleteTime" jdbcType="TIMESTAMP"/>
<result column="deleted" property="deleted" jdbcType="BOOLEAN"/>
<id column="id" property="ID" />
<result column="config_key" property="configKey" />
<result column="config_value" property="configValue" />
<result column="config_type" property="configType" />
<result column="config_group" property="configGroup" />
<result column="description" property="description" />
<result column="is_system" property="isSystem" />
<result column="creator" property="creator" />
<result column="updater" property="updater" />
<result column="create_time" property="createTime" />
<result column="update_time" property="updateTime" />
<result column="delete_time" property="deleteTime" />
<result column="deleted" property="deleted" />
</resultMap>
<!-- 基础字段 -->
<!-- 字段列表 -->
<sql id="Base_Column_List">
id, config_key, config_value, config_type, config_group, description,
is_system, creator, updater, create_time, update_time, delete_time, deleted
</sql>
<!-- 通用条件 -->
<sql id="Where_Clause">
<!-- 查询条件 -->
<sql id="Base_Where_Clause">
<where>
deleted = 0
<if test="configKey != null and configKey != ''">
AND config_key = #{configKey}
<if test="filter.configKey != null and filter.configKey != ''">
AND config_key = #{filter.configKey}
</if>
<if test="configGroup != null and configGroup != ''">
AND config_group = #{configGroup}
<if test="filter.configGroup != null and filter.configGroup != ''">
AND config_group = #{filter.configGroup}
</if>
<if test="configType != null and configType != ''">
AND config_type = #{configType}
<if test="filter.configType != null and filter.configType != ''">
AND config_type = #{filter.configType}
</if>
<if test="isSystem != null">
AND is_system = #{isSystem}
<if test="filter.isSystem != null">
AND is_system = #{filter.isSystem}
</if>
</where>
</sql>
<!-- selectSysConfigs -->
<select id="selectSysConfigs" resultMap="BaseResultMap">
SELECT
<include refid="Base_Column_List"/>
<!-- 插入系统配置 -->
<insert id="insertSysConfig" parameterType="org.xyzh.common.dto.system.TbSysConfig">
INSERT INTO tb_sys_config (
id, config_key, config_value, config_type, config_group, description,
is_system, creator, create_time
) VALUES (
#{config.ID}, #{config.configKey}, #{config.configValue}, #{config.configType},
#{config.configGroup}, #{config.description}, #{config.isSystem},
#{config.creator}, NOW()
)
</insert>
<!-- 更新系统配置 -->
<update id="updateSysConfig" parameterType="org.xyzh.common.dto.system.TbSysConfig">
UPDATE tb_sys_config
SET config_value = #{config.configValue},
config_type = #{config.configType},
config_group = #{config.configGroup},
description = #{config.description},
is_system = #{config.isSystem},
updater = #{config.updater},
update_time = NOW()
WHERE id = #{config.ID}
AND deleted = 0
</update>
<!-- 删除系统配置(逻辑删除) -->
<update id="deleteSysConfig">
UPDATE tb_sys_config
SET deleted = 1,
delete_time = NOW()
WHERE id = #{id}
AND deleted = 0
</update>
<!-- 根据配置键查询 -->
<select id="selectSysConfigByKey" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List" />
FROM tb_sys_config
<include refid="Where_Clause"/>
WHERE config_key = #{configKey}
AND deleted = 0
</select>
<!-- 根据ID查询 -->
<select id="selectSysConfigById" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List" />
FROM tb_sys_config
WHERE id = #{id}
AND deleted = 0
</select>
<!-- 查询所有系统配置 -->
<select id="selectAllSysConfig" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List" />
FROM tb_sys_config
WHERE deleted = 0
ORDER BY config_group, config_key
</select>
<!-- 根据分组查询 -->
<select id="selectSysConfigByGroup" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List" />
FROM tb_sys_config
WHERE config_group = #{configGroup}
AND deleted = 0
ORDER BY config_key
</select>
<!-- 查询系统配置列表 -->
<select id="selectSysConfigs" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List" />
FROM tb_sys_config
<include refid="Base_Where_Clause" />
ORDER BY config_group, config_key
</select>
<!-- 分页查询 -->
<select id="selectSysConfigPage" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List" />
FROM tb_sys_config
<include refid="Base_Where_Clause" />
ORDER BY config_group, config_key
LIMIT #{pageParam.offset}, #{pageParam.pageSize}
</select>
<!-- 查询总数 -->
<select id="countSelectSysConfig" resultType="int">
SELECT COUNT(*)
FROM tb_sys_config
<include refid="Base_Where_Clause" />
</select>
</mapper>