|
|
|
<?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.ruoyi.jjh.ent.mapper.JSmartDeclarationMapper">
|
|
|
|
<select id="selectEnterpriseAllList" resultType="com.ruoyi.jjh.ent.entity.HomeRequestSmart">
|
|
|
|
SELECT
|
|
|
|
a.id as id,
|
|
|
|
a.smart_reminders_id as smartRemindersId,
|
|
|
|
b.id as declarationId,
|
|
|
|
b.project_name as declarationName,
|
|
|
|
a.is_read as isRead,
|
|
|
|
a.tyshxydm as tyshxydm,
|
|
|
|
c.alert_recipients as alertRecipients,
|
|
|
|
c.alert_Manner as alertManner,
|
|
|
|
a.alert_time as alertTime,
|
|
|
|
c.days_advance as daysAdvance,
|
|
|
|
c.alert_content as alertContent,
|
|
|
|
a.project_id as projectId
|
|
|
|
FROM
|
|
|
|
j_smart_declaration AS a
|
|
|
|
LEFT JOIN bms_declaration_records AS b ON a.declaration_id = b.id
|
|
|
|
LEFT JOIN j_smart_reminders AS c ON a.smart_reminders_id = c.id
|
|
|
|
<where>
|
|
|
|
c.alert_recipients = 1
|
|
|
|
<if test="userName != null and userName != '' ">
|
|
|
|
and a.tyshxydm = #{userName}
|
|
|
|
</if>
|
|
|
|
and a.alert_time < NOW()
|
|
|
|
</where>
|
|
|
|
order by a.alert_time desc;
|
|
|
|
</select>
|
|
|
|
<select id="chiefAll" resultType="com.ruoyi.jjh.ent.entity.HomeRequestSmart">
|
|
|
|
SELECT
|
|
|
|
a.id as id,
|
|
|
|
a.smart_reminders_id as smartRemindersId,
|
|
|
|
b.project_name as declarationName,
|
|
|
|
a.is_read as isRead,
|
|
|
|
a.tyshxydm as tyshxydm,
|
|
|
|
c.alert_recipients as alertRecipients,
|
|
|
|
c.alert_Manner as alertManner,
|
|
|
|
a.alert_time as alertTime,
|
|
|
|
c.days_advance as daysAdvance,
|
|
|
|
c.alert_content as alertContent,
|
|
|
|
a.project_id as projectId
|
|
|
|
FROM
|
|
|
|
j_smart_declaration AS a
|
|
|
|
LEFT JOIN j_project AS b ON a.project_id = b.id
|
|
|
|
LEFT JOIN j_smart_reminders AS c ON a.smart_reminders_id = c.id
|
|
|
|
<where>
|
|
|
|
c.alert_recipients = 2
|
|
|
|
<if test="projectId != null and projectId != '' ">
|
|
|
|
and a.project_id = #{projectId}
|
|
|
|
</if>
|
|
|
|
<if test="userId != null and userId != '' ">
|
|
|
|
and a.zw_id = #{userId}
|
|
|
|
</if>
|
|
|
|
and a.alert_time < NOW()
|
|
|
|
</where>
|
|
|
|
order by a.alert_time desc;
|
|
|
|
</select>
|
|
|
|
</mapper>
|