<?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="cn.gistack.alerts.sms.mapper.SmsResultMapper">
|
|
<!--自定义分页列表查询-->
|
<select id="selectSmsResultPage" resultType="cn.gistack.alerts.sms.vo.SmsResultVO">
|
select ssr.*,
|
sar.rule_name as ruleName,
|
sst.content templateContent,sst.sms_type as smsType
|
from sm_sms_result ssr
|
left join sm_sms_template sst on sst.template_id = ssr.template_id and sst.is_deleted = 0
|
left join YWXT.sm_alarm_rule_detail sard on sard.template_id = sst.id
|
left join YWXT.sm_alarm_rule sar on sar.id = sard.alarm_rule_id
|
where 1=1 and ssr.is_deleted = 0
|
<if test="smsResult.templateId!=null and smsResult.templateId!=''">
|
and ssr.template_id = #{smsResult.templateId}
|
</if>
|
<if test="smsResult.resCode==0">
|
and ssr.res_code =0
|
</if>
|
<if test="smsResult.resCode==1">
|
and ssr.res_code !=0
|
</if>
|
<if test="smsResult.templateContent!=null and smsResult.templateContent!=''">
|
and sst.content like concat('%',#{smsResult.templateContent},'%')
|
</if>
|
<if test="smsResult.startTime!=null and smsResult.startTime!=''">
|
and date_format(ssr.create_time,'%Y-%m-%d') >= #{smsResult.startTime}
|
</if>
|
<if test="smsResult.endTime!=null and smsResult.endTime!=''">
|
and date_format(ssr.create_time,'%Y-%m-%d') <= #{smsResult.endTime}
|
</if>
|
<if test="smsResult.smsType!=null and smsResult.smsType!=''">
|
and sst.sms_type = #{smsResult.smsType}
|
</if>
|
<if test="list!=null and list.size()>0">
|
and sst.template_id in
|
<foreach collection="list" item="id" separator ="," open="(" close=")">
|
#{id}
|
</foreach>
|
</if>
|
order by id desc
|
</select>
|
|
</mapper>
|