万材erp项目
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

139 lines
5.4 KiB

2 years ago
<?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.remind.mapper.RemindMapper">
<!-- 查询我的提醒 -->
<select id="getRemindList" parameterType="map" resultType="Remind">
select top ${pageSize} *
from remind
where
id not in ( select top ${pageIndex} id from remind
<where>
<if test="fromBegin!=null and fromBegin!=''">
and <![CDATA[remindDate >=#{fromBegin} ]]>
</if>
<if test="toEnd!=null and toEnd!=''">
and <![CDATA[remindDate <=#{toEnd} ]]>
</if>
<if test="receiver!=null and receiver!=''">
and <![CDATA[receiver = #{receiver} ]]>
</if>
<if test="vague!=null and vague!=''">
and (remind like '%'+ #{vague}+'%'
or remindDept like '%'+ #{vague}+'%'
or remindDate like '%'+ #{vague}+'%'
or formUrl like '%'+ #{vague}+'%'
or formName like '%'+ #{vague}+'%'
or remindContent like '%'+ #{vague}+'%'
or receiver like '%'+ #{vague}+'%'
or isView like '%'+ #{vague}+'%')
</if>
</where>
order by id desc)
<if test="fromBegin!=null and fromBegin!=''">
and <![CDATA[remindDate >=#{fromBegin} ]]>
</if>
<if test="toEnd!=null and toEnd!=''">
and <![CDATA[remindDate <=#{toEnd} ]]>
</if>
<if test="receiver!=null and receiver!=''">
and receiver = #{receiver}
</if>
<if test="vague!=null and vague!=''">
and (remind like '%'+ #{vague}+'%'
or remindDept like '%'+ #{vague}+'%'
or remindDate like '%'+ #{vague}+'%'
or formUrl like '%'+ #{vague}+'%'
or formName like '%'+ #{vague}+'%'
or remindContent like '%'+ #{vague}+'%'
or receiver like '%'+ #{vague}+'%'
or isView like '%'+ #{vague}+'%')
</if>
order by id desc
</select>
<!--查询我的请求条数 -->
<select id="getRemindTotal" parameterType="map" resultType="long">
select count(*) from remind
<where>
<if test="fromBegin!=null and fromBegin!=''">
and <![CDATA[remindDate >=#{fromBegin} ]]>
</if>
<if test="toEnd!=null and toEnd!=''">
and <![CDATA[remindDate <=#{toEnd} ]]>
</if>
<if test="receiver!=null and receiver!=''">
and receiver = #{receiver}
</if>
<if test="vague!=null and vague!=''">
and (remind like '%'+ #{vague}+'%'
or remindDept like '%'+ #{vague}+'%'
or remindDate like '%'+ #{vague}+'%'
or formUrl like '%'+ #{vague}+'%'
or formName like '%'+ #{vague}+'%'
or remindContent like '%'+ #{vague}+'%'
or receiver like '%'+ #{vague}+'%'
or isView like '%'+ #{vague}+'%')
</if>
</where>
</select>
<insert id="add">
insert into Remind
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="remind != null and remind != ''">remind,</if>
<if test="remindDept != null and remindDept != ''">remindDept,</if>
<if test="remindDate != null and remindDate != ''">remindDate,</if>
<if test="formUrl != null and formUrl != ''">formUrl,</if>
<if test="formName != null and formName != ''">formName,</if>
<if test="remindContent != null and remindContent != ''">remindContent,</if>
<if test="receiver != null and receiver != ''">receiver,</if>
<if test="isView != null and isView != ''">isView,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="remind != null and remind != ''">#{remind},</if>
<if test="remindDept != null and remindDept != ''">#{remindDept},</if>
<if test="remindDate != null and remindDate != ''">#{remindDate},</if>
<if test="formUrl != null and formUrl != ''">#{formUrl},</if>
<if test="formName != null and formName != ''">#{formName},</if>
<if test="remindContent != null and remindContent != ''">#{remindContent},</if>
<if test="receiver != null and receiver != ''">#{receiver},</if>
<if test="isView != null and isView != ''">#{isView},</if>
</trim>
</insert>
<update id="edit">
update remind
<trim prefix="SET" suffixOverrides=",">
<if test="remind != null and remind != ''">remind = #{remind},</if>
<if test="remindDept != null and remindDept != ''">remindDept = #{remindDept},</if>
<if test="remindDate != null and remindDate != ''">remindDate = #{remindDate},</if>
<if test="formUrl != null and formUrl != ''">formUrl = #{formUrl},</if>
<if test="formName != null and formName != ''">formName = #{formName},</if>
<if test="remindContent != null and remindContent != ''">remindContent = #{remindContent},</if>
<if test="receiver != null and receiver != ''">receiver = #{receiver},</if>
<if test="isView != null and isView != ''">isView = #{isView},</if>
</trim>
where id = #{id}
</update>
<select id="getRemind" parameterType="String" resultType="Remind">
select * from remind where id = #{id}
</select>
<select id="getRemindListNoPaging" parameterType="map" resultType="Remind">
select * from remind
<where>
<if test="receiver!=null and receiver!=''">
and <![CDATA[receiver = #{receiver} ]]>
</if>
<if test="isView !=null and isView !=''">
and <![CDATA[isView = #{isView} ]]>
</if>
</where>
order by id desc
</select>
</mapper>