| | |
| | | sar.rule_name as ruleName, |
| | | sst.content templateContent,sst.sms_type as smsType |
| | | from sm_sms_result ssr |
| | | left join YWXT.sm_alarm_rule sar on sar.id = ssr.alarm_rule_id |
| | | 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} |
| | |
| | | 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} |
| | | and ssr.create_time >= #{smsResult.startTime} |
| | | </if> |
| | | <if test="smsResult.endTime!=null and smsResult.endTime!=''"> |
| | | and date_format(ssr.create_time,'%Y-%m-%d') <= #{smsResult.endTime} |
| | | and ssr.create_time <= #{smsResult.endTime} |
| | | </if> |
| | | <if test="smsResult.smsType!=null and smsResult.smsType!=''"> |
| | | and sst.sms_type = #{smsResult.smsType} |
| | |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | | order by id desc |
| | | order by ssr.id desc |
| | | </select> |
| | | |
| | | </mapper> |