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.
 
 

62 lines
2.3 KiB

<?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.ccsens.tall.persist.dao.TaskPluginDao">
<select id="findPluginOfAdded" resultType="com.ccsens.tall.bean.vo.PluginVo$PluginByTaskAdded">
SELECT
sp.id AS pluginId,
sp.`name` AS pluginName,
sp.plugin_icon AS pluginIcon,
tf.visit_location AS iconUrl,
sp.description AS description,
sp.plugin_author AS pluginAuthor,
ptp.task_detail_id,
ptp.member_role_id
FROM
t_pro_task_plugin AS ptp
LEFT JOIN t_sys_plugin AS sp ON ptp.plugin_id = sp.id
LEFT JOIN t_file AS tf ON sp.plugin_icon = tf.id
AND sp.rec_status = 0
WHERE
ptp.rec_status = 0
AND ptp.task_detail_id = #{taskId}
AND ptp.member_role_id = #{roleId}
<if test="pluginName!=null and pluginName!=''" >
AND sp.description LIKE concat('%',#{pluginName},'%')
</if>
<if test="pluginType!=null and pluginType!=''" >
AND sp.plugin_class = #{pluginType}
</if>
</select>
<select id="findPluginOfNoAdded" resultType="com.ccsens.tall.bean.vo.PluginVo$PluginByTaskAdded">
SELECT
sp.id AS pluginId,
sp.`name` AS pluginName,
sp.plugin_icon AS pluginIcon,
tf.visit_location AS iconUrl,
sp.description AS description,
sp.plugin_author AS pluginAuthor
FROM
t_sys_plugin AS sp
LEFT JOIN t_file AS tf ON sp.plugin_icon = tf.id
WHERE
sp.id NOT IN (
SELECT
ptp.plugin_id
FROM
t_pro_task_plugin AS ptp
WHERE
ptp.task_detail_id = #{taskId}
AND ptp.member_role_id = #{roleId}
AND ptp.rec_status = 0
)
<if test="pluginName!=null and pluginName!=''" >
AND sp.description LIKE concat('%',#{pluginName},'%')
</if>
<if test="pluginType!=null and pluginType!=''" >
AND sp.plugin_class = #{pluginType}
</if>
</select>
</mapper>