第一次提交

This commit is contained in:
wyw
2024-08-08 00:31:26 +08:00
commit c202e2b63d
1819 changed files with 221890 additions and 0 deletions

View File

@ -0,0 +1,109 @@
<?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.fastbee.notify.mapper.NotifyChannelMapper">
<resultMap type="NotifyChannel" id="NotifyChannelResult">
<result property="id" column="id" />
<result property="name" column="name" />
<result property="channelType" column="channel_type" />
<result property="provider" column="provider" />
<result property="configContent" column="config_content" />
<result property="tenantId" column="tenant_id" />
<result property="tenantName" column="tenant_name" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="delFlag" column="del_flag" />
</resultMap>
<sql id="selectNotifyChannelVo">
select id, name, channel_type, provider, config_content, tenant_id, tenant_name, create_by, create_time, update_by, update_time, del_flag from notify_channel
</sql>
<select id="selectNotifyChannelList" parameterType="NotifyChannel" resultMap="NotifyChannelResult">
<include refid="selectNotifyChannelVo"/>
<where>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
<if test="channelType != null "> and channel_type = #{channelType}</if>
<if test="provider != null and provider != ''"> and provider = #{provider}</if>
<if test="configContent != null and configContent != ''"> and config_content = #{configContent}</if>
<if test="tenantId != null "> and tenant_id = #{tenantId}</if>
</where>
order by create_time desc
</select>
<select id="selectNotifyChannelById" parameterType="Long" resultMap="NotifyChannelResult">
<include refid="selectNotifyChannelVo"/>
where id = #{id}
</select>
<select id="selectNotifyChannelByIds" resultType="com.fastbee.notify.domain.NotifyChannel">
<include refid="selectNotifyChannelVo"/>
where id in
<foreach item="id" collection="idList" open="(" separator="," close=")">
#{id}
</foreach>
</select>
<insert id="insertNotifyChannel" parameterType="NotifyChannel" useGeneratedKeys="true" keyProperty="id">
insert into notify_channel
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="name != null and name != ''">name,</if>
<if test="channelType != null">channel_type,</if>
<if test="provider != null and provider != ''">provider,</if>
<if test="configContent != null and configContent != ''">config_content,</if>
<if test="tenantId != null">tenant_id,</if>
<if test="tenantName != null and tenantName != ''">tenant_name,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="delFlag != null">del_flag,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="name != null and name != ''">#{name},</if>
<if test="channelType != null">#{channelType},</if>
<if test="provider != null and provider != ''">#{provider},</if>
<if test="configContent != null and configContent != ''">#{configContent},</if>
<if test="tenantId != null">#{tenantId},</if>
<if test="tenantName != null and tenantName != ''">#{tenantName},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="delFlag != null">#{delFlag},</if>
</trim>
</insert>
<update id="updateNotifyChannel" parameterType="NotifyChannel">
update notify_channel
<trim prefix="SET" suffixOverrides=",">
<if test="name != null and name != ''">name = #{name},</if>
<if test="channelType != null">channel_type = #{channelType},</if>
<if test="provider != null and provider != ''">provider = #{provider},</if>
<if test="configContent != null and configContent != ''">config_content = #{configContent},</if>
<if test="tenantId != null">tenant_id = #{tenantId},</if>
<if test="tenantName != null and tenantName != ''">tenant_name = #{tenantName},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteNotifyChannelById" parameterType="Long">
delete from notify_channel where id = #{id}
</delete>
<delete id="deleteNotifyChannelByIds" parameterType="String">
delete from notify_channel where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,122 @@
<?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.fastbee.notify.mapper.NotifyLogMapper">
<resultMap type="NotifyLog" id="NotifyLogResult">
<result property="id" column="id" />
<result property="notifyTemplateId" column="notify_template_id" />
<result property="channelId" column="channel_id" />
<result property="msgContent" column="msg_content" />
<result property="sendAccount" column="send_account" />
<result property="sendStatus" column="send_status" />
<result property="resultContent" column="result_content" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="delFlag" column="del_flag" />
<result property="tenantId" column="tenant_id" />
<result property="tenantName" column="tenant_name" />
<result property="serviceCode" column="service_code" />
</resultMap>
<sql id="selectNotifyLogVo">
select id, notify_template_id, channel_id, msg_content, send_account, send_status, result_content,service_code, create_by, create_time, update_by, update_time, del_flag, tenant_id, tenant_name from notify_log
</sql>
<select id="selectNotifyLogList" parameterType="NotifyLog" resultMap="NotifyLogResult">
<include refid="selectNotifyLogVo"/>
<where>
<if test="notifyTemplateId != null "> and notify_template_id = #{notifyTemplateId}</if>
<if test="channelId != null "> and channel_id = #{channelId}</if>
<if test="msgContent != null and msgContent != ''"> and msg_content = #{msgContent}</if>
<if test="sendAccount != null and sendAccount != ''"> and send_account like concat("%", #{sendAccount}, "%")</if>
<if test="sendStatus != null "> and send_status = #{sendStatus}</if>
<if test="resultContent != null and resultContent != ''"> and result_content = #{resultContent}</if>
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
and date_format(create_time,'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d')
</if>
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
and date_format(create_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
</if>
<if test="serviceCode != null and serviceCode != ''"> and service_code = #{serviceCode}</if>
<if test="tenantId != null "> and tenant_id = #{tenantId}</if>
</where>
order by id desc
</select>
<select id="selectNotifyLogById" parameterType="Long" resultMap="NotifyLogResult">
<include refid="selectNotifyLogVo"/>
where id = #{id}
</select>
<insert id="insertNotifyLog" parameterType="NotifyLog" useGeneratedKeys="true" keyProperty="id">
insert into notify_log
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="notifyTemplateId != null">notify_template_id,</if>
<if test="channelId != null">channel_id,</if>
<if test="msgContent != null">msg_content,</if>
<if test="sendAccount != null">send_account,</if>
<if test="sendStatus != null">send_status,</if>
<if test="resultContent != null">result_content,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="delFlag != null">del_flag,</if>
<if test="tenantId != null">tenant_id,</if>
<if test="tenantName != null and tenantName != ''">tenant_name,</if>
<if test="serviceCode != null">service_code,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="notifyTemplateId != null">#{notifyTemplateId},</if>
<if test="channelId != null">#{channelId},</if>
<if test="msgContent != null">#{msgContent},</if>
<if test="sendAccount != null">#{sendAccount},</if>
<if test="sendStatus != null">#{sendStatus},</if>
<if test="resultContent != null">#{resultContent},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="delFlag != null">#{delFlag},</if>
<if test="tenantId != null">#{tenantId},</if>
<if test="tenantName != null and tenantName != ''">#{tenantName},</if>
<if test="serviceCode != null">#{serviceCode},</if>
</trim>
</insert>
<update id="updateNotifyLog" parameterType="NotifyLog">
update notify_log
<trim prefix="SET" suffixOverrides=",">
<if test="notifyTemplateId != null">notify_template_id = #{notifyTemplateId},</if>
<if test="channelId != null">channel_id = #{channelId},</if>
<if test="msgContent != null">msg_content = #{msgContent},</if>
<if test="sendAccount != null">send_account = #{sendAccount},</if>
<if test="sendStatus != null">send_status = #{sendStatus},</if>
<if test="resultContent != null">result_content = #{resultContent},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
<if test="tenantId != null">tenant_id = #{tenantId},</if>
<if test="tenantName != null and tenantName != ''">tenant_name = #{tenantName},</if>
<if test="serviceCode != null">service_code = #{serviceCode},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteNotifyLogById" parameterType="Long">
delete from notify_log where id = #{id}
</delete>
<delete id="deleteNotifyLogByIds" parameterType="String">
delete from notify_log where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,175 @@
<?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.fastbee.notify.mapper.NotifyTemplateMapper">
<resultMap type="com.fastbee.notify.domain.NotifyTemplate" id="NotifyTemplateResult">
<result property="id" column="id" />
<result property="serviceCode" column="service_code" />
<result property="msgParams" column="msg_params"/>
<result property="status" column="status" />
<result property="name" column="name" />
<result property="channelId" column="channel_id" />
<result property="channelType" column="channel_type" />
<result property="provider" column="provider" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="delFlag" column="del_flag" />
<result property="tenantId" column="tenant_id" />
<result property="tenantName" column="tenant_name" />
</resultMap>
<sql id="selectNotifyTemplateVo">
select id, service_code,msg_params,status, name, channel_id, channel_type, provider, create_by, create_time, update_by, update_time, del_flag, tenant_id, tenant_name from notify_template
</sql>
<select id="selectNotifyTemplateList" parameterType="NotifyTemplate" resultMap="NotifyTemplateResult">
<include refid="selectNotifyTemplateVo"/>
<where>
<if test="serviceCode != null and serviceCode != ''"> and service_code = #{serviceCode}</if>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
<if test="channelId != null "> and channel_id = #{channelId}</if>
<if test="channelType != null "> and channel_type = #{channelType}</if>
<if test="provider != null and provider != ''"> and provider = #{provider}</if>
<if test="status != null"> and status = #{status}</if>
<if test="tenantId != null "> and tenant_id = #{tenantId}</if>
</where>
order by status desc, create_time desc
</select>
<select id="selectEnableNotifyTemplateCount" parameterType="NotifyTemplate" resultType="java.lang.Integer">
select count(*) from notify_template t
where t.service_code = #{serviceCode}
and t.status = #{status} and t.id != #{id}
and t.channel_type = #{channelType}
and t.tenant_id = #{tenantId}
<if test="provider != null and provider != ''">
and t.provider = #{provider}
</if>
</select>
<select id="selectNotifyTemplateById" parameterType="Long" resultMap="NotifyTemplateResult">
<include refid="selectNotifyTemplateVo"/>
where id = #{id}
</select>
<select id="selectOnlyEnable" parameterType="NotifyTemplate" resultType="com.fastbee.notify.domain.NotifyTemplate">
<include refid="selectNotifyTemplateVo"/>
where service_code = #{serviceCode}
and status = 1
and channel_type = #{channelType}
and tenant_id = #{tenantId}
<if test="provider != null and provider != ''">
and provider = #{provider}
</if>
</select>
<select id="selectNotifyTemplateByIds" resultType="com.fastbee.notify.domain.NotifyTemplate">
<include refid="selectNotifyTemplateVo"/>
where id in
<foreach item="id" collection="idList" open="(" separator="," close=")">
#{id}
</foreach>
</select>
<select id="selectNotifyTemplateByChannelId" resultType="com.fastbee.notify.domain.NotifyTemplate">
<include refid="selectNotifyTemplateVo"/>
where channel_id = #{channelId}
</select>
<insert id="insertNotifyTemplate" parameterType="NotifyTemplate" useGeneratedKeys="true" keyProperty="id">
insert into notify_template
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="serviceCode != null">service_code,</if>
<if test="name != null and name != ''">name,</if>
<if test="channelId != null">channel_id,</if>
<if test="channelType != null">channel_type,</if>
<if test="provider != null and provider != ''">provider,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="delFlag != null">del_flag,</if>
<if test="msgParams != null">msg_params,</if>
<if test="status != null">status,</if>
<if test="tenantId != null">tenant_id,</if>
<if test="tenantName != null and tenantName != ''">tenant_name,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="serviceCode != null">#{serviceCode},</if>
<if test="name != null and name != ''">#{name},</if>
<if test="channelId != null">#{channelId},</if>
<if test="channelType != null">#{channelType},</if>
<if test="provider != null and provider != ''">#{provider},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="delFlag != null">#{delFlag},</if>
<if test="msgParams != null">#{msgParams},</if>
<if test="status != null">#{status},</if>
<if test="tenantId != null">#{tenantId},</if>
<if test="tenantName != null and tenantName != ''">#{tenantName},</if>
</trim>
</insert>
<update id="updateNotifyTemplate" parameterType="NotifyTemplate">
update notify_template
<trim prefix="SET" suffixOverrides=",">
<if test="serviceCode != null">service_code = #{serviceCode},</if>
<if test="name != null and name != ''">name = #{name},</if>
<if test="channelId != null">channel_id = #{channelId},</if>
<if test="channelType != null">channel_type = #{channelType},</if>
<if test="provider != null and provider != ''">provider = #{provider},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
<if test="msgParams != null">msg_params = #{msgParams},</if>
<if test="status != null">status = #{status},</if>
<if test="tenantId != null">tenant_id = #{tenantId},</if>
<if test="tenantName != null and tenantName != ''">tenant_name = #{tenantName},</if>
</trim>
where id = #{id}
</update>
<update id="updateNotifyBatch" >
update notify_template
<trim prefix="SET" suffixOverrides=",">
<if test="status != null">status = #{status},</if>
</trim>
where id in
<foreach collection="ids" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</update>
<delete id="deleteNotifyTemplateById" parameterType="Long">
delete from notify_template where id = #{id}
</delete>
<delete id="deleteNotifyTemplateByIds" parameterType="String">
delete from notify_template where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<delete id="deleteNotifyTemplateByChannelIds">
delete from notify_template where channel_id in
<foreach item="channelId" collection="array" open="(" separator="," close=")">
#{channelId}
</foreach>
</delete>
<delete id="deleteAlertNotifyTemplateByNotifyTemplateIds">
delete from iot_alert_notify_template where notify_template_id in
<foreach item="notifyTemplateId" collection="array" open="(" separator="," close=")">
#{notifyTemplateId}
</foreach>
</delete>
</mapper>