67 lines
2.3 KiB
XML
67 lines
2.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.mcwl.resource.mapper.WorkFlowMapper">
|
|
|
|
<update id="updateWorkFlow">
|
|
UPDATE work_flow
|
|
<set>
|
|
<if test="workflowName != null and workflowName != ''">
|
|
workflow_name = #{workflowName},
|
|
</if>
|
|
<if test="category != null and category != ''">
|
|
category = #{category},
|
|
</if>
|
|
<if test="theme != null and theme != ''">
|
|
theme = #{theme},
|
|
</if>
|
|
<if test="style != null and style != ''">
|
|
style = #{style},
|
|
</if>
|
|
<if test="functions != null and functions != ''">
|
|
functions = #{functions},
|
|
</if>
|
|
<if test="activityParticipation != null">
|
|
activity_participation = #{activityParticipation}
|
|
</if>
|
|
<if test="auditStatus != null and auditStatus != ''">
|
|
audit_status = #{auditStatus}
|
|
</if>
|
|
</set>
|
|
WHERE id = #{id}
|
|
</update>
|
|
<update id="setworkFlowTop">
|
|
UPDATE work_flow
|
|
SET is_top = #{i}
|
|
WHERE id = #{id}
|
|
</update>
|
|
|
|
<select id="fetchWorkFlowSortedByTopStatus" resultType="com.mcwl.resource.domain.WorkFlow">
|
|
SELECT is_top
|
|
FROM work_flow
|
|
ORDER BY is_top DESC;
|
|
</select>
|
|
|
|
<select id="workFlowList" resultType="com.mcwl.resource.domain.response.ResponseWorkFlow">
|
|
SELECT id,w.user_id,workflow_name,type,use_number,download_number,cover_path,like_num,nick_name,avatar
|
|
FROM work_flow as w
|
|
LEFT JOIN sys_user u
|
|
on w.user_id = u.user_id
|
|
where w.del_flag = '0'
|
|
<if test="name != null and name != ''">
|
|
and w.workflow_name like CONCAT('%', #{name}, '%')
|
|
</if>
|
|
<if test="type != null and type != ''">
|
|
and w.type like CONCAT('%', #{type}, '%')
|
|
</if>
|
|
</select>
|
|
<select id="sumWorkFlowNumber" resultType="java.lang.Long">
|
|
SELECT COALESCE(count(*), 0) sum
|
|
FROM work_flow
|
|
where user_id = #{userId}
|
|
and del_flag = '0'
|
|
and audit_status in (1, 2)
|
|
</select>
|
|
</mapper>
|