139 lines
3.3 KiB
XML
139 lines
3.3 KiB
XML
<?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.jeeplus.ccqnsoft.task.remind.dao.TaskRemindDao">
|
|
|
|
<sql id="taskRemindColumns">
|
|
a.id AS "id",
|
|
a.title AS "title",
|
|
a.contents AS "contents",
|
|
a.introduction AS "introduction",
|
|
a.sendout_id AS "sendoutId",
|
|
a.sendout_date AS "sendoutDate",
|
|
a.receive_id AS "receiveId",
|
|
a.readed AS "readed",
|
|
a.remind_type AS "remindType",
|
|
b.name as "sendName"
|
|
</sql>
|
|
|
|
<sql id="taskRemindJoins">
|
|
left join SYS_USER b on b.id=a.receive_id
|
|
</sql>
|
|
|
|
|
|
<select id="get" resultType="TaskRemind" >
|
|
SELECT
|
|
<include refid="taskRemindColumns"/>
|
|
FROM task_remind a
|
|
<include refid="taskRemindJoins"/>
|
|
WHERE a.id = #{id}
|
|
</select>
|
|
|
|
<select id="findList" resultType="TaskRemind" >
|
|
SELECT
|
|
<include refid="taskRemindColumns"/>
|
|
|
|
FROM task_remind a
|
|
<include refid="taskRemindJoins"/>
|
|
<where>
|
|
|
|
<if test="title != null and title != ''">
|
|
AND a.title LIKE
|
|
<if test="dbName == 'oracle'">'%'||#{title}||'%'</if>
|
|
<if test="dbName == 'mssql'">'%'+#{title}+'%'</if>
|
|
<if test="dbName == 'mysql'">concat('%',#{title},'%')</if>
|
|
</if>
|
|
<if test="sendoutId != null and sendoutId != ''">
|
|
AND a.sendout_id LIKE
|
|
<if test="dbName == 'oracle'">'%'||#{sendoutId}||'%'</if>
|
|
<if test="dbName == 'mssql'">'%'+#{sendoutId}+'%'</if>
|
|
<if test="dbName == 'mysql'">concat('%',#{sendoutId},'%')</if>
|
|
</if>
|
|
<if test="readed != null and readed != ''">
|
|
AND a.readed = #{readed}
|
|
</if>
|
|
<if test="remindType != null and remindType != ''">
|
|
AND a.remind_type = #{remindType}
|
|
</if>
|
|
<if test="receiveId != null and receiveId != ''">
|
|
AND a.receive_id = #{receiveId}
|
|
</if>
|
|
${sqlMap.dsf}
|
|
</where>
|
|
<choose>
|
|
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
|
|
ORDER BY ${page.orderBy}
|
|
</when>
|
|
<otherwise>
|
|
</otherwise>
|
|
</choose>
|
|
</select>
|
|
|
|
<select id="findAllList" resultType="TaskRemind" >
|
|
SELECT
|
|
<include refid="taskRemindColumns"/>
|
|
FROM task_remind a
|
|
<include refid="taskRemindJoins"/>
|
|
<where>
|
|
|
|
</where>
|
|
<choose>
|
|
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
|
|
ORDER BY ${page.orderBy}
|
|
</when>
|
|
<otherwise>
|
|
</otherwise>
|
|
</choose>
|
|
</select>
|
|
|
|
<insert id="insert">
|
|
INSERT INTO task_remind(
|
|
|
|
title,
|
|
contents,
|
|
introduction,
|
|
sendout_id,
|
|
sendout_date,
|
|
receive_id,
|
|
readed,
|
|
remind_type
|
|
) VALUES (
|
|
|
|
#{title},
|
|
#{contents},
|
|
#{introduction},
|
|
#{sendoutId},
|
|
#{sendoutDate},
|
|
#{receiveId},
|
|
#{readed},
|
|
#{remindType}
|
|
)
|
|
</insert>
|
|
|
|
<update id="update">
|
|
UPDATE task_remind SET
|
|
readed = #{readed},
|
|
remind_type = #{remindType}
|
|
WHERE id = #{id}
|
|
</update>
|
|
|
|
|
|
<!--物理删除-->
|
|
<update id="delete">
|
|
DELETE FROM task_remind
|
|
WHERE id = #{id}
|
|
</update>
|
|
|
|
<!--逻辑删除-->
|
|
<update id="deleteByLogic">
|
|
UPDATE task_remind SET
|
|
del_flag = #{DEL_FLAG_DELETE}
|
|
WHERE id = #{id}
|
|
</update>
|
|
|
|
|
|
<!-- 根据实体名称和字段名称和字段值获取唯一记录 -->
|
|
<select id="findUniqueByProperty" resultType="TaskRemind" statementType="STATEMENT">
|
|
select * FROM tq_task_remind where ${propertyName} = '${value}'
|
|
</select>
|
|
|
|
</mapper> |