中扬CRM客户关系管理系统
LSH
2023-08-22 564bf7ab6a639c2c4557d35b8fd9b51dca60a738
src/main/resources/mapper/PlanMapper.xml
@@ -64,19 +64,32 @@
        <choose>
            <when test="deptId != null and deptId != ''">
                AND (CHARINDEX(','+#{deptId}+',', ','+sd.path+',') > 0 OR sd.id = #{deptId})
                or
                (
                    user_id = #{userId}
                    or
                    mp.id in
                    (
                        select
                        plan_id
                        from man_plan_foll
                        where 1=1
                        and user_id = #{userId}
                    )
                )
            </when>
            <otherwise>
                and
                (
                user_id = #{userId}
                or
                mp.id in
                (
                    select
                    plan_id
                    from man_plan_foll
                    where 1=1
                    and user_id = #{userId}
                    user_id = #{userId}
                    or
                    mp.id in
                    (
                        select
                        plan_id
                        from man_plan_foll
                        where 1=1
                        and user_id = #{userId}
                    )
                )
            </otherwise>
@@ -94,4 +107,34 @@
        ORDER BY mp.create_time DESC
    </select>
    <select id="selectPlanUrlPlanIdUrl" resultType="java.lang.String">
        select url from man_plan_url
        where 1=1
        and id=#{id}
    </select>
    <select id="selectPlanUrlPlanIdName" resultType="java.lang.String">
        select name from man_plan_url
        where 1=1
        and id=#{id}
    </select>
    <select id="selectPlanUrlPlanIdSize" resultType="java.lang.Long">
        select file_size from man_plan_url
        where 1=1
        and id=#{id}
    </select>
    <select id="selectPlanUrlId" resultType="java.lang.Integer">
        select id from man_plan_url
        where 1=1
        and plan_id=#{planId}
    </select>
    <insert id="increasePlanUrl">
        insert into man_plan_url(plan_id,url,name,file_size)
        values(#{planId},#{url},#{name},#{size})
    </insert>
</mapper>