| | |
| | | |
| | | <resultMap type="ArdAppTask" id="ArdAppTaskResult"> |
| | | <result property="id" column="id"/> |
| | | <result property="type" column="type"/> |
| | | <result property="name" column="name"/> |
| | | <result property="text" column="text"/> |
| | | <result property="voice" column="voice"/> |
| | |
| | | |
| | | <sql id="selectArdAppTaskVo"> |
| | | select c.id, |
| | | c.type, |
| | | c.name, |
| | | c.text, |
| | | c.voice, |
| | |
| | | </sql> |
| | | <sql id="selectArdAppTaskDto"> |
| | | select a.id, |
| | | a.type, |
| | | a.name, |
| | | a.text, |
| | | a.voice, |
| | |
| | | <select id="selectArdAppTaskList" parameterType="ArdAppTask" resultMap="ArdAppTaskResult"> |
| | | <include refid="selectArdAppTaskVo"/> |
| | | <where> |
| | | <if test="type != null and type != ''">and c.type = #{type}</if> |
| | | <if test="name != null and name != ''">and c.name like '%'||#{name}||'%'</if> |
| | | <if test="text != null and text != ''">and c.text = #{text}</if> |
| | | <if test="voice != null and voice != ''">and c.voice = #{voice}</if> |
| | |
| | | </if> |
| | | <if test="userId != null and userId != ''">and c.user_id = #{userId}</if> |
| | | </where> |
| | | order by c.create_time desc |
| | | </select> |
| | | |
| | | <select id="selectArdAppTaskListWithDetail" parameterType="ArdAppTask" resultMap="ArdAppTaskSubResult"> |
| | |
| | | insert into ard_app_task |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">id,</if> |
| | | <if test="type != null">type,</if> |
| | | <if test="name != null">name,</if> |
| | | <if test="text != null">text,</if> |
| | | <if test="voice != null">voice,</if> |
| | |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id},</if> |
| | | <if test="type != null">#{type},</if> |
| | | <if test="name != null">#{name},</if> |
| | | <if test="text != null">#{text},</if> |
| | | <if test="voice != null">#{voice},</if> |
| | |
| | | <update id="updateArdAppTask" parameterType="ArdAppTask"> |
| | | update ard_app_task |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="type != null">type = #{type},</if> |
| | | <if test="name != null">name = #{name},</if> |
| | | <if test="text != null">text = #{text},</if> |
| | | <if test="voice != null">voice = #{voice},</if> |
| | |
| | | from ard_app_task_detail c |
| | | where c.id = #{id} |
| | | </select> |
| | | <select id="selectNewArdAppTaskByUserId" parameterType="String" resultMap="ArdAppTaskSubResult"> |
| | | <select id="selectNewArdAppTaskByUserId" parameterType="String" resultMap="ArdAppTaskSub1Result"> |
| | | <include refid="selectArdAppTaskDto"/> |
| | | where c.user_id = #{userId} AND c.view_flag is null |
| | | order by create_time desc limit 1 |
| | | </select> |
| | | <select id="selectUnreadArdAppTaskCount" resultType="Integer"> |
| | | SELECT COUNT(A.ID) |
| | | SELECT COUNT(DISTINCT A.ID) |
| | | FROM ard_app_task A |
| | | LEFT JOIN ard_app_task_detail C ON C.task_id = A.ID |
| | | LEFT JOIN ard_app_task_detail C ON C.task_id = A.ID |
| | | WHERE C.view_time IS NULL |
| | | AND C.view_flag = '1' |
| | | AND C.user_id = #{userId} |