<?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.qianwen.smartman.modules.notify.mapper.NotifyHistoryEntityMapper">
|
|
<select id="listPage" resultType="com.qianwen.smartman.modules.notify.entity.NotifyHistoryEntity">
|
SELECT
|
nh.id,
|
nh.context_data as contextData,
|
nh.notify_type,
|
bn.business_name AS businessName,
|
nh.state,
|
nh.create_time,
|
nt.template,
|
nt.NAME AS templateName,
|
nh.provider,
|
nh.template_id AS templateId,
|
nh.create_time AS notifyTime
|
FROM
|
blade_notify_history nh
|
LEFT JOIN blade_notify_template nt ON nh.template_id = nt.id
|
LEFT JOIN blade_business_notify bn ON bn.notify_template_id = nt.id
|
<where>
|
<if test="beginTime != null and endTime != null">
|
nh.create_time BETWEEN #{beginTime}
|
AND #{endTime}
|
</if>
|
<if test="keyword !=null and keyword != ''">
|
<choose>
|
<when test="keyword == '调试'">
|
AND nh.template_id is null
|
</when>
|
<otherwise>
|
AND bn.business_name LIKE CONCAT(#{keyword},'%')
|
</otherwise>
|
</choose>
|
</if>
|
<if test="state !=null and state != ''">
|
AND nh.state = #{state}
|
</if>
|
</where>
|
ORDER BY nh.create_time DESC
|
</select>
|
</mapper>
|