xdd пре 1 месец
родитељ
комит
a0791c630c
40 измењених фајлова са 0 додато и 6435 уклоњено
  1. 0 8
      fs-service/src/main/resources/mapper/audit/AuditFlowMapper.xml
  2. 0 120
      fs-service/src/main/resources/mapper/audit/AuditMapper.xml
  3. 0 95
      fs-service/src/main/resources/mapper/audit/AuditTempMapper.xml
  4. 0 170
      fs-service/src/main/resources/mapper/delivery/CtArticleMapper.xml
  5. 0 141
      fs-service/src/main/resources/mapper/delivery/CtCloudClassMapper.xml
  6. 0 177
      fs-service/src/main/resources/mapper/delivery/CtLongVideoMapper.xml
  7. 0 165
      fs-service/src/main/resources/mapper/delivery/CtShortVideoMapper.xml
  8. 0 116
      fs-service/src/main/resources/mapper/delivery/TagGroupMapper.xml
  9. 0 147
      fs-service/src/main/resources/mapper/delivery/TagMapper.xml
  10. 0 137
      fs-service/src/main/resources/mapper/doctor/DoctorBalanceLogMapper.xml
  11. 0 220
      fs-service/src/main/resources/mapper/doctor/DoctorCompanyUserMapper.xml
  12. 0 172
      fs-service/src/main/resources/mapper/doctor/DoctorLevelApplyMapper.xml
  13. 0 78
      fs-service/src/main/resources/mapper/doctor/DoctorLevelDataMapper.xml
  14. 0 121
      fs-service/src/main/resources/mapper/doctor/DoctorLevelMapper.xml
  15. 0 140
      fs-service/src/main/resources/mapper/doctor/DoctorLevelMaterialMapper.xml
  16. 0 316
      fs-service/src/main/resources/mapper/doctor/DoctorMapper.xml
  17. 0 30
      fs-service/src/main/resources/mapper/doctor/DynamicSurveyDataMapper.xml
  18. 0 155
      fs-service/src/main/resources/mapper/doctor/WithdrawRecordsMapper.xml
  19. 0 194
      fs-service/src/main/resources/mapper/live/LiveBroadcastMapper.xml
  20. 0 116
      fs-service/src/main/resources/mapper/project/ProjectContractMapper.xml
  21. 0 212
      fs-service/src/main/resources/mapper/project/ProjectMapper.xml
  22. 0 118
      fs-service/src/main/resources/mapper/project/ProjectPermissionMapper.xml
  23. 0 130
      fs-service/src/main/resources/mapper/project/ProjectSettingsMapper.xml
  24. 0 138
      fs-service/src/main/resources/mapper/project/ProjectStandardMapper.xml
  25. 0 181
      fs-service/src/main/resources/mapper/project/ProjectTaskTypeMapper.xml
  26. 0 171
      fs-service/src/main/resources/mapper/provider/ServiceGenConfigMapper.xml
  27. 0 53
      fs-service/src/main/resources/mapper/provider/ServiceGenConfigRunLogMapper.xml
  28. 0 337
      fs-service/src/main/resources/mapper/provider/ServiceOrderMapper.xml
  29. 0 83
      fs-service/src/main/resources/mapper/provider/ServiceOrderTaskRelMapper.xml
  30. 0 198
      fs-service/src/main/resources/mapper/survey/DrugResearchMapper.xml
  31. 0 102
      fs-service/src/main/resources/mapper/survey/DynamicTableMapper.xml
  32. 0 159
      fs-service/src/main/resources/mapper/survey/SurveyFieldConfigMapper.xml
  33. 0 103
      fs-service/src/main/resources/mapper/survey/SurveyFieldTypeMappingMapper.xml
  34. 0 115
      fs-service/src/main/resources/mapper/survey/SurveyQuestionnaireMapper.xml
  35. 0 134
      fs-service/src/main/resources/mapper/survey/SurveyQuestionnaireVersionMapper.xml
  36. 0 228
      fs-service/src/main/resources/mapper/survey/SurveyTaskMapper.xml
  37. 0 153
      fs-service/src/main/resources/mapper/survey/SurveyTaskPeriodMapper.xml
  38. 0 165
      fs-service/src/main/resources/mapper/task/TaskDeliveryInfoMapper.xml
  39. 0 725
      fs-service/src/main/resources/mapper/task/TaskInfoMapper.xml
  40. 0 112
      fs-service/src/main/resources/mapper/task/TaskMaterialInfoMapper.xml

+ 0 - 8
fs-service/src/main/resources/mapper/audit/AuditFlowMapper.xml

@@ -1,8 +0,0 @@
-<?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.fs.audit.mapper.AuditFlowMapper">
-
-
-</mapper>

+ 0 - 120
fs-service/src/main/resources/mapper/audit/AuditMapper.xml

@@ -1,120 +0,0 @@
-<?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.fs.audit.mapper.AuditMapper">
-
-    <select id="selectPendingAuditsByUserId" resultType="com.fs.audit.domain.Audit">
-        SELECT *
-        FROM audit a   <!-- 建议添加别名,便于子查询引用 -->
-        <where>
-            <!-- 待办:需要当前用户审核 + 状态为待审核 -->
-            <if test="status != null and status == 0">
-                AND JSON_CONTAINS(audit_user_ids, CONCAT('[', #{userId}, ']'))
-                AND status = 1
-            </if>
-            <!-- 已办:当前用户参与审核过 + 状态为已完成(通过或退回) -->
-            <if test="status != null and status == 1">
-                AND JSON_CONTAINS(audit_user_ids, CONCAT('[', #{userId}, ']'))
-                AND status IN (2, 3)
-            </if>
-            <!-- 我发起的 -->
-            <if test="status != null and status == 2">
-                AND initiator_id = #{userId}
-            </if>
-            <if test="companyId != null">
-                AND company_id = #{companyId}
-            </if>
-            <if test="initiatorId != null">
-                AND initiator_id = #{initiatorId}
-            </if>
-            <!-- 修正点:集合判空 + separator -->
-            <if test="tempCode != null and tempCode.size() > 0">
-                AND audit_type IN
-                <foreach collection="tempCode" item="item" open="(" separator="," close=")">
-                    #{item}
-                </foreach>
-            </if>
-            <if test="taskStatus != null">
-                AND status = #{taskStatus}
-            </if>
-            <!-- 根据发起人姓名或手机号模糊过滤 -->
-            <if test="keywords != null and keywords != ''">
-                AND EXISTS (
-                SELECT 1
-                FROM company_user u
-                WHERE u.user_id = a.initiator_id   <!-- 使用别名 a -->
-                AND (u.user_name LIKE CONCAT('%', #{keywords}, '%')
-                OR u.phonenumber LIKE CONCAT('%', #{keywords}, '%'))
-                AND u.del_flag = '0'
-                )
-            </if>
-
-            AND audit_type NOT IN ('AUDIT_FWDRWSCPZ', 'ADUIT_TXSH')
-
-        </where>
-        ORDER BY create_time
-        <choose>
-            <when test="sort != null and sort == 1">ASC</when>
-            <otherwise>DESC</otherwise>
-        </choose>
-    </select>
-
-    <select id="selectPendingAuditsByUserIdCount" resultType="long">
-        SELECT COUNT(*)
-        FROM audit a   <!-- 添加别名 -->
-        <where>
-            <!-- 待办:需要当前用户审核 + 状态为待审核 -->
-            <if test="status != null and status == 0">
-                AND JSON_CONTAINS(a.audit_user_ids, CONCAT('[', #{userId}, ']'))
-                AND a.status = 1
-            </if>
-            <!-- 已办:当前用户参与审核过 + 状态为已完成(通过或退回) -->
-            <if test="status != null and status == 1">
-                AND JSON_CONTAINS(a.audit_user_ids, CONCAT('[', #{userId}, ']'))
-                AND a.status IN (2, 3)
-            </if>
-            <!-- 我发起的 -->
-            <if test="status != null and status == 2">
-                AND a.initiator_id = #{userId}
-            </if>
-            <if test="companyId != null">
-                AND a.company_id = #{companyId}
-            </if>
-            <if test="initiatorId != null">
-                AND a.initiator_id = #{initiatorId}
-            </if>
-            <!-- 修正点:使用 size() > 0 判断集合非空 -->
-            <if test="tempCode != null and tempCode.size() > 0">
-                AND a.audit_type IN
-                <foreach collection="tempCode" item="item" open="(" separator="," close=")">
-                    #{item}
-                </foreach>
-            </if>
-            <!-- 如果 taskStatus 与 status 含义不同,确保使用不同的参数名或合并处理 -->
-            <if test="taskStatus != null">
-                AND a.status = #{taskStatus}
-            </if>
-            <!-- 根据发起人姓名或手机号模糊过滤(放在最后,不影响语法) -->
-            <if test="keywords != null and keywords != ''">
-                AND EXISTS (
-                SELECT 1
-                FROM company_user u
-                WHERE u.user_id = a.initiator_id   <!-- 使用别名 a -->
-                AND (u.user_name LIKE CONCAT('%', #{keywords}, '%')
-                OR u.phonenumber LIKE CONCAT('%', #{keywords}, '%'))
-                AND u.del_flag = '0'
-                )
-            </if>
-            AND audit_type NOT IN ('AUDIT_FWDRWSCPZ', 'ADUIT_TXSH')
-
-        </where>
-    </select>
-    <select id="selectById" parameterType="java.lang.Long"
-            resultType="com.fs.audit.domain.Audit">
-        SELECT *
-        FROM audit
-        WHERE id = #{id}
-    </select>
-
-</mapper>

+ 0 - 95
fs-service/src/main/resources/mapper/audit/AuditTempMapper.xml

@@ -1,95 +0,0 @@
-<?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.fs.audit.mapper.AuditTempMapper">
-    <resultMap type="AuditTemp" id="AuditTempResult">
-        <result property="id"    column="id"    />
-        <result property="tempName"    column="temp_name"    />
-        <result property="tempCode"    column="temp_code"    />
-        <result property="tempJson"    column="temp_json"    />
-        <result property="status"    column="status"    />
-        <result property="createTime"    column="create_time"    />
-        <result property="updateTime"    column="update_time"    />
-        <result property="isDel"    column="is_del"    />
-        <result property="companyId"    column="company_id"    />
-    </resultMap>
-
-    <sql id="selectAuditTempVo">
-        select id, temp_name, temp_code, temp_json, status, create_time, update_time, is_del, company_id from audit_temp
-    </sql>
-
-    <select id="selectAuditTempList" parameterType="AuditTemp" resultMap="AuditTempResult">
-        <include refid="selectAuditTempVo"/>
-        <where>
-            <if test="tempName != null  and tempName != ''"> and temp_name like concat('%', #{tempName}, '%')</if>
-            <if test="tempCode != null  and tempCode != ''"> and temp_code = #{tempCode}</if>
-            <if test="tempJson != null  and tempJson != ''"> and temp_json = #{tempJson}</if>
-            <if test="status != null "> and status = #{status}</if>
-            <if test="isDel != null "> and is_del = #{isDel}</if>
-            <if test="companyId != null "> and company_id = #{companyId}</if>
-        </where>
-    </select>
-
-    <select id="selectAuditTempById" parameterType="Long" resultMap="AuditTempResult">
-        <include refid="selectAuditTempVo"/>
-        where id = #{id}
-    </select>
-
-    <insert id="insertAuditTemp" parameterType="AuditTemp" useGeneratedKeys="true" keyProperty="id">
-        insert into audit_temp
-        <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="tempName != null">temp_name,</if>
-            <if test="tempCode != null">temp_code,</if>
-            <if test="tempJson != null">temp_json,</if>
-            <if test="status != null">status,</if>
-            <if test="createTime != null">create_time,</if>
-            <if test="updateTime != null">update_time,</if>
-            <if test="isDel != null">is_del,</if>
-            <if test="companyId != null">company_id,</if>
-        </trim>
-        <trim prefix="values (" suffix=")" suffixOverrides=",">
-            <if test="tempName != null">#{tempName},</if>
-            <if test="tempCode != null">#{tempCode},</if>
-            <if test="tempJson != null">#{tempJson},</if>
-            <if test="status != null">#{status},</if>
-            <if test="createTime != null">#{createTime},</if>
-            <if test="updateTime != null">#{updateTime},</if>
-            <if test="isDel != null">#{isDel},</if>
-            <if test="companyId != null">#{companyId},</if>
-        </trim>
-    </insert>
-
-    <update id="updateAuditTemp" parameterType="AuditTemp">
-        update audit_temp
-        <trim prefix="SET" suffixOverrides=",">
-            <if test="tempName != null">temp_name = #{tempName},</if>
-            <if test="tempCode != null">temp_code = #{tempCode},</if>
-            <if test="tempJson != null">temp_json = #{tempJson},</if>
-            <if test="status != null">status = #{status},</if>
-            <if test="createTime != null">create_time = #{createTime},</if>
-            <if test="updateTime != null">update_time = #{updateTime},</if>
-            <if test="isDel != null">is_del = #{isDel},</if>
-            <if test="companyId != null">company_id = #{companyId},</if>
-        </trim>
-        where id = #{id}
-    </update>
-
-    <delete id="deleteAuditTempById" parameterType="Long">
-        delete from audit_temp where id = #{id}
-    </delete>
-
-    <delete id="deleteAuditTempByIds" parameterType="String">
-        delete from audit_temp where id in
-        <foreach item="id" collection="array" open="(" separator="," close=")">
-            #{id}
-        </foreach>
-    </delete>
-
-
-    <select id="selectById" parameterType="Long" resultMap="AuditTempResult">
-        <include refid="selectAuditTempVo"/>
-        where id = #{id}
-    </select>
-
-</mapper>

+ 0 - 170
fs-service/src/main/resources/mapper/delivery/CtArticleMapper.xml

@@ -1,170 +0,0 @@
-<?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.fs.delivery.mapper.CtArticleMapper">
-    
-    <resultMap type="CtArticle" id="CtArticleResult">
-        <result property="id"    column="id"    />
-        <result property="companyId"    column="company_id"    />
-        <result property="companyName" column="companyName"/>
-        <result property="title"    column="title"    />
-        <result property="tagIds"    column="tag_ids"    />
-        <result property="taskType"    column="task_type"    />
-        <result property="authorType"    column="author_type"    />
-        <result property="authorId"    column="author_id"    />
-        <result property="authorName"    column="author_name"    />
-        <result property="isOriginal"    column="is_original"    />
-        <result property="coverImage"    column="cover_image"    />
-        <result property="groupId"    column="group_id"    />
-        <result property="summary"    column="summary"    />
-        <result property="content"    column="content"    />
-        <result property="attachmentUrl"    column="attachment_url"    />
-        <result property="status"    column="status"    />
-        <result property="createTime"    column="create_time"    />
-        <result property="updateTime"    column="update_time"    />
-        <result property="createBy"    column="create_by"    />
-        <result property="updateBy"    column="update_by"    />
-        <result property="deleted"    column="deleted"    />
-    </resultMap>
-
-    <sql id="selectCtArticleVo">
-        select
-        t.id,
-        t.company_id,
-        c.company_name as companyName,
-        t.title,
-        t.tag_ids,
-        t.task_type,
-        t.author_type,
-        t.author_id,
-        t.author_name,
-        t.is_original,
-        t.cover_image,
-        t.group_id,
-        t.summary,
-        t.content,
-        t.attachment_url,
-        t.status,
-        t.create_time,
-        t.update_time,
-        t.create_by,
-        t.update_by,
-        t.deleted
-        from ct_article t
-        left join company c
-        on c.company_id = t.company_id
-        and c.is_del = 0
-    </sql>
-
-
-    <select id="selectCtArticleList" parameterType="CtArticle" resultMap="CtArticleResult">
-        <include refid="selectCtArticleVo"/>
-        <where>
-            <if test="companyId != null and companyId != ''"> and t.company_id = #{companyId}</if>
-            <if test="title != null and title != ''"> and t.title = #{title}</if>
-            <if test="tagIds != null and tagIds != ''"> and t.tag_ids = #{tagIds}</if>
-            <if test="taskType != null"> and t.task_type = #{taskType}</if>
-            <if test="authorType != null"> and t.author_type = #{authorType}</if>
-            <if test="authorId != null"> and t.author_id = #{authorId}</if>
-            <if test="authorName != null and authorName != ''"> and t.author_name like concat('%', #{authorName}, '%')</if>
-            <if test="isOriginal != null"> and t.is_original = #{isOriginal}</if>
-            <if test="coverImage != null and coverImage != ''"> and t.cover_image = #{coverImage}</if>
-            <if test="groupId != null"> and t.group_id = #{groupId}</if>
-            <if test="summary != null and summary != ''"> and t.summary = #{summary}</if>
-            <if test="content != null and content != ''"> and t.content = #{content}</if>
-            <if test="attachmentUrl != null and attachmentUrl != ''"> and t.attachment_url = #{attachmentUrl}</if>
-            <if test="status != null"> and t.status = #{status}</if>
-            <if test="deleted != null"> and t.deleted = #{deleted}</if>
-        </where>
-        order by t.create_time desc
-    </select>
-    
-    <select id="selectCtArticleById" parameterType="Long" resultMap="CtArticleResult">
-        <include refid="selectCtArticleVo"/>
-        where t.id = #{id}
-    </select>
-        
-    <insert id="insertCtArticle" parameterType="CtArticle" useGeneratedKeys="true" keyProperty="id">
-        insert into ct_article
-        <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="companyId != null">company_id,</if>
-            <if test="title != null and title != ''">title,</if>
-            <if test="tagIds != null">tag_ids,</if>
-            <if test="taskType != null">task_type,</if>
-            <if test="authorType != null">author_type,</if>
-            <if test="authorId != null">author_id,</if>
-            <if test="authorName != null">author_name,</if>
-            <if test="isOriginal != null">is_original,</if>
-            <if test="coverImage != null">cover_image,</if>
-            <if test="groupId != null">group_id,</if>
-            <if test="summary != null">summary,</if>
-            <if test="content != null">content,</if>
-            <if test="attachmentUrl != null">attachment_url,</if>
-            <if test="status != null">status,</if>
-            <if test="createTime != null">create_time,</if>
-            <if test="updateTime != null">update_time,</if>
-            <if test="createBy != null">create_by,</if>
-            <if test="updateBy != null">update_by,</if>
-            <if test="deleted != null">deleted,</if>
-         </trim>
-        <trim prefix="values (" suffix=")" suffixOverrides=",">
-            <if test="companyId != null">#{companyId},</if>
-            <if test="title != null and title != ''">#{title},</if>
-            <if test="tagIds != null">#{tagIds},</if>
-            <if test="taskType != null">#{taskType},</if>
-            <if test="authorType != null">#{authorType},</if>
-            <if test="authorId != null">#{authorId},</if>
-            <if test="authorName != null">#{authorName},</if>
-            <if test="isOriginal != null">#{isOriginal},</if>
-            <if test="coverImage != null">#{coverImage},</if>
-            <if test="groupId != null">#{groupId},</if>
-            <if test="summary != null">#{summary},</if>
-            <if test="content != null">#{content},</if>
-            <if test="attachmentUrl != null">#{attachmentUrl},</if>
-            <if test="status != null">#{status},</if>
-            <if test="createTime != null">#{createTime},</if>
-            <if test="updateTime != null">#{updateTime},</if>
-            <if test="createBy != null">#{createBy},</if>
-            <if test="updateBy != null">#{updateBy},</if>
-            <if test="deleted != null">#{deleted},</if>
-         </trim>
-    </insert>
-
-    <update id="updateCtArticle" parameterType="CtArticle">
-        update ct_article
-        <trim prefix="SET" suffixOverrides=",">
-            <if test="companyId != null">company_id = #{companyId},</if>
-            <if test="title != null and title != ''">title = #{title},</if>
-            <if test="tagIds != null">tag_ids = #{tagIds},</if>
-            <if test="taskType != null">task_type = #{taskType},</if>
-            <if test="authorType != null">author_type = #{authorType},</if>
-            <if test="authorId != null">author_id = #{authorId},</if>
-            <if test="authorName != null">author_name = #{authorName},</if>
-            <if test="isOriginal != null">is_original = #{isOriginal},</if>
-            <if test="coverImage != null">cover_image = #{coverImage},</if>
-            <if test="groupId != null">group_id = #{groupId},</if>
-            <if test="summary != null">summary = #{summary},</if>
-            <if test="content != null">content = #{content},</if>
-            <if test="attachmentUrl != null">attachment_url = #{attachmentUrl},</if>
-            <if test="status != null">status = #{status},</if>
-            <if test="createTime != null">create_time = #{createTime},</if>
-            <if test="updateTime != null">update_time = #{updateTime},</if>
-            <if test="createBy != null">create_by = #{createBy},</if>
-            <if test="updateBy != null">update_by = #{updateBy},</if>
-            <if test="deleted != null">deleted = #{deleted},</if>
-        </trim>
-        where id = #{id}
-    </update>
-
-    <delete id="deleteCtArticleById" parameterType="Long">
-        delete from ct_article where id = #{id}
-    </delete>
-
-    <delete id="deleteCtArticleByIds" parameterType="String">
-        delete from ct_article where id in 
-        <foreach item="id" collection="array" open="(" separator="," close=")">
-            #{id}
-        </foreach>
-    </delete>
-</mapper>

+ 0 - 141
fs-service/src/main/resources/mapper/delivery/CtCloudClassMapper.xml

@@ -1,141 +0,0 @@
-<?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.fs.delivery.mapper.CtCloudClassMapper">
-    
-    <resultMap type="CtCloudClass" id="CtCloudClassResult">
-        <result property="cloudClassId"    column="cloud_class_id"    />
-        <result property="videoId"    column="video_id"    />
-        <result property="taskType"    column="task_type"    />
-        <result property="doctorName"    column="doctor_name"    />
-        <result property="institution"    column="institution"    />
-        <result property="department"    column="department"    />
-        <result property="jobTitle"    column="job_title"    />
-        <result property="title"    column="title"    />
-        <result property="groupId"    column="group_id"    />
-        <result property="tags"    column="tags"    />
-        <result property="createTime"    column="create_time"    />
-        <result property="isOriginal"    column="is_original"    />
-        <result property="coverUrl"    column="cover_url"    />
-        <result property="summary"    column="summary"    />
-        <result property="videoUrl"    column="video_url"    />
-        <result property="validViews"    column="valid_views"    />
-        <result property="viewCount"    column="view_count"    />
-        <result property="status"    column="status"    />
-    </resultMap>
-
-    <sql id="selectCtCloudClassVo">
-        select cloud_class_id, video_id, task_type, doctor_name, institution, department, job_title, title, group_id, tags, create_time, is_original, cover_url, summary, video_url, valid_views, view_count, status from ct_cloud_class
-    </sql>
-
-    <select id="selectCtCloudClassList" parameterType="CtCloudClass" resultMap="CtCloudClassResult">
-        <include refid="selectCtCloudClassVo"/>
-        <where>  
-            <if test="doctorName != null  and doctorName != ''"> and doctor_name like concat('%', #{doctorName}, '%')</if>
-            <if test="institution != null  and institution != ''"> and institution = #{institution}</if>
-            <if test="department != null  and department != ''"> and department = #{department}</if>
-            <if test="jobTitle != null  and jobTitle != ''"> and job_title = #{jobTitle}</if>
-            <if test="title != null  and title != ''"> and title = #{title}</if>
-            <if test="groupId != null "> and group_id = #{groupId}</if>
-            <if test="tags != null  and tags != ''"> and tags = #{tags}</if>
-            <if test="isOriginal != null "> and is_original = #{isOriginal}</if>
-            <if test="coverUrl != null  and coverUrl != ''"> and cover_url = #{coverUrl}</if>
-            <if test="summary != null  and summary != ''"> and summary = #{summary}</if>
-            <if test="videoUrl != null  and videoUrl != ''"> and video_url = #{videoUrl}</if>
-            <if test="validViews != null "> and valid_views = #{validViews}</if>
-            <if test="viewCount != null "> and view_count = #{viewCount}</if>
-            <if test="status != null "> and status = #{status}</if>
-            <if test="keyWord != null and keyWord != ''">
-                AND (
-                title LIKE CONCAT('%', #{keyWord}, '%')
-                OR doctor_name LIKE CONCAT('%', #{keyWord}, '%')
-                )
-            </if>
-        </where>
-    </select>
-    
-    <select id="selectCtCloudClassByCloudClassId" parameterType="Long" resultMap="CtCloudClassResult">
-        <include refid="selectCtCloudClassVo"/>
-        where cloud_class_id = #{cloudClassId}
-    </select>
-        
-    <insert id="insertCtCloudClass" parameterType="CtCloudClass">
-        insert into ct_cloud_class
-        <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="cloudClassId != null">cloud_class_id,</if>
-            <if test="videoId != null">video_id,</if>
-            <if test="taskType != null">task_type,</if>
-            <if test="doctorName != null">doctor_name,</if>
-            <if test="institution != null">institution,</if>
-            <if test="department != null">department,</if>
-            <if test="jobTitle != null">job_title,</if>
-            <if test="title != null and title != ''">title,</if>
-            <if test="groupId != null">group_id,</if>
-            <if test="tags != null">tags,</if>
-            <if test="createTime != null">create_time,</if>
-            <if test="isOriginal != null">is_original,</if>
-            <if test="coverUrl != null">cover_url,</if>
-            <if test="summary != null">summary,</if>
-            <if test="videoUrl != null">video_url,</if>
-            <if test="validViews != null">valid_views,</if>
-            <if test="viewCount != null">view_count,</if>
-            <if test="status != null">status,</if>
-         </trim>
-        <trim prefix="values (" suffix=")" suffixOverrides=",">
-            <if test="cloudClassId != null">#{cloudClassId},</if>
-            <if test="videoId != null">#{videoId},</if>
-            <if test="taskType != null">#{taskType},</if>
-            <if test="doctorName != null">#{doctorName},</if>
-            <if test="institution != null">#{institution},</if>
-            <if test="department != null">#{department},</if>
-            <if test="jobTitle != null">#{jobTitle},</if>
-            <if test="title != null and title != ''">#{title},</if>
-            <if test="groupId != null">#{groupId},</if>
-            <if test="tags != null">#{tags},</if>
-            <if test="createTime != null">#{createTime},</if>
-            <if test="isOriginal != null">#{isOriginal},</if>
-            <if test="coverUrl != null">#{coverUrl},</if>
-            <if test="summary != null">#{summary},</if>
-            <if test="videoUrl != null">#{videoUrl},</if>
-            <if test="validViews != null">#{validViews},</if>
-            <if test="viewCount != null">#{viewCount},</if>
-            <if test="status != null">#{status},</if>
-         </trim>
-    </insert>
-
-    <update id="updateCtCloudClass" parameterType="CtCloudClass">
-        update ct_cloud_class
-        <trim prefix="SET" suffixOverrides=",">
-            <if test="videoId != null">video_id = #{videoId},</if>
-            <if test="taskType != null">task_type = #{taskType},</if>
-            <if test="doctorName != null">doctor_name = #{doctorName},</if>
-            <if test="institution != null">institution = #{institution},</if>
-            <if test="department != null">department = #{department},</if>
-            <if test="jobTitle != null">job_title = #{jobTitle},</if>
-            <if test="title != null and title != ''">title = #{title},</if>
-            <if test="groupId != null">group_id = #{groupId},</if>
-            <if test="tags != null">tags = #{tags},</if>
-            <if test="createTime != null">create_time = #{createTime},</if>
-            <if test="isOriginal != null">is_original = #{isOriginal},</if>
-            <if test="coverUrl != null">cover_url = #{coverUrl},</if>
-            <if test="summary != null">summary = #{summary},</if>
-            <if test="videoUrl != null">video_url = #{videoUrl},</if>
-            <if test="validViews != null">valid_views = #{validViews},</if>
-            <if test="viewCount != null">view_count = #{viewCount},</if>
-            <if test="status != null">status = #{status},</if>
-        </trim>
-        where cloud_class_id = #{cloudClassId}
-    </update>
-
-    <delete id="deleteCtCloudClassByCloudClassId" parameterType="Long">
-        delete from ct_cloud_class where cloud_class_id = #{cloudClassId}
-    </delete>
-
-    <delete id="deleteCtCloudClassByCloudClassIds" parameterType="String">
-        delete from ct_cloud_class where cloud_class_id in 
-        <foreach item="cloudClassId" collection="array" open="(" separator="," close=")">
-            #{cloudClassId}
-        </foreach>
-    </delete>
-</mapper>

+ 0 - 177
fs-service/src/main/resources/mapper/delivery/CtLongVideoMapper.xml

@@ -1,177 +0,0 @@
-<?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.fs.delivery.mapper.CtLongVideoMapper">
-    
-    <resultMap type="CtLongVideo" id="CtLongVideoResult">
-        <result property="id"    column="id"    />
-        <result property="companyId"    column="company_id"    />
-        <result property="companyName" column="companyName"/>
-        <result property="title"    column="title"    />
-        <result property="groupId"    column="group_id"    />
-        <result property="tags"    column="tags"    />
-        <result property="taskType"    column="task_type"    />
-        <result property="authorTypeId"    column="author_type_id"    />
-        <result property="authorId"    column="author_id"    />
-        <result property="authorName" column="authorName"/>
-        <result property="isOriginal"    column="is_original"    />
-        <result property="coverUrl"    column="cover_url"    />
-        <result property="summary"    column="summary"    />
-        <result property="videoUrl"    column="video_url"    />
-        <result property="status"    column="status"    />
-        <result property="createBy"    column="create_by"    />
-        <result property="createTime"    column="create_time"    />
-        <result property="updateBy"    column="update_by"    />
-        <result property="updateTime"    column="update_time"    />
-        <result property="delFlag"    column="del_flag"    />
-    </resultMap>
-
-    <!-- ✅ 关联公司表:查 companyName -->
-    <sql id="selectCtLongVideoVo">
-        SELECT
-        t.id,
-        t.company_id,
-        c.company_name AS companyName,
-
-        t.title,
-        t.group_id,
-        t.tags,
-        t.task_type,
-        t.author_type_id,
-        t.author_id,
-
-        -- ✅ 关键:讲者姓名
-        d.doctor_name AS authorName,
-
-        t.is_original,
-        t.cover_url,
-        t.summary,
-        t.video_url,
-        t.status,
-        t.create_by,
-        t.create_time,
-        t.update_by,
-        t.update_time,
-        t.del_flag
-        FROM ct_long_video t
-        LEFT JOIN company c
-        ON c.company_id = t.company_id
-
-        -- ✅ 关联讲者表(防串公司)
-        LEFT JOIN doctor d
-        ON d.id = t.author_id
-        AND d.company_id = t.company_id
-    </sql>
-
-    <select id="selectCtLongVideoList" parameterType="CtLongVideo" resultMap="CtLongVideoResult">
-        <include refid="selectCtLongVideoVo"/>
-        <where>
-            <!-- ✅ 公司筛选 -->
-            <if test="companyId != null"> AND t.company_id = #{companyId}</if>
-
-            <!-- 你原来的条件(我顺手把 title 改成 like,通常更好用;不想改就换回 =) -->
-            <if test="title != null and title != ''"> AND t.title LIKE CONCAT('%', #{title}, '%')</if>
-
-            <if test="groupId != null"> AND t.group_id = #{groupId}</if>
-            <if test="tags != null and tags != ''"> AND t.tags = #{tags}</if>
-            <if test="taskType != null"> AND t.task_type = #{taskType}</if>
-            <if test="authorTypeId != null"> AND t.author_type_id = #{authorTypeId}</if>
-            <if test="authorId != null"> AND t.author_id = #{authorId}</if>
-            <if test="isOriginal != null"> AND t.is_original = #{isOriginal}</if>
-            <if test="coverUrl != null and coverUrl != ''"> AND t.cover_url = #{coverUrl}</if>
-            <if test="summary != null and summary != ''"> AND t.summary = #{summary}</if>
-            <if test="videoUrl != null and videoUrl != ''"> AND t.video_url = #{videoUrl}</if>
-            <if test="status != null"> AND t.status = #{status}</if>
-
-            <!-- ✅ 软删过滤(如果你们 del_flag=0 才是正常数据;按你系统实际来) -->
-            <if test="delFlag != null"> AND t.del_flag = #{delFlag}</if>
-        </where>
-
-        <!-- 可选:按时间倒序 -->
-        ORDER BY t.create_time DESC
-    </select>
-
-
-    <select id="selectCtLongVideoById" parameterType="Long" resultMap="CtLongVideoResult">
-        <include refid="selectCtLongVideoVo"/>
-        WHERE t.id = #{id}
-    </select>
-        
-    <insert id="insertCtLongVideo" parameterType="CtLongVideo" useGeneratedKeys="true" keyProperty="id">
-        insert into ct_long_video
-        <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="title != null and title != ''">title,</if>
-            <if test="groupId != null">group_id,</if>
-            <if test="tags != null">tags,</if>
-            <if test="taskType != null">task_type,</if>
-            <if test="authorTypeId != null">author_type_id,</if>
-            <if test="authorId != null">author_id,</if>
-            <if test="isOriginal != null">is_original,</if>
-            <if test="coverUrl != null">cover_url,</if>
-            <if test="summary != null">summary,</if>
-            <if test="videoUrl != null">video_url,</if>
-            <if test="status != null">status,</if>
-            <if test="createBy != null">create_by,</if>
-            <if test="createTime != null">create_time,</if>
-            <if test="updateBy != null">update_by,</if>
-            <if test="updateTime != null">update_time,</if>
-            <if test="delFlag != null">del_flag,</if>
-            <if test="companyId != null">company_id,</if>
-        </trim>
-        <trim prefix="values (" suffix=")" suffixOverrides=",">
-            <if test="title != null and title != ''">#{title},</if>
-            <if test="groupId != null">#{groupId},</if>
-            <if test="tags != null">#{tags},</if>
-            <if test="taskType != null">#{taskType},</if>
-            <if test="authorTypeId != null">#{authorTypeId},</if>
-            <if test="authorId != null">#{authorId},</if>
-            <if test="isOriginal != null">#{isOriginal},</if>
-            <if test="coverUrl != null">#{coverUrl},</if>
-            <if test="summary != null">#{summary},</if>
-            <if test="videoUrl != null">#{videoUrl},</if>
-            <if test="status != null">#{status},</if>
-            <if test="createBy != null">#{createBy},</if>
-            <if test="createTime != null">#{createTime},</if>
-            <if test="updateBy != null">#{updateBy},</if>
-            <if test="updateTime != null">#{updateTime},</if>
-            <if test="delFlag != null">#{delFlag},</if>
-            <if test="companyId != null">#{companyId},</if>
-        </trim>
-    </insert>
-
-    <update id="updateCtLongVideo" parameterType="CtLongVideo">
-        update ct_long_video
-        <trim prefix="SET" suffixOverrides=",">
-            <if test="title != null and title != ''">title = #{title},</if>
-            <if test="groupId != null">group_id = #{groupId},</if>
-            <if test="tags != null">tags = #{tags},</if>
-            <if test="taskType != null">task_type = #{taskType},</if>
-            <if test="authorTypeId != null">author_type_id = #{authorTypeId},</if>
-            <if test="authorId != null">author_id = #{authorId},</if>
-            <if test="isOriginal != null">is_original = #{isOriginal},</if>
-            <if test="coverUrl != null">cover_url = #{coverUrl},</if>
-            <if test="summary != null">summary = #{summary},</if>
-            <if test="videoUrl != null">video_url = #{videoUrl},</if>
-            <if test="status != null">status = #{status},</if>
-            <if test="createBy != null">create_by = #{createBy},</if>
-            <if test="createTime != null">create_time = #{createTime},</if>
-            <if test="updateBy != null">update_by = #{updateBy},</if>
-            <if test="updateTime != null">update_time = #{updateTime},</if>
-            <if test="delFlag != null">del_flag = #{delFlag},</if>
-            <if test="companyId != null">company_id = #{companyId},</if>
-        </trim>
-        where id = #{id}
-    </update>
-
-    <delete id="deleteCtLongVideoById" parameterType="Long">
-        delete from ct_long_video where id = #{id}
-    </delete>
-
-    <delete id="deleteCtLongVideoByIds" parameterType="String">
-        delete from ct_long_video where id in 
-        <foreach item="id" collection="array" open="(" separator="," close=")">
-            #{id}
-        </foreach>
-    </delete>
-</mapper>

+ 0 - 165
fs-service/src/main/resources/mapper/delivery/CtShortVideoMapper.xml

@@ -1,165 +0,0 @@
-<?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.fs.delivery.mapper.CtShortVideoMapper">
-    
-    <resultMap type="CtShortVideo" id="CtShortVideoResult">
-        <result property="id"    column="id"    />
-        <result property="companyId"    column="company_id"    />
-        <result property="companyName" column="companyName"/>
-        <result property="title"    column="title"    />
-        <result property="groupId"    column="group_id"    />
-        <result property="tags"    column="tags"    />
-        <result property="taskType"    column="task_type"    />
-        <result property="authorTypeId"    column="author_type_id"    />
-        <result property="authorId"    column="author_id"    />
-        <result property="authorName" column="authorName"/>
-        <result property="isOriginal"    column="is_original"    />
-        <result property="coverUrl"    column="cover_url"    />
-        <result property="summary"    column="summary"    />
-        <result property="videoUrl"    column="video_url"    />
-        <result property="status"    column="status"    />
-        <result property="createBy"    column="create_by"    />
-        <result property="createTime"    column="create_time"    />
-        <result property="updateBy"    column="update_by"    />
-        <result property="updateTime"    column="update_time"    />
-        <result property="delFlag"    column="del_flag"    />
-    </resultMap>
-
-    <sql id="selectCtShortVideoVo">
-        SELECT
-        v.id,
-        v.company_id,
-        c.company_name AS companyName,
-
-        v.title,
-        v.group_id,
-        v.tags,
-        v.task_type,
-        v.author_type_id,
-        v.author_id,
-
-        -- ✅ 关键:关联讲者表拿到姓名(用于前端回显)
-        d.doctor_name AS authorName,
-
-        v.is_original,
-        v.cover_url,
-        v.summary,
-        v.video_url,
-        v.status,
-        v.create_by,
-        v.create_time,
-        v.update_by,
-        v.update_time,
-        v.del_flag
-        FROM ct_short_video v
-        LEFT JOIN company c ON c.company_id = v.company_id
-
-        -- ✅ author_id 对应 doctor.id(你给的 doctor 表主键就是 id)
-        -- ✅ 同时加 company_id 约束更安全(避免跨公司串数据)
-        LEFT JOIN doctor d ON d.id = v.author_id AND d.company_id = v.company_id
-    </sql>
-
-    <select id="selectCtShortVideoList" parameterType="CtShortVideo" resultMap="CtShortVideoResult">
-        <include refid="selectCtShortVideoVo"/>
-        <where>
-            <if test="companyId != null"> and v.company_id = #{companyId}</if>
-            <if test="title != null and title != ''"> and v.title = #{title}</if>
-            <if test="groupId != null"> and v.group_id = #{groupId}</if>
-            <if test="tags != null and tags != ''"> and v.tags = #{tags}</if>
-            <if test="taskType != null"> and v.task_type = #{taskType}</if>
-            <if test="authorTypeId != null"> and v.author_type_id = #{authorTypeId}</if>
-            <if test="authorId != null"> and v.author_id = #{authorId}</if>
-            <if test="isOriginal != null"> and v.is_original = #{isOriginal}</if>
-            <if test="coverUrl != null and coverUrl != ''"> and v.cover_url = #{coverUrl}</if>
-            <if test="summary != null and summary != ''"> and v.summary = #{summary}</if>
-            <if test="videoUrl != null and videoUrl != ''"> and v.video_url = #{videoUrl}</if>
-            <if test="status != null"> and v.status = #{status}</if>
-        </where>
-        order by v.create_time desc
-    </select>
-
-
-    <select id="selectCtShortVideoById" parameterType="Long" resultMap="CtShortVideoResult">
-        <include refid="selectCtShortVideoVo"/>
-        where v.id = #{id}
-    </select>
-        
-    <insert id="insertCtShortVideo" parameterType="CtShortVideo" useGeneratedKeys="true" keyProperty="id">
-        insert into ct_short_video
-        <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="title != null and title != ''">title,</if>
-            <if test="groupId != null">group_id,</if>
-            <if test="tags != null">tags,</if>
-            <if test="taskType != null">task_type,</if>
-            <if test="authorTypeId != null">author_type_id,</if>
-            <if test="authorId != null">author_id,</if>
-            <if test="isOriginal != null">is_original,</if>
-            <if test="coverUrl != null">cover_url,</if>
-            <if test="summary != null">summary,</if>
-            <if test="videoUrl != null">video_url,</if>
-            <if test="status != null">status,</if>
-            <if test="createBy != null">create_by,</if>
-            <if test="createTime != null">create_time,</if>
-            <if test="updateBy != null">update_by,</if>
-            <if test="updateTime != null">update_time,</if>
-            <if test="delFlag != null">del_flag,</if>
-            <if test="companyId != null">company_id,</if>
-         </trim>
-        <trim prefix="values (" suffix=")" suffixOverrides=",">
-            <if test="title != null and title != ''">#{title},</if>
-            <if test="groupId != null">#{groupId},</if>
-            <if test="tags != null">#{tags},</if>
-            <if test="taskType != null">#{taskType},</if>
-            <if test="authorTypeId != null">#{authorTypeId},</if>
-            <if test="authorId != null">#{authorId},</if>
-            <if test="isOriginal != null">#{isOriginal},</if>
-            <if test="coverUrl != null">#{coverUrl},</if>
-            <if test="summary != null">#{summary},</if>
-            <if test="videoUrl != null">#{videoUrl},</if>
-            <if test="status != null">#{status},</if>
-            <if test="createBy != null">#{createBy},</if>
-            <if test="createTime != null">#{createTime},</if>
-            <if test="updateBy != null">#{updateBy},</if>
-            <if test="updateTime != null">#{updateTime},</if>
-            <if test="delFlag != null">#{delFlag},</if>
-            <if test="companyId != null">#{companyId},</if>
-         </trim>
-    </insert>
-
-    <update id="updateCtShortVideo" parameterType="CtShortVideo">
-        update ct_short_video
-        <trim prefix="SET" suffixOverrides=",">
-            <if test="title != null and title != ''">title = #{title},</if>
-            <if test="groupId != null">group_id = #{groupId},</if>
-            <if test="tags != null">tags = #{tags},</if>
-            <if test="taskType != null">task_type = #{taskType},</if>
-            <if test="authorTypeId != null">author_type_id = #{authorTypeId},</if>
-            <if test="authorId != null">author_id = #{authorId},</if>
-            <if test="isOriginal != null">is_original = #{isOriginal},</if>
-            <if test="coverUrl != null">cover_url = #{coverUrl},</if>
-            <if test="summary != null">summary = #{summary},</if>
-            <if test="videoUrl != null">video_url = #{videoUrl},</if>
-            <if test="status != null">status = #{status},</if>
-            <if test="createBy != null">create_by = #{createBy},</if>
-            <if test="createTime != null">create_time = #{createTime},</if>
-            <if test="updateBy != null">update_by = #{updateBy},</if>
-            <if test="updateTime != null">update_time = #{updateTime},</if>
-            <if test="delFlag != null">del_flag = #{delFlag},</if>
-            <if test="companyId != null">company_id = #{companyId},</if>
-        </trim>
-        where id = #{id}
-    </update>
-
-    <delete id="deleteCtShortVideoById" parameterType="Long">
-        delete from ct_short_video where id = #{id}
-    </delete>
-
-    <delete id="deleteCtShortVideoByIds" parameterType="String">
-        delete from ct_short_video where id in 
-        <foreach item="id" collection="array" open="(" separator="," close=")">
-            #{id}
-        </foreach>
-    </delete>
-</mapper>

+ 0 - 116
fs-service/src/main/resources/mapper/delivery/TagGroupMapper.xml

@@ -1,116 +0,0 @@
-<?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.fs.delivery.mapper.TagGroupMapper">
-    
-    <resultMap type="TagGroup" id="TagGroupResult">
-        <result property="id"    column="id"    />
-        <result property="companyId"    column="company_id"    />
-        <result property="companyName" column="companyName" />
-        <result property="name"    column="name"    />
-        <result property="sort"    column="sort"    />
-        <result property="status"    column="status"    />
-        <result property="type"    column="type"    />
-        <result property="createTime"    column="create_time"    />
-        <result property="updateTime"    column="update_time"    />
-        <result property="createBy"    column="create_by"    />
-        <result property="updateBy"    column="update_by"    />
-        <result property="deleted"    column="deleted"    />
-    </resultMap>
-
-    <sql id="selectTagGroupVo">
-        select
-        tg.id,
-        tg.company_id,
-        c.company_name as companyName,
-        tg.name,
-        tg.sort,
-        tg.status,
-        tg.type,
-        tg.create_time,
-        tg.update_time,
-        tg.create_by,
-        tg.update_by,
-        tg.deleted
-        from tag_group tg
-        left join company c
-        on c.company_id = tg.company_id
-        and c.is_del = 0
-    </sql>
-
-
-    <select id="selectTagGroupList" parameterType="TagGroup" resultMap="TagGroupResult">
-        <include refid="selectTagGroupVo"/>
-        <where>
-            <if test="companyId != null"> and tg.company_id = #{companyId}</if>
-            <if test="name != null and name != ''"> and tg.name like concat('%', #{name}, '%')</if>
-            <if test="sort != null"> and tg.sort = #{sort}</if>
-            <if test="status != null"> and tg.status = #{status}</if>
-            <if test="type != null"> and tg.type = #{type}</if>
-            <if test="deleted != null"> and tg.deleted = #{deleted}</if>
-        </where>
-        order by tg.sort, tg.create_time desc
-    </select>
-    
-    <select id="selectTagGroupById" parameterType="Long" resultMap="TagGroupResult">
-        <include refid="selectTagGroupVo"/>
-        where tg.id = #{id}
-    </select>
-        
-    <insert id="insertTagGroup" parameterType="TagGroup" useGeneratedKeys="true" keyProperty="id">
-        insert into tag_group
-        <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="companyId != null">company_id,</if>
-            <if test="name != null and name != ''">name,</if>
-            <if test="sort != null">sort,</if>
-            <if test="status != null">status,</if>
-            <if test="type != null">type,</if>
-            <if test="createTime != null">create_time,</if>
-            <if test="updateTime != null">update_time,</if>
-            <if test="createBy != null">create_by,</if>
-            <if test="updateBy != null">update_by,</if>
-            <if test="deleted != null">deleted,</if>
-         </trim>
-        <trim prefix="values (" suffix=")" suffixOverrides=",">
-            <if test="companyId != null">#{companyId},</if>
-            <if test="name != null and name != ''">#{name},</if>
-            <if test="sort != null">#{sort},</if>
-            <if test="status != null">#{status},</if>
-            <if test="type != null">#{type},</if>
-            <if test="createTime != null">#{createTime},</if>
-            <if test="updateTime != null">#{updateTime},</if>
-            <if test="createBy != null">#{createBy},</if>
-            <if test="updateBy != null">#{updateBy},</if>
-            <if test="deleted != null">#{deleted},</if>
-         </trim>
-    </insert>
-
-    <update id="updateTagGroup" parameterType="TagGroup">
-        update tag_group
-        <trim prefix="SET" suffixOverrides=",">
-            <if test="companyId != null">company_id = #{companyId},</if>
-            <if test="name != null and name != ''">name = #{name},</if>
-            <if test="sort != null">sort = #{sort},</if>
-            <if test="status != null">status = #{status},</if>
-            <if test="type != null">type = #{type},</if>
-            <if test="createTime != null">create_time = #{createTime},</if>
-            <if test="updateTime != null">update_time = #{updateTime},</if>
-            <if test="createBy != null">create_by = #{createBy},</if>
-            <if test="updateBy != null">update_by = #{updateBy},</if>
-            <if test="deleted != null">deleted = #{deleted},</if>
-        </trim>
-        where id = #{id}
-    </update>
-
-    <delete id="deleteTagGroupById" parameterType="Long">
-        delete from tag_group where id = #{id}
-    </delete>
-
-    <delete id="deleteTagGroupByIds" parameterType="String">
-        delete from tag_group where id in 
-        <foreach item="id" collection="array" open="(" separator="," close=")">
-            #{id}
-        </foreach>
-    </delete>
-</mapper>

+ 0 - 147
fs-service/src/main/resources/mapper/delivery/TagMapper.xml

@@ -1,147 +0,0 @@
-<?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.fs.delivery.mapper.TagMapper">
-
-    <resultMap type="Tag" id="TagResult">
-        <result property="id"        column="id"/>
-        <result property="companyId" column="company_id"/>
-        <result property="companyName" column="companyName"/>
-        <result property="groupId"   column="group_id"/>
-        <result property="groupName" column="groupName"/>
-        <result property="type"      column="type"/>
-        <result property="name"      column="name"/>
-        <result property="sort"      column="sort"/>
-        <result property="status"    column="status"/>
-        <result property="createTime" column="create_time"/>
-        <result property="updateTime" column="update_time"/>
-        <result property="createBy"  column="create_by"/>
-        <result property="updateBy"  column="update_by"/>
-        <result property="deleted"   column="deleted"/>
-    </resultMap>
-
-    <sql id="selectTagVo">
-        select
-        t.id,
-        t.company_id,
-        c.company_name as companyName,
-        t.group_id,
-        g.name as groupName,
-        t.type,
-        t.name,
-        t.sort,
-        t.status,
-        t.create_time,
-        t.update_time,
-        t.create_by,
-        t.update_by,
-        t.deleted
-        from tag t
-        left join company c
-        on c.company_id = t.company_id
-        and c.is_del = 0
-        left join tag_group g
-        on g.id = t.group_id
-        and g.deleted = 0
-
-    </sql>
-
-    <select id="selectTagList" parameterType="Tag" resultMap="TagResult">
-        <include refid="selectTagVo"/>
-        <where>
-            <if test="companyId != null">
-                and t.company_id = #{companyId}
-            </if>
-            <if test="groupId != null">
-                and t.group_id = #{groupId}
-            </if>
-            <if test="type != null and type != ''">
-                and t.type = #{type}
-            </if>
-            <if test="name != null and name != ''">
-                and t.name like concat('%', #{name}, '%')
-            </if>
-            <if test="sort != null">
-                and t.sort = #{sort}
-            </if>
-            <if test="status != null ">
-                and t.status = #{status}
-            </if>
-                and t.deleted = 0
-        </where>
-        order by t.id desc
-    </select>
-
-
-
-    <select id="selectTagById" parameterType="Long" resultMap="TagResult">
-        <include refid="selectTagVo"/>
-        where t.id = #{id}
-    </select>
-    <select id="selectTagByIds" resultType="com.fs.delivery.domain.Tag">
-        select * from tag where id in
-        <foreach item="id" collection="ids.split(',')" open="(" separator="," close=")">
-            #{id}
-        </foreach>
-    </select>
-
-    <insert id="insertTag" parameterType="Tag" useGeneratedKeys="true" keyProperty="id">
-        insert into tag
-        <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="companyId != null">company_id,</if>
-            <if test="groupId != null">group_id,</if>
-            <if test="type != null">type,</if>
-            <if test="name != null and name != ''">name,</if>
-            <if test="sort != null">sort,</if>
-            <if test="status != null">status,</if>
-            <if test="createTime != null">create_time,</if>
-            <if test="updateTime != null">update_time,</if>
-            <if test="createBy != null">create_by,</if>
-            <if test="updateBy != null">update_by,</if>
-            <if test="deleted != null">deleted,</if>
-         </trim>
-        <trim prefix="values (" suffix=")" suffixOverrides=",">
-            <if test="companyId != null">#{companyId},</if>
-            <if test="groupId != null">#{groupId},</if>
-            <if test="type != null">#{type},</if>
-            <if test="name != null and name != ''">#{name},</if>
-            <if test="sort != null">#{sort},</if>
-            <if test="status != null">#{status},</if>
-            <if test="createTime != null">#{createTime},</if>
-            <if test="updateTime != null">#{updateTime},</if>
-            <if test="createBy != null">#{createBy},</if>
-            <if test="updateBy != null">#{updateBy},</if>
-            <if test="deleted != null">#{deleted},</if>
-         </trim>
-    </insert>
-
-    <update id="updateTag" parameterType="Tag">
-        update tag
-        <trim prefix="SET" suffixOverrides=",">
-            <if test="companyId != null">company_id = #{companyId},</if>
-            <if test="groupId != null">group_id = #{groupId},</if>
-            <if test="type != null">type = #{type},</if>
-            <if test="name != null and name != ''">name = #{name},</if>
-            <if test="sort != null">sort = #{sort},</if>
-            <if test="status != null">status = #{status},</if>
-            <if test="createTime != null">create_time = #{createTime},</if>
-            <if test="updateTime != null">update_time = #{updateTime},</if>
-            <if test="createBy != null">create_by = #{createBy},</if>
-            <if test="updateBy != null">update_by = #{updateBy},</if>
-            <if test="deleted != null">deleted = #{deleted},</if>
-        </trim>
-        where id = #{id}
-    </update>
-
-    <delete id="deleteTagById" parameterType="Long">
-        delete from tag where id = #{id}
-    </delete>
-
-    <delete id="deleteTagByIds" parameterType="String">
-        delete from tag where id in 
-        <foreach item="id" collection="array" open="(" separator="," close=")">
-            #{id}
-        </foreach>
-    </delete>
-</mapper>

+ 0 - 137
fs-service/src/main/resources/mapper/doctor/DoctorBalanceLogMapper.xml

@@ -1,137 +0,0 @@
-<?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.fs.doctor.mapper.DoctorBalanceLogMapper">
-    
-    <resultMap type="DoctorBalanceLog" id="DoctorBalanceLogResult">
-        <result property="id"    column="id"    />
-        <result property="doctorId"    column="doctor_id"    />
-        <result property="doctorName"    column="doctor_name"    />
-        <result property="changeMoney"    column="change_money"    />
-        <result property="changeType"    column="change_type"    />
-        <result property="relatedTaskId"    column="related_task_id"    />
-        <result property="changeReason"    column="change_reason"    />
-        <result property="createBy"    column="create_by"    />
-        <result property="updateBy"    column="update_by"    />
-        <result property="updateAt"    column="update_at"    />
-        <result property="createAt"    column="create_at"    />
-        <result property="companyId"    column="company_id"    />
-        <result property="companyName" column="company_name"/>
-        <result property="businessId"   column="business_id" />
-        <result property="businessType" column="business_type" />
-    </resultMap>
-
-    <sql id="selectDoctorBalanceLogVo">
-        select
-        t.id,
-        t.company_id,
-        c.company_name,
-        t.business_id,
-        t.business_type,
-        t.doctor_id,
-        t.doctor_name,
-        t.change_money,
-        t.change_type,
-        t.related_task_id,
-        t.change_reason,
-        t.create_by,
-        t.update_by,
-        t.update_at,
-        t.create_at
-        from doctor_balance_log t
-        left join company c on c.company_id = t.company_id
-    </sql>
-
-    <select id="selectDoctorBalanceLogList" parameterType="DoctorBalanceLog" resultMap="DoctorBalanceLogResult">
-        <include refid="selectDoctorBalanceLogVo"/>
-        <where>
-            <if test="doctorId != null and doctorId != ''"> and t.doctor_id = #{doctorId}</if>
-            <if test="doctorName != null and doctorName != ''"> and t.doctor_name like concat('%', #{doctorName}, '%')</if>
-            <if test="changeMoney != null"> and t.change_money = #{changeMoney}</if>
-            <if test="changeType != null"> and t.change_type = #{changeType}</if>
-            <if test="relatedTaskId != null and relatedTaskId != ''"> and t.related_task_id = #{relatedTaskId}</if>
-            <if test="changeReason != null and changeReason != ''"> and t.change_reason = #{changeReason}</if>
-            <if test="updateAt != null"> and t.update_at = #{updateAt}</if>
-            <if test="createAt != null"> and t.create_at = #{createAt}</if>
-            <if test="companyId != null"> and t.company_id = #{companyId}</if>
-            <if test="businessType != null"> and t.business_type = #{businessType}</if>
-
-            <!-- 可选:按公司名模糊查(如果你前端以后要加) -->
-            <!-- <if test="companyName != null and companyName != ''"> and c.company_name like concat('%', #{companyName}, '%')</if> -->
-        </where>
-        order by t.id desc
-
-    </select>
-
-
-    <select id="selectDoctorBalanceLogById" parameterType="String" resultMap="DoctorBalanceLogResult">
-        <include refid="selectDoctorBalanceLogVo"/>
-        where t.id = #{id}
-    </select>
-        
-    <insert id="insertDoctorBalanceLog" parameterType="DoctorBalanceLog" useGeneratedKeys="true" keyProperty="id">
-        insert into doctor_balance_log
-        <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="doctorId != null and doctorId != ''">doctor_id,</if>
-            <if test="doctorName != null and doctorName != ''">doctor_name,</if>
-            <if test="changeMoney != null">change_money,</if>
-            <if test="changeType != null">change_type,</if>
-            <if test="relatedTaskId != null">related_task_id,</if>
-            <if test="changeReason != null">change_reason,</if>
-            <if test="createBy != null">create_by,</if>
-            <if test="updateBy != null">update_by,</if>
-            <if test="updateAt != null">update_at,</if>
-            <if test="createAt != null">create_at,</if>
-            <if test="companyId != null">company_id,</if>
-            <if test="businessId != null">business_id,</if>
-            <if test="businessType != null">business_type,</if>
-        </trim>
-        <trim prefix="values (" suffix=")" suffixOverrides=",">
-            <if test="doctorId != null and doctorId != ''">#{doctorId},</if>
-            <if test="doctorName != null and doctorName != ''">#{doctorName},</if>
-            <if test="changeMoney != null">#{changeMoney},</if>
-            <if test="changeType != null">#{changeType},</if>
-            <if test="relatedTaskId != null">#{relatedTaskId},</if>
-            <if test="changeReason != null">#{changeReason},</if>
-            <if test="createBy != null">#{createBy},</if>
-            <if test="updateBy != null">#{updateBy},</if>
-            <if test="updateAt != null">#{updateAt},</if>
-            <if test="createAt != null">#{createAt},</if>
-            <if test="companyId != null">#{companyId},</if>
-            <if test="businessId != null">#{businessId},</if>
-            <if test="businessType != null">#{businessType},</if>
-         </trim>
-    </insert>
-
-    <update id="updateDoctorBalanceLog" parameterType="DoctorBalanceLog">
-        update doctor_balance_log
-        <trim prefix="SET" suffixOverrides=",">
-            <if test="doctorId != null and doctorId != ''">doctor_id = #{doctorId},</if>
-            <if test="doctorName != null and doctorName != ''">doctor_name = #{doctorName},</if>
-            <if test="changeMoney != null">change_money = #{changeMoney},</if>
-            <if test="changeType != null">change_type = #{changeType},</if>
-            <if test="relatedTaskId != null">related_task_id = #{relatedTaskId},</if>
-            <if test="changeReason != null">change_reason = #{changeReason},</if>
-            <if test="createBy != null">create_by = #{createBy},</if>
-            <if test="updateBy != null">update_by = #{updateBy},</if>
-            <if test="updateAt != null">update_at = #{updateAt},</if>
-            <if test="createAt != null">create_at = #{createAt},</if>
-            <if test="companyId != null">company_id = #{companyId},</if>
-            <if test="businessId != null">business_id = #{businessId},</if>
-            <if test="businessType != null">business_type = #{businessType},</if>
-        </trim>
-        where id = #{id}
-    </update>
-
-    <delete id="deleteDoctorBalanceLogById" parameterType="String">
-        delete from doctor_balance_log where id = #{id}
-    </delete>
-
-    <delete id="deleteDoctorBalanceLogByIds" parameterType="String">
-        delete from doctor_balance_log where id in 
-        <foreach item="id" collection="array" open="(" separator="," close=")">
-            #{id}
-        </foreach>
-    </delete>
-</mapper>

+ 0 - 220
fs-service/src/main/resources/mapper/doctor/DoctorCompanyUserMapper.xml

@@ -1,220 +0,0 @@
-<?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.fs.doctor.mapper.DoctorCompanyUserMapper">
-    
-    <resultMap type="DoctorCompanyUser" id="DoctorCompanyUserResult">
-        <result property="id"    column="id"    />
-        <result property="doctorId"    column="doctor_id"    />
-        <result property="companyUserId"    column="company_user_id"    />
-        <result property="companyUserName"    column="company_user_name"    />
-        <result property="companyId"    column="company_id"    />
-        <result property="product"    column="product"    />
-        <result property="bindtime"    column="bindtime"    />
-        <result property="createTime"    column="create_time"    />
-        <result property="updateTime"    column="update_time"    />
-        <result property="deleted"    column="deleted"    />
-    </resultMap>
-
-    <sql id="selectDoctorCompanyUserVo">
-        select id, doctor_id, company_user_id, company_user_name, company_id, product, bindtime, create_time, update_time, deleted from doctor_company_user
-    </sql>
-
-    <select id="selectDoctorCompanyUserList" parameterType="DoctorCompanyUser" resultMap="DoctorCompanyUserResult">
-        <include refid="selectDoctorCompanyUserVo"/>
-        <where>  
-            <if test="doctorId != null  and doctorId != ''"> and doctor_id = #{doctorId}</if>
-            <if test="companyUserId != null  and companyUserId != ''"> and company_user_id = #{companyUserId}</if>
-            <if test="companyUserName != null  and companyUserName != ''"> and company_user_name like concat('%', #{companyUserName}, '%')</if>
-            <if test="companyId != null "> and company_id = #{companyId}</if>
-            <if test="product != null  and product != ''"> and product = #{product}</if>
-            <if test="bindtime != null "> and bindtime = #{bindtime}</if>
-            <if test="deleted != null "> and deleted = #{deleted}</if>
-        </where>
-        order by create_time desc
-
-    </select>
-    
-    <select id="selectDoctorCompanyUserById" parameterType="Long" resultMap="DoctorCompanyUserResult">
-        <include refid="selectDoctorCompanyUserVo"/>
-        where id = #{id}
-    </select>
-        
-    <insert id="insertDoctorCompanyUser" parameterType="DoctorCompanyUser" useGeneratedKeys="true" keyProperty="id">
-        insert into doctor_company_user
-        <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="doctorId != null and doctorId != ''">doctor_id,</if>
-            <if test="companyUserId != null and companyUserId != ''">company_user_id,</if>
-            <if test="companyUserName != null">company_user_name,</if>
-            <if test="companyId != null">company_id,</if>
-            <if test="product != null">product,</if>
-            <if test="bindtime != null">bindtime,</if>
-            <if test="createTime != null">create_time,</if>
-            <if test="updateTime != null">update_time,</if>
-            <if test="deleted != null">deleted,</if>
-         </trim>
-        <trim prefix="values (" suffix=")" suffixOverrides=",">
-            <if test="doctorId != null and doctorId != ''">#{doctorId},</if>
-            <if test="companyUserId != null and companyUserId != ''">#{companyUserId},</if>
-            <if test="companyUserName != null">#{companyUserName},</if>
-            <if test="companyId != null">#{companyId},</if>
-            <if test="product != null">#{product},</if>
-            <if test="bindtime != null">#{bindtime},</if>
-            <if test="createTime != null">#{createTime},</if>
-            <if test="updateTime != null">#{updateTime},</if>
-            <if test="deleted != null">#{deleted},</if>
-         </trim>
-    </insert>
-
-    <update id="updateDoctorCompanyUser" parameterType="DoctorCompanyUser">
-        update doctor_company_user
-        <trim prefix="SET" suffixOverrides=",">
-            <if test="doctorId != null and doctorId != ''">doctor_id = #{doctorId},</if>
-            <if test="companyUserId != null and companyUserId != ''">company_user_id = #{companyUserId},</if>
-            <if test="companyUserName != null">company_user_name = #{companyUserName},</if>
-            <if test="companyId != null">company_id = #{companyId},</if>
-            <if test="product != null">product = #{product},</if>
-            <if test="bindtime != null">bindtime = #{bindtime},</if>
-            <if test="createTime != null">create_time = #{createTime},</if>
-            <if test="updateTime != null">update_time = #{updateTime},</if>
-            <if test="deleted != null">deleted = #{deleted},</if>
-        </trim>
-        where id = #{id}
-    </update>
-
-    <delete id="deleteDoctorCompanyUserById" parameterType="Long">
-        delete from doctor_company_user where id = #{id}
-    </delete>
-
-    <delete id="deleteDoctorCompanyUserByIds" parameterType="String">
-        delete from doctor_company_user where id in 
-        <foreach item="id" collection="array" open="(" separator="," close=")">
-            #{id}
-        </foreach>
-    </delete>
-
-
-    <select id="queryProductGroup"
-            resultType="com.fs.doctor.domain.DoctorCompanyUser">
-        select
-        id,
-        doctor_id,
-        company_user_id,
-        company_user_name,
-        company_id,
-        product,
-        bindtime,
-        create_time,
-        update_time,
-        deleted
-        from doctor_company_user
-        where deleted = 0
-        and company_id = #{companyId}
-        and doctor_id = #{doctorId}
-    </select>
-
-
-    <select id="selectCompanyProductByProductCodes" resultType="com.fs.company.domain.CompanyProduct">
-        select
-        id,
-        company_id,
-        product_code,
-        product_name,
-        status,
-        sort,
-        create_time,
-        update_time,
-        del_flag,
-        remark
-        from company_product
-        <where>
-            del_flag = 0
-            <if test="codes != null and codes.size() > 0">
-                and product_code in
-                <foreach collection="codes" item="code" open="(" separator="," close=")">
-                    #{code}
-                </foreach>
-            </if>
-            <if test="codes == null or codes.size() == 0">
-                and 1 = 0
-            </if>
-        </where>
-        order by sort asc, id asc
-    </select>
-
-
-    <select id="selectDoctorOptionsByCompanyUser"
-            resultType="com.fs.doctor.vo.DoctorAndCompanyUserInfoVO">
-        SELECT
-        d.id      AS doctorId,
-        d.doctor_name    AS doctorName,
-        d.mobile         AS mobile,
-        d.institution    AS institution,
-        d.department     AS department,
-        d.job_title      AS jobTitle
-        FROM doctor_company_user rel
-        INNER JOIN doctor d
-        ON d.doctor_id = rel.doctor_id
-        AND d.deleted = 0
-        AND d.status = 1
-        WHERE rel.deleted = 0
-        AND rel.company_id = #{companyId}
-        AND rel.company_user_id = #{companyUserId}
-
-        <!-- ✅ productCode 过滤:rel.product 是逗号分割字符串 -->
-        <if test="productCode != null and productCode != ''">
-            AND rel.product IS NOT NULL
-            AND rel.product &lt;&gt; ''
-            AND FIND_IN_SET(#{productCode}, REPLACE(rel.product,' ','')) &gt; 0
-        </if>
-
-        <if test="keyword != null and keyword != ''">
-            AND (
-            d.doctor_name LIKE CONCAT('%', #{keyword}, '%')
-            OR d.mobile LIKE CONCAT('%', #{keyword}, '%')
-            )
-        </if>
-
-        ORDER BY rel.update_time DESC
-        LIMIT 20
-    </select>
-
-
-
-    <select id="getProductOptionsByCompanyUser"
-            resultType="com.fs.doctor.vo.CompanyProductOptionVO">
-        SELECT
-        cp.id           AS id,
-        cp.product_code AS productCode,
-        cp.product_name AS productName
-        FROM company_product cp
-        WHERE cp.del_flag = 0
-        AND cp.status = 1
-        AND cp.company_id = #{companyId}
-        AND EXISTS (
-        SELECT 1
-        FROM doctor_company_user dcu
-        WHERE dcu.deleted = 0
-        AND dcu.company_id = #{companyId}
-        AND dcu.company_user_id = #{companyUserId}
-        AND dcu.product IS NOT NULL
-        AND <![CDATA[
-                dcu.product <> ''
-            ]]>
-        AND FIND_IN_SET(cp.product_code, REPLACE(dcu.product, ' ', '')) > 0
-        )
-        <if test="keyword != null and keyword != ''">
-            AND (
-            cp.product_name LIKE CONCAT('%', #{keyword}, '%')
-            OR cp.product_code LIKE CONCAT('%', #{keyword}, '%')
-            )
-        </if>
-        ORDER BY cp.sort ASC, cp.update_time DESC
-        LIMIT 50
-    </select>
-
-
-
-
-</mapper>

+ 0 - 172
fs-service/src/main/resources/mapper/doctor/DoctorLevelApplyMapper.xml

@@ -1,172 +0,0 @@
-<?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.fs.doctor.mapper.DoctorLevelApplyMapper">
-    
-    <resultMap type="DoctorLevelApply" id="DoctorLevelApplyResult">
-        <result property="id"    column="id"    />
-        <result property="doctorId"    column="doctor_id"    />
-        <result property="doctorName"              column="doctor_name" />
-        <result property="companyId"    column="company_id"    />
-        <result property="companyName"    column="company_name"    />
-        <result property="academicTitle"    column="academic_title"    />
-        <result property="academicPosition"    column="academic_position"    />
-        <result property="internationalPapers"    column="international_papers"    />
-        <result property="nationalPapers"    column="national_papers"    />
-        <result property="academicResearch"    column="academic_research"    />
-        <result property="clinicalExperienceYears"    column="clinical_experience_years"    />
-        <result property="degree"    column="degree"    />
-        <result property="applyLevel"    column="apply_level"    />
-        <result property="status"    column="status"    />
-        <result property="createTime"    column="create_time"    />
-        <result property="updateTime"    column="update_time"    />
-        <result property="deleted"    column="deleted"    />
-        <result property="auditInstanceId"    column="audit_instance_id"    />
-        <result property="formId"            column="form_id" />   <!-- ✅ 新增 -->
-
-    </resultMap>
-    <sql id="selectDoctorLevelApplyVo">
-        select
-        a.id,
-        a.doctor_id,
-        d.doctor_name        as doctor_name,
-        a.audit_instance_id,
-        a.company_id,
-        c.company_name       as company_name,
-        a.academic_title,
-        a.academic_position,
-        a.international_papers,
-        a.national_papers,
-        a.academic_research,
-        a.clinical_experience_years,
-        a.degree,
-        a.apply_level,
-        a.status,
-        a.create_time,
-        a.update_time,
-        a.form_id,                    -- ✅ 新增
-        a.deleted
-        from doctor_level_apply a
-        left join company c
-        on c.company_id = a.company_id
-        left join doctor d
-        on d.doctor_id = a.doctor_id
-    </sql>
-
-
-
-    <select id="selectDoctorLevelApplyList" parameterType="DoctorLevelApply" resultMap="DoctorLevelApplyResult">
-        <include refid="selectDoctorLevelApplyVo"/>
-        <where>
-            <if test="doctorId != null and doctorId != ''"> and a.doctor_id = #{doctorId}</if>
-            <if test="companyId != null"> and a.company_id = #{companyId}</if>
-            <if test="academicTitle != null and academicTitle != ''"> and a.academic_title = #{academicTitle}</if>
-            <if test="academicPosition != null and academicPosition != ''"> and a.academic_position = #{academicPosition}</if>
-            <if test="internationalPapers != null"> and a.international_papers = #{internationalPapers}</if>
-            <if test="nationalPapers != null"> and a.national_papers = #{nationalPapers}</if>
-            <if test="academicResearch != null and academicResearch != ''"> and a.academic_research = #{academicResearch}</if>
-            <if test="clinicalExperienceYears != null"> and a.clinical_experience_years = #{clinicalExperienceYears}</if>
-            <if test="degree != null and degree != ''"> and a.degree = #{degree}</if>
-            <if test="applyLevel != null and applyLevel != ''"> and a.apply_level = #{applyLevel}</if>
-            <if test="status != null"> and a.status = #{status}</if>
-            <if test="deleted != null"> and a.deleted = #{deleted}</if>
-        </where>
-        order by a.create_time desc
-
-    </select>
-
-    <select id="selectDoctorLevelApplyById" parameterType="Long" resultMap="DoctorLevelApplyResult">
-        <include refid="selectDoctorLevelApplyVo"/>
-        where a.id = #{id}
-    </select>
-        
-    <insert id="insertDoctorLevelApply" parameterType="DoctorLevelApply" useGeneratedKeys="true" keyProperty="id">
-        insert into doctor_level_apply
-        <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="doctorId != null and doctorId != ''">doctor_id,</if>
-            <if test="companyId != null">company_id,</if>
-            <if test="academicTitle != null">academic_title,</if>
-            <if test="academicPosition != null">academic_position,</if>
-            <if test="internationalPapers != null">international_papers,</if>
-            <if test="nationalPapers != null">national_papers,</if>
-            <if test="academicResearch != null">academic_research,</if>
-            <if test="clinicalExperienceYears != null">clinical_experience_years,</if>
-            <if test="degree != null">degree,</if>
-            <if test="applyLevel != null">apply_level,</if>
-            <if test="status != null">status,</if>
-            <if test="createTime != null">create_time,</if>
-            <if test="updateTime != null">update_time,</if>
-            <if test="deleted != null">deleted,</if>
-            <if test="auditInstanceId != null">audit_instance_id,</if>
-            <if test="formId != null">form_id,</if>          <!-- ✅ 新增 -->
-
-        </trim>
-        <trim prefix="values (" suffix=")" suffixOverrides=",">
-            <if test="doctorId != null and doctorId != ''">#{doctorId},</if>
-            <if test="companyId != null">#{companyId},</if>
-            <if test="academicTitle != null">#{academicTitle},</if>
-            <if test="academicPosition != null">#{academicPosition},</if>
-            <if test="internationalPapers != null">#{internationalPapers},</if>
-            <if test="nationalPapers != null">#{nationalPapers},</if>
-            <if test="academicResearch != null">#{academicResearch},</if>
-            <if test="clinicalExperienceYears != null">#{clinicalExperienceYears},</if>
-            <if test="degree != null">#{degree},</if>
-            <if test="applyLevel != null">#{applyLevel},</if>
-            <if test="status != null">#{status},</if>
-            <if test="createTime != null">#{createTime},</if>
-            <if test="updateTime != null">#{updateTime},</if>
-            <if test="deleted != null">#{deleted},</if>
-            <if test="auditInstanceId != null">#{auditInstanceId},</if>
-            <if test="formId != null">#{formId},</if>        <!-- ✅ 新增 -->
-        </trim>
-    </insert>
-
-    <update id="updateDoctorLevelApply" parameterType="DoctorLevelApply">
-        update doctor_level_apply
-        <trim prefix="SET" suffixOverrides=",">
-            <if test="doctorId != null and doctorId != ''">doctor_id = #{doctorId},</if>
-            <if test="companyId != null">company_id = #{companyId},</if>
-            <if test="academicTitle != null">academic_title = #{academicTitle},</if>
-            <if test="academicPosition != null">academic_position = #{academicPosition},</if>
-            <if test="internationalPapers != null">international_papers = #{internationalPapers},</if>
-            <if test="nationalPapers != null">national_papers = #{nationalPapers},</if>
-            <if test="academicResearch != null">academic_research = #{academicResearch},</if>
-            <if test="clinicalExperienceYears != null">clinical_experience_years = #{clinicalExperienceYears},</if>
-            <if test="degree != null">degree = #{degree},</if>
-            <if test="applyLevel != null">apply_level = #{applyLevel},</if>
-            <if test="status != null">status = #{status},</if>
-            <if test="createTime != null">create_time = #{createTime},</if>
-            <if test="updateTime != null">update_time = #{updateTime},</if>
-            <if test="deleted != null">deleted = #{deleted},</if>
-            <if test="auditInstanceId != null">audit_instance_id = #{auditInstanceId},</if>
-            <if test="formId != null">form_id = #{formId},</if>   <!-- ✅ 新增 -->
-
-        </trim>
-        where id = #{id}
-    </update>
-
-    <delete id="deleteDoctorLevelApplyById" parameterType="Long">
-        delete from doctor_level_apply where id = #{id}
-    </delete>
-
-    <delete id="deleteDoctorLevelApplyByIds" parameterType="String">
-        delete from doctor_level_apply where id in 
-        <foreach item="id" collection="array" open="(" separator="," close=")">
-            #{id}
-        </foreach>
-    </delete>
-
-    <!-- 在 DoctorLevelApplyMapper.xml 中 -->
-    <select id="checkPendingApplyCount" resultType="java.lang.Long">
-        SELECT COUNT(*)
-        FROM doctor_level_apply
-        WHERE doctor_id = #{doctorId}
-        AND status = 0
-        AND deleted = 0
-    </select>
-
-
-
-
-</mapper>

+ 0 - 78
fs-service/src/main/resources/mapper/doctor/DoctorLevelDataMapper.xml

@@ -1,78 +0,0 @@
-<?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.fs.doctor.mapper.DoctorLevelDataMapper">
-    
-    <resultMap type="DoctorLevelData" id="DoctorLevelDataResult">
-        <result property="id"    column="id"    />
-        <result property="levelName"    column="level_name"    />
-        <result property="sort"    column="sort"    />
-        <result property="companyId"    column="company_id"    />
-        <result property="createTime"    column="create_time"    />
-        <result property="updateTime"    column="update_time"    />
-        <result property="companyName"    column="company_name"    />
-    </resultMap>
-
-    <sql id="selectDoctorLevelDataVo">
-        select d.id, d.level_name, d.sort, d.company_id, d.create_time, d.update_time,
-        c.company_name
-        from doctor_level_data d
-        left join company c on d.company_id = c.company_id
-    </sql>
-
-    <select id="selectDoctorLevelDataList" parameterType="DoctorLevelData" resultMap="DoctorLevelDataResult">
-        <include refid="selectDoctorLevelDataVo"/>
-        <where>
-            <if test="levelName != null and levelName != ''"> and d.level_name like concat('%', #{levelName}, '%')</if>
-            <if test="sort != null"> and d.sort = #{sort}</if>
-            <if test="companyId != null"> and d.company_id = #{companyId}</if>
-        </where>
-    </select>
-    
-    <select id="selectDoctorLevelDataById" parameterType="Long" resultMap="DoctorLevelDataResult">
-        <include refid="selectDoctorLevelDataVo"/>
-        where d.id = #{id}
-    </select>
-        
-    <insert id="insertDoctorLevelData" parameterType="DoctorLevelData" useGeneratedKeys="true" keyProperty="id">
-        insert into doctor_level_data
-        <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="levelName != null and levelName != ''">level_name,</if>
-            <if test="sort != null">sort,</if>
-            <if test="companyId != null">company_id,</if>
-            <if test="createTime != null">create_time,</if>
-            <if test="updateTime != null">update_time,</if>
-         </trim>
-        <trim prefix="values (" suffix=")" suffixOverrides=",">
-            <if test="levelName != null and levelName != ''">#{levelName},</if>
-            <if test="sort != null">#{sort},</if>
-            <if test="companyId != null">#{companyId},</if>
-            <if test="createTime != null">#{createTime},</if>
-            <if test="updateTime != null">#{updateTime},</if>
-         </trim>
-    </insert>
-
-    <update id="updateDoctorLevelData" parameterType="DoctorLevelData">
-        update doctor_level_data
-        <trim prefix="SET" suffixOverrides=",">
-            <if test="levelName != null and levelName != ''">level_name = #{levelName},</if>
-            <if test="sort != null">sort = #{sort},</if>
-            <if test="companyId != null">company_id = #{companyId},</if>
-            <if test="createTime != null">create_time = #{createTime},</if>
-            <if test="updateTime != null">update_time = #{updateTime},</if>
-        </trim>
-        where id = #{id}
-    </update>
-
-    <delete id="deleteDoctorLevelDataById" parameterType="Long">
-        delete from doctor_level_data where id = #{id}
-    </delete>
-
-    <delete id="deleteDoctorLevelDataByIds" parameterType="String">
-        delete from doctor_level_data where id in 
-        <foreach item="id" collection="array" open="(" separator="," close=")">
-            #{id}
-        </foreach>
-    </delete>
-</mapper>

+ 0 - 121
fs-service/src/main/resources/mapper/doctor/DoctorLevelMapper.xml

@@ -1,121 +0,0 @@
-<?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.fs.doctor.mapper.DoctorLevelMapper">
-    
-    <resultMap type="DoctorLevel" id="DoctorLevelResult">
-        <result property="id"    column="id"    />
-        <result property="doctorId"    column="doctor_id"    />
-        <result property="companyId"    column="company_id"    />
-        <result property="productGroup"    column="product_group"    />
-        <result property="level"    column="level"    />
-        <result property="createTime"    column="create_time"    />
-        <result property="updateTime"    column="update_time"    />
-        <result property="deleted"    column="deleted"    />
-        <result property="doctorName"  column="doctor_name" />
-        <result property="companyName" column="company_name" />
-    </resultMap>
-
-    <sql id="selectDoctorLevelVo">
-        SELECT
-        dl.id,
-        dl.doctor_id,
-        dl.company_id,
-        dl.product_group,
-        dl.level,
-        dl.create_time,
-        dl.update_time,
-        dl.deleted,
-
-        d.doctor_name        AS doctor_name,
-        c.company_name       AS company_name
-
-        FROM doctor_level dl
-        LEFT JOIN doctor d
-        ON d.doctor_id = dl.doctor_id
-        LEFT JOIN company c
-        ON c.company_id = dl.company_id
-    </sql>
-
-    <select id="selectDoctorLevelList" parameterType="DoctorLevel" resultMap="DoctorLevelResult">
-        <include refid="selectDoctorLevelVo"/>
-        <where>
-            <if test="doctorId != null and doctorId != ''"> AND dl.doctor_id = #{doctorId}</if>
-            <if test="companyId != null"> AND dl.company_id = #{companyId}</if>
-            <if test="productGroup != null and productGroup != ''"> AND dl.product_group = #{productGroup}</if>
-            <if test="level != null and level != ''"> AND dl.level = #{level}</if>
-            <if test="deleted != null"> AND dl.deleted = #{deleted}</if>
-        </where>
-        order by dl.create_time desc
-
-    </select>
-    
-    <select id="selectDoctorLevelById" parameterType="Long" resultMap="DoctorLevelResult">
-        <include refid="selectDoctorLevelVo"/>
-        WHERE dl.id = #{id}
-    </select>
-        
-    <insert id="insertDoctorLevel" parameterType="DoctorLevel" useGeneratedKeys="true" keyProperty="id">
-        insert into doctor_level
-        <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="doctorId != null and doctorId != ''">doctor_id,</if>
-            <if test="companyId != null">company_id,</if>
-            <if test="productGroup != null">product_group,</if>
-            <if test="level != null">level,</if>
-            <if test="createTime != null">create_time,</if>
-            <if test="updateTime != null">update_time,</if>
-            <if test="deleted != null">deleted,</if>
-         </trim>
-        <trim prefix="values (" suffix=")" suffixOverrides=",">
-            <if test="doctorId != null and doctorId != ''">#{doctorId},</if>
-            <if test="companyId != null">#{companyId},</if>
-            <if test="productGroup != null">#{productGroup},</if>
-            <if test="level != null">#{level},</if>
-            <if test="createTime != null">#{createTime},</if>
-            <if test="updateTime != null">#{updateTime},</if>
-            <if test="deleted != null">#{deleted},</if>
-         </trim>
-    </insert>
-
-    <update id="updateDoctorLevel" parameterType="DoctorLevel">
-        update doctor_level
-        <trim prefix="SET" suffixOverrides=",">
-            <if test="doctorId != null and doctorId != ''">doctor_id = #{doctorId},</if>
-            <if test="companyId != null">company_id = #{companyId},</if>
-            <if test="productGroup != null">product_group = #{productGroup},</if>
-            <if test="level != null">level = #{level},</if>
-            <if test="createTime != null">create_time = #{createTime},</if>
-            <if test="updateTime != null">update_time = #{updateTime},</if>
-            <if test="deleted != null">deleted = #{deleted},</if>
-        </trim>
-        where id = #{id}
-    </update>
-
-    <delete id="deleteDoctorLevelById" parameterType="Long">
-        delete from doctor_level where id = #{id}
-    </delete>
-
-    <delete id="deleteDoctorLevelByIds" parameterType="String">
-        delete from doctor_level where id in 
-        <foreach item="id" collection="array" open="(" separator="," close=")">
-            #{id}
-        </foreach>
-    </delete>
-
-
-
-    <select id="selectDoctorLevelsByDoctorIds" resultType="com.fs.doctor.domain.DoctorLevel">
-        select
-        id,
-        doctor_id,
-        level,
-        create_time,
-        update_time
-        from doctor_level
-        where doctor_id in
-        <foreach item="doctorId" collection="doctorIds" open="(" separator="," close=")">
-            #{doctorId}
-        </foreach>
-    </select>
-</mapper>

+ 0 - 140
fs-service/src/main/resources/mapper/doctor/DoctorLevelMaterialMapper.xml

@@ -1,140 +0,0 @@
-<?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.fs.doctor.mapper.DoctorLevelMaterialMapper">
-    
-    <resultMap type="DoctorLevelMaterial" id="DoctorLevelMaterialResult">
-        <result property="id"    column="id"    />
-        <result property="companyId"    column="company_id"    />
-        <result property="applyId"    column="apply_id"    />
-        <result property="fileUrl"    column="file_url"    />
-        <result property="fileName"    column="file_name"    />
-        <result property="fileSize"    column="file_size"    />
-        <result property="fileType"    column="file_type"    />
-        <result property="sortOrder"    column="sort_order"    />
-        <result property="createTime"    column="create_time"    />
-        <result property="deleted"    column="deleted"    />
-        <result property="companyName"    column="company_name"    />
-    </resultMap>
-
-    <sql id="selectDoctorLevelMaterialVo">
-        select
-        m.id,
-        m.company_id,
-        c.company_name,
-        m.apply_id,
-        m.file_url,
-        m.file_name,
-        m.file_size,
-        m.file_type,
-        m.sort_order,
-        m.create_time,
-        m.deleted
-        from doctor_level_material m
-        left join company c on c.company_id = m.company_id
-    </sql>
-
-    <select id="selectDoctorLevelMaterialList" parameterType="DoctorLevelMaterial" resultMap="DoctorLevelMaterialResult">
-        <include refid="selectDoctorLevelMaterialVo"/>
-        <where>
-            <if test="companyId != null"> and m.company_id = #{companyId}</if>
-            <if test="applyId != null"> and m.apply_id = #{applyId}</if>
-            <if test="fileUrl != null and fileUrl != ''"> and m.file_url = #{fileUrl}</if>
-            <if test="fileName != null and fileName != ''"> and m.file_name like concat('%', #{fileName}, '%')</if>
-            <if test="fileSize != null"> and m.file_size = #{fileSize}</if>
-            <if test="fileType != null and fileType != ''"> and m.file_type = #{fileType}</if>
-            <if test="sortOrder != null"> and m.sort_order = #{sortOrder}</if>
-            <if test="deleted != null"> and m.deleted = #{deleted}</if>
-        </where>
-        order by m.create_time desc
-
-    </select>
-    
-    <select id="selectDoctorLevelMaterialById" parameterType="Long" resultMap="DoctorLevelMaterialResult">
-        <include refid="selectDoctorLevelMaterialVo"/>
-        where m.id = #{id}
-    </select>
-        
-    <insert id="insertDoctorLevelMaterial" parameterType="DoctorLevelMaterial" useGeneratedKeys="true" keyProperty="id">
-        insert into doctor_level_material
-        <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="companyId != null">company_id,</if>
-            <if test="applyId != null">apply_id,</if>
-            <if test="fileUrl != null and fileUrl != ''">file_url,</if>
-            <if test="fileName != null">file_name,</if>
-            <if test="fileSize != null">file_size,</if>
-            <if test="fileType != null">file_type,</if>
-            <if test="sortOrder != null">sort_order,</if>
-            <if test="createTime != null">create_time,</if>
-            <if test="deleted != null">deleted,</if>
-         </trim>
-        <trim prefix="values (" suffix=")" suffixOverrides=",">
-            <if test="companyId != null">#{companyId},</if>
-            <if test="applyId != null">#{applyId},</if>
-            <if test="fileUrl != null and fileUrl != ''">#{fileUrl},</if>
-            <if test="fileName != null">#{fileName},</if>
-            <if test="fileSize != null">#{fileSize},</if>
-            <if test="fileType != null">#{fileType},</if>
-            <if test="sortOrder != null">#{sortOrder},</if>
-            <if test="createTime != null">#{createTime},</if>
-            <if test="deleted != null">#{deleted},</if>
-         </trim>
-    </insert>
-
-    <update id="updateDoctorLevelMaterial" parameterType="DoctorLevelMaterial">
-        update doctor_level_material
-        <trim prefix="SET" suffixOverrides=",">
-            <if test="companyId != null">company_id = #{companyId},</if>
-            <if test="applyId != null">apply_id = #{applyId},</if>
-            <if test="fileUrl != null and fileUrl != ''">file_url = #{fileUrl},</if>
-            <if test="fileName != null">file_name = #{fileName},</if>
-            <if test="fileSize != null">file_size = #{fileSize},</if>
-            <if test="fileType != null">file_type = #{fileType},</if>
-            <if test="sortOrder != null">sort_order = #{sortOrder},</if>
-            <if test="createTime != null">create_time = #{createTime},</if>
-            <if test="deleted != null">deleted = #{deleted},</if>
-        </trim>
-        where id = #{id}
-    </update>
-
-    <delete id="deleteDoctorLevelMaterialById" parameterType="Long">
-        delete from doctor_level_material where id = #{id}
-    </delete>
-
-    <delete id="deleteDoctorLevelMaterialByIds" parameterType="String">
-        delete from doctor_level_material where id in 
-        <foreach item="id" collection="array" open="(" separator="," close=")">
-            #{id}
-        </foreach>
-    </delete>
-
-
-
-    <insert id="batchInsert" parameterType="java.util.List">
-        INSERT INTO doctor_level_material
-        (company_id, apply_id, file_url, file_name, file_size, file_type, sort_order, deleted)
-        VALUES
-        <foreach collection="list" item="item" separator=",">
-            (#{item.companyId}, #{item.applyId}, #{item.fileUrl},
-            #{item.fileName}, #{item.fileSize}, #{item.fileType},
-            #{item.sortOrder}, #{item.deleted})
-        </foreach>
-    </insert>
-
-
-
-    <delete id="deleteDoctorLevelMaterialByDoctorLevelApplyIds">
-        delete from doctor_level_material
-        where apply_id in
-        <foreach collection="array" item="id" open="(" separator="," close=")">
-            #{id}
-        </foreach>
-    </delete>
-
-
-
-
-
-
-</mapper>

+ 0 - 316
fs-service/src/main/resources/mapper/doctor/DoctorMapper.xml

@@ -1,316 +0,0 @@
-<?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.fs.doctor.mapper.DoctorMapper">
-    
-    <resultMap type="Doctor" id="DoctorResult">
-        <result property="id"    column="id"    />
-        <result property="doctorId"    column="doctor_id"    />
-        <result property="doctorName"    column="doctor_name"    />
-        <result property="accountType"    column="account_type"    />
-        <result property="mobile"    column="mobile"    />
-        <result property="idCard"    column="id_card"    />
-        <result property="institution"    column="institution"    />
-        <result property="province"    column="province"    />
-        <result property="city"    column="city"    />
-        <result property="district"    column="district"    />
-        <result property="department"    column="department"    />
-        <result property="jobTitle"    column="job_title"    />
-        <result property="thirdPartyCode"    column="third_party_code"    />
-        <result property="researcherCode"    column="researcher_code"    />
-        <result property="registerTime"    column="register_time"    />
-        <result property="licenseImage"    column="license_image"    />
-        <result property="titleCertImage"    column="title_cert_image"    />
-        <result property="contractStatus"    column="contract_status"    />
-        <result property="bankCardNo"    column="bank_card_no"    />
-        <result property="bankName"    column="bank_name"    />
-        <result property="bankBranch"    column="bank_branch"    />
-        <result property="status"    column="status"    />
-        <result property="createTime"    column="create_time"    />
-        <result property="updateTime"    column="update_time"    />
-        <result property="deleted"    column="deleted"    />
-        <result property="pwd"    column="pwd"    />
-        <result property="companyId"    column="company_id"    />
-        <result property="provinceName" column="province_name"/>
-        <result property="cityName" column="city_name"/>
-        <result property="districtName" column="district_name"/>
-        <result property="auditInstanceId" column="audit_instance_id"/>
-        <result property="companyName" column="company_name"/>
-        <result property="balance" column="balance"/>
-    </resultMap>
-
-    <sql id="selectDoctorVo">
-        select
-        d.id,
-        d.doctor_id,
-        d.doctor_name,
-        d.account_type,
-        d.mobile,
-        d.id_card,
-        d.institution,
-        d.province,
-        d.city,
-        d.district,
-        d.department,
-        d.job_title,
-        d.third_party_code,
-        d.researcher_code,
-        d.register_time,
-        d.license_image,
-        d.title_cert_image,
-        d.contract_status,
-        d.bank_card_no,
-        d.bank_name,
-        d.bank_branch,
-        d.status,
-        d.create_time,
-        d.update_time,
-        d.deleted,
-        d.pwd,
-        d.company_id,
-        d.audit_instance_id,
-        d.balance,
-        company.company_name,
-
-        p.city_name as province_name,
-        c.city_name as city_name,
-        a.city_name as district_name
-
-        from doctor d
-        left join fs_city p on p.city_id = d.province
-        left join fs_city c on c.city_id = d.city
-        left join fs_city a on a.city_id = d.district
-        left join company company on d.company_id  = company.company_id
-    </sql>
-
-    <select id="selectDoctorList" parameterType="Doctor" resultMap="DoctorResult">
-        SELECT DISTINCT d.id, d.doctor_id, d.doctor_name, d.account_type, d.mobile, d.id_card,
-        d.institution, d.province, d.city, d.district, d.department, d.job_title,
-        d.third_party_code, d.researcher_code, d.register_time, d.license_image,
-        d.title_cert_image, d.contract_status, d.bank_card_no, d.bank_name,
-        d.bank_branch, d.status, d.create_time, d.update_time, d.deleted, d.pwd,
-        d.company_id, d.balance, d.audit_instance_id, d.reject_reason, d.task_num,
-        p.city_name as provinceName,
-        c.city_name as cityName,
-        a.city_name as districtName,
-        company.company_name as companyName
-        FROM doctor d
-        left join fs_city p on p.city_id = d.province
-        left join fs_city c on c.city_id = d.city
-        left join fs_city a on a.city_id = d.district
-        left join company company on d.company_id  = company.company_id
-        <if test="companyUserId != null">
-            INNER JOIN doctor_company_user dcu ON d.doctor_id = dcu.doctor_id AND dcu.deleted = 0
-        </if>
-        <where>
-            <if test="companyUserId != null">
-                AND dcu.company_user_id = #{companyUserId}
-            </if>
-            <if test="doctorId != null  and doctorId != ''"> and d.doctor_id = #{doctorId}</if>
-            <if test="doctorName != null  and doctorName != ''"> and d.doctor_name like concat('%', #{doctorName}, '%')</if>
-            <if test="accountType != null  and accountType != ''"> and d.account_type = #{accountType}</if>
-            <if test="mobile != null  and mobile != ''"> and d.mobile = #{mobile}</if>
-            <if test="idCard != null  and idCard != ''"> and d.id_card = #{idCard}</if>
-            <if test="institution != null  and institution != ''"> and d.institution = #{institution}</if>
-            <if test="province != null  and province != ''"> and d.province = #{province}</if>
-            <if test="city != null  and city != ''"> and d.city = #{city}</if>
-            <if test="district != null  and district != ''"> and d.district = #{district}</if>
-            <if test="department != null  and department != ''"> and d.department = #{department}</if>
-            <if test="jobTitle != null  and jobTitle != ''"> and d.job_title = #{jobTitle}</if>
-            <if test="thirdPartyCode != null  and thirdPartyCode != ''"> and d.third_party_code = #{thirdPartyCode}</if>
-            <if test="researcherCode != null  and researcherCode != ''"> and d.researcher_code = #{researcherCode}</if>
-            <if test="registerTime != null "> and d.register_time = #{registerTime}</if>
-            <if test="licenseImage != null  and licenseImage != ''"> and d.license_image = #{licenseImage}</if>
-            <if test="titleCertImage != null  and titleCertImage != ''"> and d.title_cert_image = #{titleCertImage}</if>
-            <if test="contractStatus != null "> and d.contract_status = #{contractStatus}</if>
-            <if test="bankCardNo != null  and bankCardNo != ''"> and d.bank_card_no = #{bankCardNo}</if>
-            <if test="bankName != null  and bankName != ''"> and d.bank_name like concat('%', #{bankName}, '%')</if>
-            <if test="bankBranch != null  and bankBranch != ''"> and d.bank_branch = #{bankBranch}</if>
-            <if test="status != null "> and d.status = #{status}</if>
-            <if test="deleted != null "> and d.deleted = #{deleted}</if>
-            <if test="pwd != null  and pwd != ''"> and d.pwd = #{pwd}</if>
-            <if test="companyId != null "> and d.company_id = #{companyId}</if>
-        </where>
-        <!-- 添加排序:最新添加的在前 -->
-        order by d.create_time desc
-    </select>
-    
-    <select id="selectDoctorById" parameterType="Long" resultMap="DoctorResult">
-        <include refid="selectDoctorVo"/>
-        where d.id = #{id}
-    </select>
-
-
-    <select id="selectDoctorByDoctorId" parameterType="String" resultMap="DoctorResult">
-        <include refid="selectDoctorVo"/>
-        where d.doctor_id = #{doctorId}
-    </select>
-        
-    <insert id="insertDoctor" parameterType="Doctor" useGeneratedKeys="true" keyProperty="id">
-        insert into doctor
-        <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="doctorId != null and doctorId != ''">doctor_id,</if>
-            <if test="doctorName != null">doctor_name,</if>
-            <if test="accountType != null">account_type,</if>
-            <if test="mobile != null">mobile,</if>
-            <if test="idCard != null">id_card,</if>
-            <if test="institution != null">institution,</if>
-            <if test="province != null">province,</if>
-            <if test="city != null">city,</if>
-            <if test="district != null">district,</if>
-            <if test="department != null">department,</if>
-            <if test="jobTitle != null">job_title,</if>
-            <if test="thirdPartyCode != null">third_party_code,</if>
-            <if test="researcherCode != null">researcher_code,</if>
-            <if test="registerTime != null">register_time,</if>
-            <if test="licenseImage != null">license_image,</if>
-            <if test="titleCertImage != null">title_cert_image,</if>
-            <if test="contractStatus != null">contract_status,</if>
-            <if test="bankCardNo != null">bank_card_no,</if>
-            <if test="bankName != null">bank_name,</if>
-            <if test="bankBranch != null">bank_branch,</if>
-            <if test="status != null">status,</if>
-            <if test="createTime != null">create_time,</if>
-            <if test="updateTime != null">update_time,</if>
-            <if test="deleted != null">deleted,</if>
-            <if test="pwd != null">pwd,</if>
-            <if test="companyId != null">company_id,</if>
-         </trim>
-        <trim prefix="values (" suffix=")" suffixOverrides=",">
-            <if test="doctorId != null and doctorId != ''">#{doctorId},</if>
-            <if test="doctorName != null">#{doctorName},</if>
-            <if test="accountType != null">#{accountType},</if>
-            <if test="mobile != null">#{mobile},</if>
-            <if test="idCard != null">#{idCard},</if>
-            <if test="institution != null">#{institution},</if>
-            <if test="province != null">#{province},</if>
-            <if test="city != null">#{city},</if>
-            <if test="district != null">#{district},</if>
-            <if test="department != null">#{department},</if>
-            <if test="jobTitle != null">#{jobTitle},</if>
-            <if test="thirdPartyCode != null">#{thirdPartyCode},</if>
-            <if test="researcherCode != null">#{researcherCode},</if>
-            <if test="registerTime != null">#{registerTime},</if>
-            <if test="licenseImage != null">#{licenseImage},</if>
-            <if test="titleCertImage != null">#{titleCertImage},</if>
-            <if test="contractStatus != null">#{contractStatus},</if>
-            <if test="bankCardNo != null">#{bankCardNo},</if>
-            <if test="bankName != null">#{bankName},</if>
-            <if test="bankBranch != null">#{bankBranch},</if>
-            <if test="status != null">#{status},</if>
-            <if test="createTime != null">#{createTime},</if>
-            <if test="updateTime != null">#{updateTime},</if>
-            <if test="deleted != null">#{deleted},</if>
-            <if test="pwd != null">#{pwd},</if>
-            <if test="companyId != null">#{companyId},</if>
-         </trim>
-    </insert>
-
-    <update id="updateDoctor" parameterType="Doctor">
-        update doctor
-        <trim prefix="SET" suffixOverrides=",">
-            <if test="doctorId != null and doctorId != ''">doctor_id = #{doctorId},</if>
-            <if test="doctorName != null">doctor_name = #{doctorName},</if>
-            <if test="accountType != null">account_type = #{accountType},</if>
-            <if test="mobile != null">mobile = #{mobile},</if>
-            <if test="idCard != null">id_card = #{idCard},</if>
-            <if test="institution != null">institution = #{institution},</if>
-            <if test="province != null">province = #{province},</if>
-            <if test="city != null">city = #{city},</if>
-            <if test="district != null">district = #{district},</if>
-            <if test="department != null">department = #{department},</if>
-            <if test="jobTitle != null">job_title = #{jobTitle},</if>
-            <if test="thirdPartyCode != null">third_party_code = #{thirdPartyCode},</if>
-            <if test="researcherCode != null">researcher_code = #{researcherCode},</if>
-            <if test="registerTime != null">register_time = #{registerTime},</if>
-            <if test="licenseImage != null">license_image = #{licenseImage},</if>
-            <if test="titleCertImage != null">title_cert_image = #{titleCertImage},</if>
-            <if test="contractStatus != null">contract_status = #{contractStatus},</if>
-            <if test="bankCardNo != null">bank_card_no = #{bankCardNo},</if>
-            <if test="bankName != null">bank_name = #{bankName},</if>
-            <if test="bankBranch != null">bank_branch = #{bankBranch},</if>
-            <if test="status != null">status = #{status},</if>
-            <if test="createTime != null">create_time = #{createTime},</if>
-            <if test="updateTime != null">update_time = #{updateTime},</if>
-            <if test="deleted != null">deleted = #{deleted},</if>
-            <if test="pwd != null">pwd = #{pwd},</if>
-            <if test="companyId != null">company_id = #{companyId},</if>
-            <if test="status != null">status = #{status},</if>
-        </trim>
-        where doctor.id = #{id}
-    </update>
-
-    <delete id="deleteDoctorById" parameterType="Long">
-        delete from doctor where doctor.id = #{id}
-    </delete>
-
-    <delete id="deleteDoctorByIds" parameterType="String">
-        delete from doctor where id in 
-        <foreach item="id" collection="array" open="(" separator="," close=")">
-            #{id}
-        </foreach>
-    </delete>
-
-
-
-
-    <select id="getDoctorOptionVOList"
-            parameterType="com.fs.doctor.vo.DoctorOptionReqVO"
-            resultType="com.fs.doctor.vo.DoctorOptionRespVO">
-        select
-        d.id as doctorId,
-        d.doctor_name as doctorName
-        from doctor d
-        <where>
-            <if test="doctorName != null and doctorName != ''">
-                and d.doctor_name like concat('%', #{doctorName}, '%')
-            </if>
-
-            <if test="companyId != null">
-                and d.company_id = #{companyId}
-            </if>
-        </where>
-
-        <!-- 更像的排前:以输入开头的姓名优先 -->
-        <if test="doctorName != null and doctorName != ''">
-            order by
-            case when d.doctor_name like concat(#{doctorName}, '%') then 0 else 1 end,
-            d.id desc
-        </if>
-        <if test="doctorName == null or doctorName == ''">
-            order by d.id desc
-        </if>
-
-        limit 20
-    </select>
-
-
-    <update id="updateDoctorPwd" parameterType="com.fs.doctor.domain.Doctor">
-        update doctor
-        set pwd = #{pwd},
-        update_time = now()
-        where id = #{id}
-    </update>
-
-
-
-    <update id="addPoints">
-        update doctor
-        set balance = ifnull(balance, 0) + #{points}
-        where id = #{doctorId}
-    </update>
-
-
-
-    <select id="selectDoctorListByIds" resultMap="DoctorResult">
-        <include refid="selectDoctorVo"/>
-        where d.id in
-        <foreach item="id" collection="doctorIds" open="(" separator="," close=")">
-            #{id}
-        </foreach>
-    </select>
-
-
-
-</mapper>

+ 0 - 30
fs-service/src/main/resources/mapper/doctor/DynamicSurveyDataMapper.xml

@@ -1,30 +0,0 @@
-<?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.fs.doctor.mapper.DynamicSurveyDataMapper">
-
-    <insert id="insertData" useGeneratedKeys="true" keyProperty="data.id">
-        INSERT INTO ${tableName}
-        <foreach collection="data.keys" item="key" open="(" separator="," close=")">
-            ${key}
-        </foreach>
-        VALUES
-        <foreach collection="data.values" item="value" open="(" separator="," close=")">
-            #{value}
-        </foreach>
-    </insert>
-
-    <select id="selectById" resultType="java.util.Map">
-        SELECT * FROM ${tableName} WHERE id = #{id}
-    </select>
-
-    <update id="updateById">
-        UPDATE ${tableName}
-        <set>
-            <foreach collection="data.entrySet()" item="entry" index="key" separator=",">
-                ${key} = #{entry.value}
-            </foreach>
-        </set>
-        WHERE id = #{id}
-    </update>
-
-</mapper>

+ 0 - 155
fs-service/src/main/resources/mapper/doctor/WithdrawRecordsMapper.xml

@@ -1,155 +0,0 @@
-<?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.fs.doctor.mapper.WithdrawRecordsMapper">
-    
-    <resultMap type="WithdrawRecords" id="WithdrawRecordsResult">
-        <result property="withdrawId"    column="withdraw_id"    />
-        <result property="doctorId"    column="doctor_id"    />
-        <result property="doctorName"    column="doctor_name"    />
-        <result property="pointsAmount"    column="points_amount"    />
-        <result property="cashAmount"    column="cash_amount"    />
-        <result property="applyTime"    column="apply_time"    />
-        <result property="auditStatus"    column="audit_status"    />
-        <result property="auditorId"    column="auditor_id"    />
-        <result property="auditTime"    column="audit_time"    />
-        <result property="auditRemark"    column="audit_remark"    />
-        <result property="paymentStatus"    column="payment_status"    />
-        <result property="paymentTime"    column="payment_time"    />
-        <result property="bankReceiptNo"    column="bank_receipt_no"    />
-        <result property="remark"    column="remark"    />
-        <result property="companyId"    column="company_id"    />
-        <result property="companyName" column="company_name"/>
-        <result property="auditInstanceId" column="audit_instance_id"/>
-        <result property="bankReceiptUrl" column="bank_receipt_url"/>
-    </resultMap>
-
-    <sql id="selectWithdrawRecordsVo">
-        select
-        wr.withdraw_id,
-        wr.doctor_id,
-        wr.company_id,
-        c.company_name,
-        wr.doctor_name,
-        wr.points_amount,
-        wr.cash_amount,
-        wr.apply_time,
-        wr.audit_status,
-        wr.auditor_id,
-        wr.audit_time,
-        wr.audit_remark,
-        wr.audit_instance_id,
-        wr.payment_status,
-        wr.payment_time,
-        wr.bank_receipt_no,
-        wr.bank_receipt_url,
-        wr.remark
-        from withdraw_records wr
-        left join company c on c.company_id = wr.company_id
-    </sql>
-
-
-    <select id="selectWithdrawRecordsList" parameterType="WithdrawRecords" resultMap="WithdrawRecordsResult">
-        <include refid="selectWithdrawRecordsVo"/>
-        <where>
-            <if test="doctorId != null and doctorId != ''"> and wr.doctor_id = #{doctorId}</if>
-            <if test="doctorName != null and doctorName != ''"> and wr.doctor_name like concat('%', #{doctorName}, '%')</if>
-            <if test="pointsAmount != null and pointsAmount != ''"> and wr.points_amount = #{pointsAmount}</if>
-            <if test="cashAmount != null"> and wr.cash_amount = #{cashAmount}</if>
-
-            <!-- 这里就是导致歧义的罪魁祸首:必须写 wr.company_id -->
-            <if test="companyId != null"> and wr.company_id = #{companyId}</if>
-
-            <if test="applyTime != null"> and wr.apply_time = #{applyTime}</if>
-            <if test="auditStatus != null"> and wr.audit_status = #{auditStatus}</if>
-            <if test="auditorId != null and auditorId != ''"> and wr.auditor_id = #{auditorId}</if>
-            <if test="auditTime != null"> and wr.audit_time = #{auditTime}</if>
-            <if test="auditRemark != null and auditRemark != ''"> and wr.audit_remark = #{auditRemark}</if>
-            <if test="paymentStatus != null"> and wr.payment_status = #{paymentStatus}</if>
-            <if test="paymentTime != null"> and wr.payment_time = #{paymentTime}</if>
-            <if test="bankReceiptNo != null and bankReceiptNo != ''"> and wr.bank_receipt_no = #{bankReceiptNo}</if>
-        </where>
-        <!-- 添加排序:最新申请的在前 -->
-        order by wr.apply_time desc
-    </select>
-    
-    <select id="selectWithdrawRecordsByWithdrawId" parameterType="java.lang.Long" resultMap="WithdrawRecordsResult">
-        <include refid="selectWithdrawRecordsVo"/>
-        where wr.withdraw_id = #{withdrawId}
-    </select>
-        
-    <insert id="insertWithdrawRecords" parameterType="WithdrawRecords" useGeneratedKeys="true" keyProperty="withdrawId">
-        insert into withdraw_records
-        <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="doctorId != null and doctorId != ''">doctor_id,</if>
-            <if test="doctorName != null and doctorName != ''">doctor_name,</if>
-            <if test="companyId != null ">company_id,</if>
-            <if test="pointsAmount != null and pointsAmount != ''">points_amount,</if>
-            <if test="cashAmount != null">cash_amount,</if>
-            <if test="applyTime != null">apply_time,</if>
-            <if test="auditStatus != null">audit_status,</if>
-            <if test="auditorId != null">auditor_id,</if>
-            <if test="auditTime != null">audit_time,</if>
-            <if test="auditRemark != null">audit_remark,</if>
-            <if test="paymentStatus != null">payment_status,</if>
-            <if test="paymentTime != null">payment_time,</if>
-            <if test="bankReceiptNo != null">bank_receipt_no,</if>
-            <if test="remark != null">remark,</if>
-            <if test="auditInstanceId != null">audit_instance_id,</if>
-            <if test="bankReceiptUrl != null">bank_receipt_url,</if>
-         </trim>
-        <trim prefix="values (" suffix=")" suffixOverrides=",">
-            <if test="doctorId != null and doctorId != ''">#{doctorId},</if>
-            <if test="doctorName != null and doctorName != ''">#{doctorName},</if>
-            <if test="companyId != null ">#{companyId},</if>
-            <if test="pointsAmount != null and pointsAmount != ''">#{pointsAmount},</if>
-            <if test="cashAmount != null">#{cashAmount},</if>
-            <if test="applyTime != null">#{applyTime},</if>
-            <if test="auditStatus != null">#{auditStatus},</if>
-            <if test="auditorId != null">#{auditorId},</if>
-            <if test="auditTime != null">#{auditTime},</if>
-            <if test="auditRemark != null">#{auditRemark},</if>
-            <if test="paymentStatus != null">#{paymentStatus},</if>
-            <if test="paymentTime != null">#{paymentTime},</if>
-            <if test="bankReceiptNo != null">#{bankReceiptNo},</if>
-            <if test="remark != null">#{remark},</if>
-            <if test="auditInstanceId != null">#{auditInstanceId},</if>
-            <if test="bankReceiptUrl != null">#{bankReceiptUrl},</if>
-         </trim>
-    </insert>
-
-    <update id="updateWithdrawRecords" parameterType="WithdrawRecords">
-        update withdraw_records
-        <trim prefix="SET" suffixOverrides=",">
-            <if test="doctorId != null and doctorId != ''">doctor_id = #{doctorId},</if>
-            <if test="doctorName != null and doctorName != ''">doctor_name = #{doctorName},</if>
-            <if test="companyId != null ">company_id = #{companyId},</if>
-            <if test="pointsAmount != null and pointsAmount != ''">points_amount = #{pointsAmount},</if>
-            <if test="cashAmount != null">cash_amount = #{cashAmount},</if>
-            <if test="applyTime != null">apply_time = #{applyTime},</if>
-            <if test="auditStatus != null">audit_status = #{auditStatus},</if>
-            <if test="auditorId != null">auditor_id = #{auditorId},</if>
-            <if test="auditTime != null">audit_time = #{auditTime},</if>
-            <if test="auditRemark != null">audit_remark = #{auditRemark},</if>
-            <if test="paymentStatus != null">payment_status = #{paymentStatus},</if>
-            <if test="paymentTime != null">payment_time = #{paymentTime},</if>
-            <if test="bankReceiptNo != null">bank_receipt_no = #{bankReceiptNo},</if>
-            <if test="remark != null">remark = #{remark},</if>
-            <if test="auditInstanceId != null">audit_instance_id = #{auditInstanceId},</if>
-            <if test="bankReceiptUrl != null">bank_receipt_url = #{bankReceiptUrl},</if>
-        </trim>
-        where withdraw_id = #{withdrawId}
-    </update>
-
-    <delete id="deleteWithdrawRecordsByWithdrawId" parameterType="java.lang.Long">
-        delete from withdraw_records where withdraw_id = #{withdrawId}
-    </delete>
-
-    <delete id="deleteWithdrawRecordsByWithdrawIds" parameterType="java.lang.Long">
-        delete from withdraw_records where withdraw_id in 
-        <foreach item="withdrawId" collection="array" open="(" separator="," close=")">
-            #{withdrawId}
-        </foreach>
-    </delete>
-</mapper>

+ 0 - 194
fs-service/src/main/resources/mapper/live/LiveBroadcastMapper.xml

@@ -1,194 +0,0 @@
-<?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.fs.live.mapper.LiveBroadcastMapper">
-    
-    <resultMap type="LiveBroadcast" id="LiveBroadcastResult">
-        <result property="id"    column="id"    />
-        <result property="companyId"    column="company_id"    />
-        <result property="title"    column="title"    />
-        <result property="coverUrl"    column="cover_url"    />
-        <result property="status"    column="status"    />
-        <result property="doctorId"    column="doctor_id"    />
-        <result property="tagIds"    column="tag_ids"    />
-        <result property="doctorName"    column="doctor_name"    />
-        <result property="doctorTitle"    column="doctor_title"    />
-        <result property="doctorAvatar"    column="doctor_avatar"    />
-        <result property="hospitalName"    column="hospital_name"    />
-        <result property="department"    column="department"    />
-        <result property="scheduledStartTime"    column="scheduled_start_time"    />
-        <result property="scheduledEndTime"    column="scheduled_end_time"    />
-        <result property="actualStartTime"    column="actual_start_time"    />
-        <result property="actualEndTime"    column="actual_end_time"    />
-        <result property="liveUrl"    column="live_url"    />
-        <result property="playbackUrl"    column="playback_url"    />
-        <result property="description"    column="description"    />
-        <result property="viewCount"    column="view_count"    />
-        <result property="likeCount"    column="like_count"    />
-        <result property="favoriteCount"    column="favorite_count"    />
-        <result property="needRegister"    column="need_register"    />
-        <result property="shareQrcodeUrl"    column="share_qrcode_url"    />
-        <result property="sort"    column="sort"    />
-        <result property="createBy"    column="create_by"    />
-        <result property="createTime"    column="create_time"    />
-        <result property="updateBy"    column="update_by"    />
-        <result property="updateTime"    column="update_time"    />
-        <result property="deleted"    column="deleted"    />
-    </resultMap>
-
-    <sql id="selectLiveBroadcastVo">
-        select id, company_id, title, cover_url, status, doctor_id, tag_ids,doctor_name, doctor_title, doctor_avatar, hospital_name, department, scheduled_start_time, scheduled_end_time, actual_start_time, actual_end_time, live_url, playback_url, description, view_count, like_count, favorite_count, need_register, share_qrcode_url, sort, create_by, create_time, update_by, update_time, deleted from live_broadcast
-    </sql>
-
-    <select id="selectLiveBroadcastList" parameterType="LiveBroadcast" resultMap="LiveBroadcastResult">
-        <include refid="selectLiveBroadcastVo"/>
-        <where>  
-            <if test="companyId != null "> and company_id = #{companyId}</if>
-            <if test="title != null and title != ''">
-                AND title LIKE CONCAT('%', #{title}, '%')
-            </if>
-            <if test="coverUrl != null  and coverUrl != ''"> and cover_url = #{coverUrl}</if>
-            <if test="status != null "> and status = #{status}</if>
-            <if test="doctorId != null "> and doctor_id = #{doctorId}</if>
-            <if test="tagIds != null and tagIds != ''"> and t.tag_ids = #{tagIds}</if>
-            <if test="doctorName != null  and doctorName != ''"> and doctor_name like concat('%', #{doctorName}, '%')</if>
-            <if test="doctorTitle != null  and doctorTitle != ''"> and doctor_title = #{doctorTitle}</if>
-            <if test="doctorAvatar != null  and doctorAvatar != ''"> and doctor_avatar = #{doctorAvatar}</if>
-            <if test="hospitalName != null  and hospitalName != ''"> and hospital_name like concat('%', #{hospitalName}, '%')</if>
-            <if test="department != null  and department != ''"> and department = #{department}</if>
-            <if test="scheduledStartTime != null "> and scheduled_start_time = #{scheduledStartTime}</if>
-            <if test="scheduledEndTime != null "> and scheduled_end_time = #{scheduledEndTime}</if>
-            <if test="actualStartTime != null "> and actual_start_time = #{actualStartTime}</if>
-            <if test="actualEndTime != null "> and actual_end_time = #{actualEndTime}</if>
-            <if test="liveUrl != null  and liveUrl != ''"> and live_url = #{liveUrl}</if>
-            <if test="playbackUrl != null  and playbackUrl != ''"> and playback_url = #{playbackUrl}</if>
-            <if test="description != null  and description != ''"> and description = #{description}</if>
-            <if test="viewCount != null "> and view_count = #{viewCount}</if>
-            <if test="likeCount != null "> and like_count = #{likeCount}</if>
-            <if test="favoriteCount != null "> and favorite_count = #{favoriteCount}</if>
-            <if test="needRegister != null "> and need_register = #{needRegister}</if>
-            <if test="shareQrcodeUrl != null  and shareQrcodeUrl != ''"> and share_qrcode_url = #{shareQrcodeUrl}</if>
-            <if test="sort != null "> and sort = #{sort}</if>
-            <if test="deleted != null "> and deleted = #{deleted}</if>
-        </where>
-    </select>
-    
-    <select id="selectLiveBroadcastById" parameterType="Long" resultMap="LiveBroadcastResult">
-        <include refid="selectLiveBroadcastVo"/>
-        where id = #{id}
-    </select>
-        
-    <insert id="insertLiveBroadcast" parameterType="LiveBroadcast" useGeneratedKeys="true" keyProperty="id">
-        insert into live_broadcast
-        <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="companyId != null">company_id,</if>
-            <if test="title != null and title != ''">title,</if>
-            <if test="coverUrl != null">cover_url,</if>
-            <if test="status != null">status,</if>
-            <if test="doctorId != null">doctor_id,</if>
-            <if test="tagIds != null">tag_ids,</if>
-            <if test="doctorName != null">doctor_name,</if>
-            <if test="doctorTitle != null">doctor_title,</if>
-            <if test="doctorAvatar != null">doctor_avatar,</if>
-            <if test="hospitalName != null">hospital_name,</if>
-            <if test="department != null">department,</if>
-            <if test="scheduledStartTime != null">scheduled_start_time,</if>
-            <if test="scheduledEndTime != null">scheduled_end_time,</if>
-            <if test="actualStartTime != null">actual_start_time,</if>
-            <if test="actualEndTime != null">actual_end_time,</if>
-            <if test="liveUrl != null">live_url,</if>
-            <if test="playbackUrl != null">playback_url,</if>
-            <if test="description != null">description,</if>
-            <if test="viewCount != null">view_count,</if>
-            <if test="likeCount != null">like_count,</if>
-            <if test="favoriteCount != null">favorite_count,</if>
-            <if test="needRegister != null">need_register,</if>
-            <if test="shareQrcodeUrl != null">share_qrcode_url,</if>
-            <if test="sort != null">sort,</if>
-            <if test="createBy != null">create_by,</if>
-            <if test="createTime != null">create_time,</if>
-            <if test="updateBy != null">update_by,</if>
-            <if test="updateTime != null">update_time,</if>
-            <if test="deleted != null">deleted,</if>
-         </trim>
-        <trim prefix="values (" suffix=")" suffixOverrides=",">
-            <if test="companyId != null">#{companyId},</if>
-            <if test="title != null and title != ''">#{title},</if>
-            <if test="coverUrl != null">#{coverUrl},</if>
-            <if test="status != null">#{status},</if>
-            <if test="doctorId != null">#{doctorId},</if>
-            <if test="tagIds != null">#{tagIds},</if>
-            <if test="doctorName != null">#{doctorName},</if>
-            <if test="doctorTitle != null">#{doctorTitle},</if>
-            <if test="doctorAvatar != null">#{doctorAvatar},</if>
-            <if test="hospitalName != null">#{hospitalName},</if>
-            <if test="department != null">#{department},</if>
-            <if test="scheduledStartTime != null">#{scheduledStartTime},</if>
-            <if test="scheduledEndTime != null">#{scheduledEndTime},</if>
-            <if test="actualStartTime != null">#{actualStartTime},</if>
-            <if test="actualEndTime != null">#{actualEndTime},</if>
-            <if test="liveUrl != null">#{liveUrl},</if>
-            <if test="playbackUrl != null">#{playbackUrl},</if>
-            <if test="description != null">#{description},</if>
-            <if test="viewCount != null">#{viewCount},</if>
-            <if test="likeCount != null">#{likeCount},</if>
-            <if test="favoriteCount != null">#{favoriteCount},</if>
-            <if test="needRegister != null">#{needRegister},</if>
-            <if test="shareQrcodeUrl != null">#{shareQrcodeUrl},</if>
-            <if test="sort != null">#{sort},</if>
-            <if test="createBy != null">#{createBy},</if>
-            <if test="createTime != null">#{createTime},</if>
-            <if test="updateBy != null">#{updateBy},</if>
-            <if test="updateTime != null">#{updateTime},</if>
-            <if test="deleted != null">#{deleted},</if>
-         </trim>
-    </insert>
-
-    <update id="updateLiveBroadcast" parameterType="LiveBroadcast">
-        update live_broadcast
-        <trim prefix="SET" suffixOverrides=",">
-            <if test="companyId != null">company_id = #{companyId},</if>
-            <if test="title != null and title != ''">title = #{title},</if>
-            <if test="coverUrl != null">cover_url = #{coverUrl},</if>
-            <if test="status != null">status = #{status},</if>
-            <if test="doctorId != null">doctor_id = #{doctorId},</if>
-            <if test="tagIds != null">tag_ids = #{tagIds},</if>
-            <if test="doctorName != null">doctor_name = #{doctorName},</if>
-            <if test="doctorTitle != null">doctor_title = #{doctorTitle},</if>
-            <if test="doctorAvatar != null">doctor_avatar = #{doctorAvatar},</if>
-            <if test="hospitalName != null">hospital_name = #{hospitalName},</if>
-            <if test="department != null">department = #{department},</if>
-            <if test="scheduledStartTime != null">scheduled_start_time = #{scheduledStartTime},</if>
-            <if test="scheduledEndTime != null">scheduled_end_time = #{scheduledEndTime},</if>
-            <if test="actualStartTime != null">actual_start_time = #{actualStartTime},</if>
-            <if test="actualEndTime != null">actual_end_time = #{actualEndTime},</if>
-            <if test="liveUrl != null">live_url = #{liveUrl},</if>
-            <if test="playbackUrl != null">playback_url = #{playbackUrl},</if>
-            <if test="description != null">description = #{description},</if>
-            <if test="viewCount != null">view_count = #{viewCount},</if>
-            <if test="likeCount != null">like_count = #{likeCount},</if>
-            <if test="favoriteCount != null">favorite_count = #{favoriteCount},</if>
-            <if test="needRegister != null">need_register = #{needRegister},</if>
-            <if test="shareQrcodeUrl != null">share_qrcode_url = #{shareQrcodeUrl},</if>
-            <if test="sort != null">sort = #{sort},</if>
-            <if test="createBy != null">create_by = #{createBy},</if>
-            <if test="createTime != null">create_time = #{createTime},</if>
-            <if test="updateBy != null">update_by = #{updateBy},</if>
-            <if test="updateTime != null">update_time = #{updateTime},</if>
-            <if test="deleted != null">deleted = #{deleted},</if>
-        </trim>
-        where id = #{id}
-    </update>
-
-    <delete id="deleteLiveBroadcastById" parameterType="Long">
-        delete from live_broadcast where id = #{id}
-    </delete>
-
-    <delete id="deleteLiveBroadcastByIds" parameterType="String">
-        delete from live_broadcast where id in 
-        <foreach item="id" collection="array" open="(" separator="," close=")">
-            #{id}
-        </foreach>
-    </delete>
-</mapper>

+ 0 - 116
fs-service/src/main/resources/mapper/project/ProjectContractMapper.xml

@@ -1,116 +0,0 @@
-<?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.fs.project.mapper.ProjectContractMapper">
-    
-    <resultMap type="ProjectContract" id="ProjectContractResult">
-        <result property="id"    column="id"    />
-        <result property="companyId"    column="company_id"    />
-        <result property="projectId"    column="project_id"    />
-        <result property="contractCode"    column="contract_code"    />
-        <result property="contractName"    column="contract_name"    />
-        <result property="createTime"    column="create_time"    />
-        <result property="updateTime"    column="update_time"    />
-        <result property="createBy"    column="create_by"    />
-        <result property="updateBy"    column="update_by"    />
-        <result property="delFlag"    column="del_flag"    />
-        <result property="companyName" column="company_name"/>
-        <result property="projectName" column="project_name"/>
-    </resultMap>
-
-    <sql id="selectProjectContractVo">
-        SELECT
-        pc.id,
-        pc.company_id,
-        pc.project_id,
-        pc.contract_code,
-        pc.contract_name,
-        pc.create_time,
-        pc.update_time,
-        pc.create_by,
-        pc.update_by,
-        pc.del_flag,
-
-        c.company_name AS company_name,
-        p.project_name AS project_name
-        FROM project_contract pc
-        LEFT JOIN company c
-        ON c.company_id = pc.company_id
-        AND c.is_del = 0
-        LEFT JOIN project p
-        ON p.id = pc.project_id
-        AND p.del_flag = 0
-    </sql>
-
-
-    <select id="selectProjectContractList" parameterType="ProjectContract" resultMap="ProjectContractResult">
-        <include refid="selectProjectContractVo"/>
-        <where>
-            <if test="companyId != null"> and pc.company_id = #{companyId}</if>
-            <if test="projectId != null"> and pc.project_id = #{projectId}</if>
-            <if test="contractCode != null and contractCode != ''"> and pc.contract_code = #{contractCode}</if>
-            <if test="contractName != null and contractName != ''"> and pc.contract_name like concat('%', #{contractName}, '%')</if>
-        </where>
-        GROUP BY pc.id
-
-    </select>
-    
-    <select id="selectProjectContractById" parameterType="Long" resultMap="ProjectContractResult">
-        <include refid="selectProjectContractVo"/>
-        where pc.id = #{id}
-    </select>
-        
-    <insert id="insertProjectContract" parameterType="ProjectContract" useGeneratedKeys="true" keyProperty="id">
-        insert into project_contract
-        <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="companyId != null">company_id,</if>
-            <if test="projectId != null">project_id,</if>
-            <if test="contractCode != null and contractCode != ''">contract_code,</if>
-            <if test="contractName != null and contractName != ''">contract_name,</if>
-            <if test="createTime != null">create_time,</if>
-            <if test="updateTime != null">update_time,</if>
-            <if test="createBy != null">create_by,</if>
-            <if test="updateBy != null">update_by,</if>
-            <if test="delFlag != null">del_flag,</if>
-         </trim>
-        <trim prefix="values (" suffix=")" suffixOverrides=",">
-            <if test="companyId != null">#{companyId},</if>
-            <if test="projectId != null">#{projectId},</if>
-            <if test="contractCode != null and contractCode != ''">#{contractCode},</if>
-            <if test="contractName != null and contractName != ''">#{contractName},</if>
-            <if test="createTime != null">#{createTime},</if>
-            <if test="updateTime != null">#{updateTime},</if>
-            <if test="createBy != null">#{createBy},</if>
-            <if test="updateBy != null">#{updateBy},</if>
-            <if test="delFlag != null">#{delFlag},</if>
-         </trim>
-    </insert>
-
-    <update id="updateProjectContract" parameterType="ProjectContract">
-        update project_contract
-        <trim prefix="SET" suffixOverrides=",">
-            <if test="companyId != null">company_id = #{companyId},</if>
-            <if test="projectId != null">project_id = #{projectId},</if>
-            <if test="contractCode != null and contractCode != ''">contract_code = #{contractCode},</if>
-            <if test="contractName != null and contractName != ''">contract_name = #{contractName},</if>
-            <if test="createTime != null">create_time = #{createTime},</if>
-            <if test="updateTime != null">update_time = #{updateTime},</if>
-            <if test="createBy != null">create_by = #{createBy},</if>
-            <if test="updateBy != null">update_by = #{updateBy},</if>
-            <if test="delFlag != null">del_flag = #{delFlag},</if>
-        </trim>
-        where id = #{id}
-    </update>
-
-    <delete id="deleteProjectContractById" parameterType="Long">
-        delete from project_contract where id = #{id}
-    </delete>
-
-    <delete id="deleteProjectContractByIds" parameterType="String">
-        delete from project_contract where id in 
-        <foreach item="id" collection="array" open="(" separator="," close=")">
-            #{id}
-        </foreach>
-    </delete>
-</mapper>

+ 0 - 212
fs-service/src/main/resources/mapper/project/ProjectMapper.xml

@@ -1,212 +0,0 @@
-<?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.fs.project.mapper.ProjectMapper">
-
-    <resultMap type="Project" id="ProjectResult">
-        <result property="id"    column="id"    />
-        <result property="companyId"    column="company_id"    />
-        <result property="companyName" column="company_name" />
-        <result property="projectName"    column="project_name"    />
-        <result property="projectTypeId"    column="project_type_id"    />
-        <result property="thirdPartyCode"    column="third_party_code"    />
-        <result property="productIds"    column="product_ids"    />
-        <result property="projectAmount"    column="project_amount"    />
-        <result property="laborCost"    column="labor_cost"    />
-        <result property="startDate"    column="start_date"    />
-        <result property="endDate"    column="end_date"    />
-        <result property="serviceFeeRate"    column="service_fee_rate"    />
-        <result property="settlementApprovalId"    column="settlement_approval_id"    />
-        <result property="taskCreateDeadline"    column="task_create_deadline"    />
-        <result property="taskCompleteTime"    column="task_complete_time"    />
-        <result property="settlementDeadline"    column="settlement_deadline"    />
-        <result property="createTime"    column="create_time"    />
-        <result property="updateTime"    column="update_time"    />
-        <result property="createBy"    column="create_by"    />
-        <result property="updateBy"    column="update_by"    />
-        <result property="delFlag"    column="del_flag"    />
-        <result property="status"    column="status"    />
-        <result property="productNames" column="product_names" />
-    </resultMap>
-
-    <sql id="selectProjectVo">
-        SELECT
-        p.id,
-        p.company_id,
-        c.company_name AS company_name,
-        p.project_name,
-        p.status,
-        p.project_type_id,
-        p.third_party_code,
-        p.product_ids,
-        GROUP_CONCAT(cp.product_name ORDER BY cp.sort, cp.id SEPARATOR '、') AS product_names,
-        p.project_amount,
-        p.labor_cost,
-        p.start_date,
-        p.end_date,
-        p.service_fee_rate,
-        p.settlement_approval_id,
-        p.task_create_deadline,
-        p.task_complete_time,
-        p.settlement_deadline,
-        p.create_time,
-        p.update_time,
-        p.create_by,
-        p.update_by,
-        p.del_flag
-        FROM project p
-        LEFT JOIN company c ON c.company_id = p.company_id
-        LEFT JOIN company_product cp
-        ON cp.company_id = p.company_id
-        AND cp.del_flag = 0
-        AND cp.status = 1
-        AND FIND_IN_SET(cp.id, p.product_ids) > 0
-    </sql>
-
-
-
-
-    <select id="selectProjectList" parameterType="Project" resultMap="ProjectResult">
-        <include refid="selectProjectVo"/>
-        <where>
-            <if test="companyId != null "> and p.company_id = #{companyId}</if>
-            <if test="projectName != null  and projectName != ''"> and p.project_name like concat('%', #{projectName}, '%')</if>
-            <if test="projectTypeId != null "> and p.project_type_id = #{projectTypeId}</if>
-            <if test="thirdPartyCode != null  and thirdPartyCode != ''"> and p.third_party_code = #{thirdPartyCode}</if>
-
-            <!-- ⚠️ 你这里 productIds 现在是“逗号串”,用等号过滤很鸡肋(下面我给你更合理的写法) -->
-            <if test="productIds != null  and productIds != ''"> and p.product_ids = #{productIds}</if>
-
-            <if test="projectAmount != null "> and p.project_amount = #{projectAmount}</if>
-            <if test="laborCost != null "> and p.labor_cost = #{laborCost}</if>
-            <if test="startDate != null "> and p.start_date = #{startDate}</if>
-            <if test="endDate != null "> and p.end_date = #{endDate}</if>
-            <if test="serviceFeeRate != null "> and p.service_fee_rate = #{serviceFeeRate}</if>
-            <if test="settlementApprovalId != null "> and p.settlement_approval_id = #{settlementApprovalId}</if>
-            <if test="taskCreateDeadline != null "> and p.task_create_deadline = #{taskCreateDeadline}</if>
-            <if test="taskCompleteTime != null "> and p.task_complete_time = #{taskCompleteTime}</if>
-            <if test="settlementDeadline != null "> and p.settlement_deadline = #{settlementDeadline}</if>
-        </where>
-
-        <!-- ✅ 新增 -->
-        GROUP BY p.id
-    </select>
-
-
-    <select id="selectProjectById" parameterType="Long" resultMap="ProjectResult">
-        <include refid="selectProjectVo"/>
-        where p.id = #{id}
-        GROUP BY p.id
-    </select>
-
-
-    <insert id="insertProject" parameterType="Project" useGeneratedKeys="true" keyProperty="id">
-        insert into project
-        <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="companyId != null">company_id,</if>
-            <if test="projectName != null and projectName != ''">project_name,</if>
-            <if test="projectTypeId != null">project_type_id,</if>
-            <if test="thirdPartyCode != null">third_party_code,</if>
-            <if test="productIds != null">product_ids,</if>
-            <if test="projectAmount != null">project_amount,</if>
-            <if test="laborCost != null">labor_cost,</if>
-            <if test="startDate != null">start_date,</if>
-            <if test="endDate != null">end_date,</if>
-            <if test="serviceFeeRate != null">service_fee_rate,</if>
-            <if test="settlementApprovalId != null">settlement_approval_id,</if>
-            <if test="taskCreateDeadline != null">task_create_deadline,</if>
-            <if test="taskCompleteTime != null">task_complete_time,</if>
-            <if test="settlementDeadline != null">settlement_deadline,</if>
-            <if test="createTime != null">create_time,</if>
-            <if test="updateTime != null">update_time,</if>
-            <if test="createBy != null">create_by,</if>
-            <if test="updateBy != null">update_by,</if>
-            <if test="delFlag != null">del_flag,</if>
-         </trim>
-        <trim prefix="values (" suffix=")" suffixOverrides=",">
-            <if test="companyId != null">#{companyId},</if>
-            <if test="projectName != null and projectName != ''">#{projectName},</if>
-            <if test="projectTypeId != null">#{projectTypeId},</if>
-            <if test="thirdPartyCode != null">#{thirdPartyCode},</if>
-            <if test="productIds != null">#{productIds},</if>
-            <if test="projectAmount != null">#{projectAmount},</if>
-            <if test="laborCost != null">#{laborCost},</if>
-            <if test="startDate != null">#{startDate},</if>
-            <if test="endDate != null">#{endDate},</if>
-            <if test="serviceFeeRate != null">#{serviceFeeRate},</if>
-            <if test="settlementApprovalId != null">#{settlementApprovalId},</if>
-            <if test="taskCreateDeadline != null">#{taskCreateDeadline},</if>
-            <if test="taskCompleteTime != null">#{taskCompleteTime},</if>
-            <if test="settlementDeadline != null">#{settlementDeadline},</if>
-            <if test="createTime != null">#{createTime},</if>
-            <if test="updateTime != null">#{updateTime},</if>
-            <if test="createBy != null">#{createBy},</if>
-            <if test="updateBy != null">#{updateBy},</if>
-            <if test="delFlag != null">#{delFlag},</if>
-         </trim>
-    </insert>
-
-    <update id="updateProject" parameterType="Project">
-        update project
-        <trim prefix="SET" suffixOverrides=",">
-            <if test="companyId != null">company_id = #{companyId},</if>
-            <if test="projectName != null and projectName != ''">project_name = #{projectName},</if>
-            <if test="projectTypeId != null">project_type_id = #{projectTypeId},</if>
-            <if test="thirdPartyCode != null">third_party_code = #{thirdPartyCode},</if>
-            <if test="productIds != null">product_ids = #{productIds},</if>
-            <if test="projectAmount != null">project_amount = #{projectAmount},</if>
-            <if test="laborCost != null">labor_cost = #{laborCost},</if>
-            <if test="startDate != null">start_date = #{startDate},</if>
-            <if test="endDate != null">end_date = #{endDate},</if>
-            <if test="serviceFeeRate != null">service_fee_rate = #{serviceFeeRate},</if>
-            <if test="settlementApprovalId != null">settlement_approval_id = #{settlementApprovalId},</if>
-            <if test="taskCreateDeadline != null">task_create_deadline = #{taskCreateDeadline},</if>
-            <if test="taskCompleteTime != null">task_complete_time = #{taskCompleteTime},</if>
-            <if test="settlementDeadline != null">settlement_deadline = #{settlementDeadline},</if>
-            <if test="createTime != null">create_time = #{createTime},</if>
-            <if test="updateTime != null">update_time = #{updateTime},</if>
-            <if test="createBy != null">create_by = #{createBy},</if>
-            <if test="updateBy != null">update_by = #{updateBy},</if>
-            <if test="delFlag != null">del_flag = #{delFlag},</if>
-        </trim>
-        where id = #{id}
-    </update>
-
-    <delete id="deleteProjectById" parameterType="Long">
-        delete from project where id = #{id}
-    </delete>
-
-    <delete id="deleteProjectByIds" parameterType="String">
-        delete from project where id in
-        <foreach item="id" collection="array" open="(" separator="," close=")">
-            #{id}
-        </foreach>
-    </delete>
-
-
-    <select id="selectProjectOptions" resultType="com.fs.project.vo.ProjectOptionVO">
-        SELECT id AS projectId, project_name AS projectName
-        FROM project
-        <where>
-            status = 0
-            <if test="projectName != null and projectName != ''">
-                AND project_name LIKE CONCAT('%', #{projectName}, '%')
-            </if>
-        </where>
-        ORDER BY id DESC
-        LIMIT 20
-    </select>
-    <select id="getAllData" resultType="com.fs.project.domain.Project">
-        select * from project where company_id=#{companyId}
-    </select>
-
-
-    <update id="updateStatus">
-        update project
-        set status = #{status},
-        update_time = now()
-        where id = #{id}
-    </update>
-
-</mapper>

+ 0 - 118
fs-service/src/main/resources/mapper/project/ProjectPermissionMapper.xml

@@ -1,118 +0,0 @@
-<?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.fs.project.mapper.ProjectPermissionMapper">
-    
-    <resultMap type="ProjectPermission" id="ProjectPermissionResult">
-        <result property="id"    column="id"    />
-        <result property="companyId"    column="company_id"    />
-        <result property="projectType"    column="project_type"    />
-        <result property="roleIds"    column="role_ids"    />
-        <result property="roleNames"    column="role_names"    />
-        <result property="deleted"    column="deleted"    />
-        <result property="createBy"    column="create_by"    />
-        <result property="createTime"    column="create_time"    />
-        <result property="updateBy"    column="update_by"    />
-        <result property="updateTime"    column="update_time"    />
-        <result property="companyName" column="company_name"/>
-    </resultMap>
-
-    <sql id="selectProjectPermissionVo">
-        SELECT
-        p.id,
-        p.company_id,
-        c.company_name,
-        p.project_type,
-        p.role_ids,
-        p.deleted,
-        p.create_by,
-        p.create_time,
-        p.update_by,
-        p.update_time,
-        GROUP_CONCAT(r.role_name ORDER BY r.role_id SEPARATOR ',') AS role_names
-        FROM project_permission p
-        LEFT JOIN company c ON c.company_id = p.company_id
-        LEFT JOIN company_role r
-        ON r.company_id = p.company_id
-        AND FIND_IN_SET(r.role_id, p.role_ids)
-    </sql>
-
-    <select id="selectProjectPermissionList" parameterType="ProjectPermission" resultMap="ProjectPermissionResult">
-        <include refid="selectProjectPermissionVo"/>
-        <where>
-            <if test="companyId != null "> and p.company_id = #{companyId}</if>
-            <if test="projectType != null  and projectType != ''"> and p.project_type = #{projectType}</if>
-            <if test="roleIds != null  and roleIds != ''"> and p.role_ids = #{roleIds}</if>
-            <if test="deleted != null "> and p.deleted = #{deleted}</if>
-        </where>
-        GROUP BY p.id
-
-    </select>
-    
-    <select id="selectProjectPermissionById" parameterType="Long" resultMap="ProjectPermissionResult">
-        <include refid="selectProjectPermissionVo"/>
-        where p.id = #{id}
-        GROUP BY p.id
-    </select>
-        
-    <insert id="insertProjectPermission" parameterType="ProjectPermission" useGeneratedKeys="true" keyProperty="id">
-        insert into project_permission
-        <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="companyId != null">company_id,</if>
-            <if test="projectType != null and projectType != ''">project_type,</if>
-            <if test="roleIds != null">role_ids,</if>
-            <if test="deleted != null">deleted,</if>
-            <if test="createBy != null">create_by,</if>
-            <if test="createTime != null">create_time,</if>
-            <if test="updateBy != null">update_by,</if>
-            <if test="updateTime != null">update_time,</if>
-         </trim>
-        <trim prefix="values (" suffix=")" suffixOverrides=",">
-            <if test="companyId != null">#{companyId},</if>
-            <if test="projectType != null and projectType != ''">#{projectType},</if>
-            <if test="roleIds != null">#{roleIds},</if>
-            <if test="deleted != null">#{deleted},</if>
-            <if test="createBy != null">#{createBy},</if>
-            <if test="createTime != null">#{createTime},</if>
-            <if test="updateBy != null">#{updateBy},</if>
-            <if test="updateTime != null">#{updateTime},</if>
-         </trim>
-    </insert>
-
-    <update id="updateProjectPermission" parameterType="ProjectPermission">
-        update project_permission
-        <trim prefix="SET" suffixOverrides=",">
-            <if test="companyId != null">company_id = #{companyId},</if>
-            <if test="projectType != null and projectType != ''">project_type = #{projectType},</if>
-            <if test="roleIds != null">role_ids = #{roleIds},</if>
-            <if test="deleted != null">deleted = #{deleted},</if>
-            <if test="createBy != null">create_by = #{createBy},</if>
-            <if test="createTime != null">create_time = #{createTime},</if>
-            <if test="updateBy != null">update_by = #{updateBy},</if>
-            <if test="updateTime != null">update_time = #{updateTime},</if>
-        </trim>
-        where id = #{id}
-    </update>
-
-    <delete id="deleteProjectPermissionById" parameterType="Long">
-        delete from project_permission where id = #{id}
-    </delete>
-
-    <delete id="deleteProjectPermissionByIds" parameterType="String">
-        delete from project_permission where id in 
-        <foreach item="id" collection="array" open="(" separator="," close=")">
-            #{id}
-        </foreach>
-    </delete>
-
-
-    <!-- 在 ProjectPermissionMapper.xml 中添加 -->
-    <select id="selectByUniqueKey" resultType="ProjectPermission">
-        SELECT * FROM project_permission
-        WHERE company_id = #{companyId}
-        AND project_type = #{projectType}
-        AND deleted = #{deleted}
-        LIMIT 1
-    </select>
-</mapper>

+ 0 - 130
fs-service/src/main/resources/mapper/project/ProjectSettingsMapper.xml

@@ -1,130 +0,0 @@
-<?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.fs.project.mapper.ProjectSettingsMapper">
-
-    <resultMap type="ProjectSettings" id="ProjectSettingsResult">
-        <result property="id"    column="id"    />
-        <result property="deptId"    column="dept_id"    />
-        <result property="inHisTaskTypes"    column="in_his_task_types"    />
-        <result property="outHisTaskTypes"    column="out_his_task_types"    />
-        <result property="companyId"    column="company_id"    />
-        <result property="createdAt"    column="created_at"    />
-        <result property="updatedAt"    column="updated_at"    />
-        <!--  联表字段 -->
-        <result property="companyName"    column="company_name" />
-        <result property="deptName"       column="dept_name" />
-    </resultMap>
-
-    <sql id="selectProjectSettingsVo">
-        SELECT
-        ps.id,
-        ps.dept_id,
-        ps.in_his_task_types,
-        ps.out_his_task_types,
-        ps.created_at,
-        ps.updated_at,
-        ps.company_id,
-
-        c.company_name AS company_name,
-        d.dept_name    AS dept_name
-        FROM project_settings ps
-        LEFT JOIN company c
-        ON c.company_id = ps.company_id
-        AND IFNULL(c.is_del, 0) = 0
-        LEFT JOIN company_dept d
-        ON d.dept_id = ps.dept_id
-        AND d.del_flag = '0'
-    </sql>
-
-    <select id="selectProjectSettingsList" parameterType="ProjectSettings" resultMap="ProjectSettingsResult">
-        <include refid="selectProjectSettingsVo"/>
-        <where>
-            <if test="deptId != null and deptId != ''">
-                AND ps.dept_id = #{deptId}
-            </if>
-            <if test="companyId != null and companyId != ''">
-                AND ps.company_id = #{companyId}
-            </if>
-            <if test="inHisTaskTypes != null and inHisTaskTypes != ''">
-                AND ps.in_his_task_types = #{inHisTaskTypes}
-            </if>
-            <if test="outHisTaskTypes != null and outHisTaskTypes != ''">
-                AND ps.out_his_task_types = #{outHisTaskTypes}
-            </if>
-            <if test="createdAt != null">
-                AND ps.created_at = #{createdAt}
-            </if>
-            <if test="updatedAt != null">
-                AND ps.updated_at = #{updatedAt}
-            </if>
-        </where>
-        GROUP BY ps.id
-    </select>
-
-    <select id="selectProjectSettingsById"
-            parameterType="long"
-            resultMap="ProjectSettingsResult">
-        <include refid="selectProjectSettingsVo"/>
-        WHERE ps.id = #{id}
-    </select>
-
-    <insert id="insertProjectSettings" parameterType="ProjectSettings" useGeneratedKeys="true" keyProperty="id">
-        INSERT INTO project_settings
-        <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="deptId != null and deptId != ''">dept_id,</if>
-            <if test="inHisTaskTypes != null">in_his_task_types,</if>
-            <if test="outHisTaskTypes != null">out_his_task_types,</if>
-            <if test="companyId != null">company_id,</if>
-            <if test="createdAt != null">created_at,</if>
-            <if test="updatedAt != null">updated_at,</if>
-        </trim>
-        <trim prefix="VALUES (" suffix=")" suffixOverrides=",">
-            <if test="deptId != null and deptId != ''">#{deptId},</if>
-            <if test="inHisTaskTypes != null">#{inHisTaskTypes},</if>
-            <if test="outHisTaskTypes != null">#{outHisTaskTypes},</if>
-            <if test="companyId != null">#{companyId},</if>
-            <if test="createdAt != null">#{createdAt},</if>
-            <if test="updatedAt != null">#{updatedAt},</if>
-        </trim>
-    </insert>
-
-    <update id="updateProjectSettings" parameterType="ProjectSettings">
-        UPDATE project_settings
-        <trim prefix="SET" suffixOverrides=",">
-            <if test="deptId != null and deptId != ''">dept_id = #{deptId},</if>
-            <if test="companyId != null and companyId != ''">company_id = #{companyId},</if>
-            <if test="inHisTaskTypes != null">in_his_task_types = #{inHisTaskTypes},</if>
-            <if test="outHisTaskTypes != null">out_his_task_types = #{outHisTaskTypes},</if>
-            <if test="createdAt != null">created_at = #{createdAt},</if>
-            <if test="updatedAt != null">updated_at = #{updatedAt},</if>
-        </trim>
-        WHERE id = #{id}
-    </update>
-
-    <delete id="deleteProjectSettingsById" parameterType="long">
-        DELETE FROM project_settings WHERE id = #{id}
-    </delete>
-
-    <delete id="deleteProjectSettingsByIds" parameterType="String">
-        DELETE FROM project_settings
-        WHERE id IN
-        <foreach item="id" collection="array" open="(" separator="," close=")">
-            #{id}
-        </foreach>
-    </delete>
-
-    <select id="countByDeptId" parameterType="java.lang.String" resultType="int">
-        SELECT COUNT(1)
-        FROM project_settings ps
-        WHERE ps.dept_id = #{deptId}
-    </select>
-
-    <select id="selectProjectSettingsByCompanyId" parameterType="java.lang.String" resultMap="ProjectSettingsResult">
-        <include refid="selectProjectSettingsVo"/>
-        WHERE ps.company_id = #{companyId}
-        LIMIT 1
-    </select>
-
-</mapper>

+ 0 - 138
fs-service/src/main/resources/mapper/project/ProjectStandardMapper.xml

@@ -1,138 +0,0 @@
-<?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.fs.project.mapper.ProjectStandardMapper">
-
-    <resultMap type="com.fs.project.domain.ProjectStandard" id="ProjectStandardResult">
-        <id property="id" column="id" />
-        <result property="companyId" column="company_id" />
-        <result property="projectType" column="project_type" />
-        <!-- ★ 唯一的新字段 -->
-        <result property="levelConfig" column="level_config" />
-        <result property="taskLimitCount" column="task_limit_count" />
-        <result property="taskLimitPeriod" column="task_limit_period" />
-        <result property="createBy" column="create_by" />
-        <result property="createTime" column="create_time" />
-        <result property="updateBy" column="update_by" />
-        <result property="updateTime" column="update_time" />
-        <result property="delFlag" column="del_flag" />
-        <!-- 连表查询公司名称,映射到实体里不存在的字段?你实体里没有companyName,但VO需要。建议在resultMap中加一个扩展字段,或者直接在查询SQL中处理。这里先保留,后续可优化 -->
-        <result property="companyName" column="company_name" />
-        <!-- 新增字段映射 -->
-        <result property="projectId" column="project_id" />
-        <result property="taskTypes" column="task_types" />
-    </resultMap>
-
-    <sql id="selectProjectStandardVo">
-        SELECT
-        ps.id,
-        ps.company_id,
-        c.company_name,
-        ps.project_type,
-        ps.level_config,
-        ps.task_limit_count,
-        ps.task_limit_period,
-        ps.project_id,
-        ps.task_types,
-        ps.create_by,
-        ps.create_time,
-        ps.update_by,
-        ps.update_time,
-        ps.del_flag
-        FROM project_standard ps
-        LEFT JOIN company c ON ps.company_id = c.company_id
-    </sql>
-
-    <select id="selectProjectStandardList" parameterType="com.fs.project.domain.ProjectStandard" resultMap="ProjectStandardResult">
-        <include refid="selectProjectStandardVo"/>
-        <where>
-            <if test="companyId != null"> AND ps.company_id = #{companyId}</if>
-            <if test="projectType != null and projectType != ''"> AND ps.project_type = #{projectType}</if>
-            <!-- 如果要按公司名称搜索,放开下面 -->
-            <!-- <if test="companyName != null and companyName != ''"> AND c.company_name LIKE CONCAT('%', #{companyName}, '%')</if> -->
-            <if test="taskLimitCount != null"> AND ps.task_limit_count = #{taskLimitCount}</if>
-            <if test="taskLimitPeriod != null and taskLimitPeriod != ''"> AND ps.task_limit_period = #{taskLimitPeriod}</if>
-            <!-- 逻辑删除过滤(如果你的SQL没有自动加,手动加) -->
-            AND ps.del_flag = '0'
-        </where>
-        GROUP BY ps.id
-
-    </select>
-
-    <select id="selectProjectStandardById" parameterType="Long" resultMap="ProjectStandardResult">
-        <include refid="selectProjectStandardVo"/>
-        WHERE ps.id = #{id}
-    </select>
-
-    <!-- 插入:只处理 level_config -->
-    <insert id="insertProjectStandard" parameterType="com.fs.project.domain.ProjectStandard" useGeneratedKeys="true" keyProperty="id">
-        INSERT INTO project_standard (
-        company_id,
-        project_id,
-        task_types,
-        project_type,
-        level_config,
-        task_limit_count,
-        task_limit_period,
-        create_by,
-        create_time,
-        del_flag
-        ) VALUES (
-        #{companyId},
-        #{projectId},
-        #{taskTypes},
-        #{projectType},
-        #{levelConfig},
-        #{taskLimitCount},
-        #{taskLimitPeriod},
-        #{createBy},
-        #{createTime},
-        #{delFlag}
-        )
-    </insert>
-
-    <!-- 更新:只处理 level_config -->
-    <update id="updateProjectStandard" parameterType="com.fs.project.domain.ProjectStandard">
-        UPDATE project_standard
-        SET
-        project_type = #{projectType},
-        level_config = #{levelConfig},
-        task_limit_count = #{taskLimitCount},
-        task_limit_period = #{taskLimitPeriod},
-        project_id = #{projectId},      <!-- 新增 -->
-        task_types = #{taskTypes},      <!-- 新增 -->
-        update_by = #{updateBy},
-        update_time = #{updateTime}
-        WHERE id = #{id}
-    </update>
-
-    <!-- 物理删除(若依通常用逻辑删除,你用了 @TableLogic,这里可改为逻辑删除)
-         如果要用物理删除,保留;否则改为 update set del_flag = '1' -->
-    <delete id="deleteProjectStandardById" parameterType="Long">
-        UPDATE project_standard SET del_flag = '1' WHERE id = #{id}
-    </delete>
-
-    <delete id="deleteProjectStandardByIds" parameterType="String">
-        UPDATE project_standard SET del_flag = '1' WHERE id IN
-        <foreach item="id" collection="array" open="(" separator="," close=")">
-            #{id}
-        </foreach>
-    </delete>
-
-
-    <!-- 根据公司、项目类型、任务类型查询项目标准配置(匹配 task_types 包含指定任务类型或未限制) -->
-    <select id="selectProjectStandardByCompanyIdAndProjectIdAndTaskType" resultMap="ProjectStandardResult">
-        <include refid="selectProjectStandardVo"/>
-        <where>
-            ps.company_id = #{companyId}
-            AND ps.project_id = #{projectId}
-            AND (
-            ps.task_types IS NULL
-            OR ps.task_types = ''
-            OR FIND_IN_SET(#{taskType}, ps.task_types) > 0
-            )
-            AND ps.del_flag = '0'
-        </where>
-        ORDER BY ps.id ASC   <!-- 按ID排序保证结果稳定,可根据业务调整排序 -->
-        LIMIT 1              <!-- 确保只返回一条,避免业务层处理多条 -->
-    </select>
-</mapper>

+ 0 - 181
fs-service/src/main/resources/mapper/project/ProjectTaskTypeMapper.xml

@@ -1,181 +0,0 @@
-<?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.fs.project.mapper.ProjectTaskTypeMapper">
-
-    <resultMap type="ProjectTaskType" id="ProjectTaskTypeResult">
-        <result property="id"    column="id"    />
-        <result property="companyId"    column="company_id"    />
-        <result property="projectId"    column="project_id"    />
-        <result property="deptId"    column="dept_id"    />
-        <result property="taskTypeIds"   column="task_type_ids"  />
-        <result property="productIds"    column="product_ids"    />
-        <result property="maxAmount"    column="max_amount"    />
-        <result property="status"    column="status"    />
-        <result property="createTime"    column="create_time"    />
-        <result property="updateTime"    column="update_time"    />
-        <result property="createBy"    column="create_by"    />
-        <result property="updateBy"    column="update_by"    />
-        <result property="delFlag"    column="del_flag"    />
-        <result property="companyName" column="company_name"/>
-        <result property="projectName" column="project_name"/>
-        <result property="deptName" column="dept_name"/>
-
-    </resultMap>
-
-    <sql id="selectProjectTaskTypeVo">
-        SELECT
-        ptt.id,
-        ptt.company_id,
-        ptt.project_id,
-        ptt.dept_id,
-        ptt.task_type_ids,
-        ptt.product_ids,
-        ptt.max_amount,
-        ptt.status,
-        ptt.create_time,
-        ptt.update_time,
-        ptt.create_by,
-        ptt.update_by,
-        ptt.del_flag,
-
-        c.company_name        AS company_name,
-        p.project_name        AS project_name,
-        cd.dept_name          AS dept_name
-
-        FROM project_task_type ptt
-        LEFT JOIN company c
-        ON c.company_id = ptt.company_id
-        AND c.is_del = 0
-
-        LEFT JOIN project p
-        ON p.id = ptt.project_id
-        AND p.del_flag = 0
-
-        LEFT JOIN company_dept cd
-        ON cd.dept_id = ptt.dept_id
-        AND cd.del_flag = '0'
-    </sql>
-
-
-
-    <select id="selectProjectTaskTypeList"
-            parameterType="ProjectTaskType"
-            resultMap="ProjectTaskTypeResult">
-        <include refid="selectProjectTaskTypeVo"/>
-        <where>
-            <if test="companyId != null"> and ptt.company_id = #{companyId}</if>
-            <if test="projectId != null"> and ptt.project_id = #{projectId}</if>
-            <if test="deptId != null"> and ptt.dept_id = #{deptId}</if>
-            <if test="taskTypeIds != null and taskTypeIds != ''">
-                and ptt.task_type_ids = #{taskTypeIds}
-            </if>
-            <if test="productIds != null and productIds != ''">
-                and ptt.product_ids = #{productIds}
-            </if>
-            <if test="maxAmount != null"> and ptt.max_amount = #{maxAmount}</if>
-            <if test="status != null"> and ptt.status = #{status}</if>
-        </where>
-
-        GROUP BY ptt.id
-
-    </select>
-
-
-    <select id="selectProjectTaskTypeById"
-            parameterType="Long"
-            resultMap="ProjectTaskTypeResult">
-        <include refid="selectProjectTaskTypeVo"/>
-        where ptt.id = #{id}
-    </select>
-
-
-    <insert id="insertProjectTaskType" parameterType="ProjectTaskType" useGeneratedKeys="true" keyProperty="id">
-        insert into project_task_type
-        <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="companyId != null">company_id,</if>
-            <if test="projectId != null">project_id,</if>
-            <if test="deptId != null">dept_id,</if>
-            <if test="taskTypeIds != null">task_type_ids,</if>
-            <if test="productIds != null">product_ids,</if>
-            <if test="maxAmount != null">max_amount,</if>
-            <if test="status != null">status,</if>
-            <if test="createTime != null">create_time,</if>
-            <if test="updateTime != null">update_time,</if>
-            <if test="createBy != null">create_by,</if>
-            <if test="updateBy != null">update_by,</if>
-            <if test="delFlag != null">del_flag,</if>
-         </trim>
-        <trim prefix="values (" suffix=")" suffixOverrides=",">
-            <if test="companyId != null">#{companyId},</if>
-            <if test="projectId != null">#{projectId},</if>
-            <if test="deptId != null">#{deptId},</if>
-            <if test="taskTypeIds != null">#{taskTypeIds},</if>
-            <if test="productIds != null">#{productIds},</if>
-            <if test="maxAmount != null">#{maxAmount},</if>
-            <if test="status != null">#{status},</if>
-            <if test="createTime != null">#{createTime},</if>
-            <if test="updateTime != null">#{updateTime},</if>
-            <if test="createBy != null">#{createBy},</if>
-            <if test="updateBy != null">#{updateBy},</if>
-            <if test="delFlag != null">#{delFlag},</if>
-         </trim>
-    </insert>
-
-    <update id="updateProjectTaskType" parameterType="ProjectTaskType">
-        update project_task_type
-        <trim prefix="SET" suffixOverrides=",">
-            <if test="companyId != null">company_id = #{companyId},</if>
-            <if test="projectId != null">project_id = #{projectId},</if>
-            <if test="deptId != null">dept_id = #{deptId},</if>
-            <if test="taskTypeIds != null">task_type_ids = #{taskTypeIds},</if>
-            <if test="productIds != null">product_ids = #{productIds},</if>
-            <if test="maxAmount != null">max_amount = #{maxAmount},</if>
-            <if test="status != null">status = #{status},</if>
-            <if test="createTime != null">create_time = #{createTime},</if>
-            <if test="updateTime != null">update_time = #{updateTime},</if>
-            <if test="createBy != null">create_by = #{createBy},</if>
-            <if test="updateBy != null">update_by = #{updateBy},</if>
-            <if test="delFlag != null">del_flag = #{delFlag},</if>
-        </trim>
-        where id = #{id}
-    </update>
-
-    <delete id="deleteProjectTaskTypeById" parameterType="Long">
-        delete from project_task_type where id = #{id}
-    </delete>
-
-    <delete id="deleteProjectTaskTypeByIds" parameterType="String">
-        delete from project_task_type where id in
-        <foreach item="id" collection="array" open="(" separator="," close=")">
-            #{id}
-        </foreach>
-    </delete>
-
-    <select id="selectProjectOptionsByDept"  resultType="com.fs.project.vo.ProjectOptionVO">
-        SELECT DISTINCT p.id AS projectId, p.project_name AS projectName
-        FROM project_task_type ptt
-        JOIN project p ON p.id = ptt.project_id
-        WHERE ptt.del_flag = 0
-        AND ptt.status = 1
-        AND ptt.dept_id = #{deptId}
-
-        <if test="projectName != null and projectName != ''">
-            AND p.project_name LIKE CONCAT('%', #{projectName}, '%')
-        </if>
-        ORDER BY p.project_name
-        LIMIT 50
-
-    </select>
-    <select id="queryAllData" resultType="com.fs.project.domain.ProjectTaskType">
-        select * from project_task_type
-        <where>
-            <if test="companyId != null">AND company_id = #{companyId}</if>
-            <if test="deptId != null">AND dept_id = #{deptId}</if>
-            <if test="productId != null">
-                AND FIND_IN_SET(#{productId}, product_ids) > 0
-            </if>
-        </where>
-    </select>
-</mapper>

+ 0 - 171
fs-service/src/main/resources/mapper/provider/ServiceGenConfigMapper.xml

@@ -1,171 +0,0 @@
-<?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.fs.provider.mapper.ServiceGenConfigMapper">
-    
-    <resultMap type="ServiceGenConfig" id="ServiceGenConfigResult">
-        <result property="id"    column="id"    />
-        <result property="departmentId"    column="department_id"    />
-        <result property="taskTypes"    column="task_types"    />
-        <result property="frequencyUnit"    column="frequency_unit"    />
-        <result property="frequencyValue"    column="frequency_value"    />
-        <result property="generateTime"    column="generate_time"    />
-        <result property="createdAt"    column="created_at"    />
-        <result property="updatedAt"    column="updated_at"    />
-        <result property="companyId"    column="company_id"    />
-        <result property="needAudit"    column="need_audit"    />
-        <result property="companyName" column="company_name"/>
-        <result property="departmentName" column="dept_name"/>
-        <result property="auditInstanceId" column="audit_instance_id"/>
-        <result property="auditStatus"     column="audit_status"/>
-    </resultMap>
-
-    <sql id="selectServiceGenConfigVo">
-        SELECT
-        c.id,
-        c.department_id,
-        c.task_types,
-        c.frequency_unit,
-        c.frequency_value,
-        c.generate_time,
-        c.created_at,
-        c.updated_at,
-        c.company_id,
-        c.need_audit,
-        c.audit_instance_id,
-        c.audit_status,
-        co.company_name,
-        cd.dept_name
-        FROM service_gen_config c
-        LEFT JOIN company co ON co.company_id = c.company_id
-        LEFT JOIN company_dept cd ON cd.dept_id = c.department_id
-    </sql>
-
-
-    <select id="selectServiceGenConfigList" parameterType="ServiceGenConfig" resultMap="ServiceGenConfigResult">
-        <include refid="selectServiceGenConfigVo"/>
-        <where>
-            <!-- 这里我顺手把列名都加 c. 前缀,避免 join 后歧义 ✅ -->
-            <if test="departmentId != null"> AND c.department_id = #{departmentId}</if>
-            <if test="taskTypes != null and taskTypes != ''"> AND FIND_IN_SET(#{taskTypes}, c.task_types)</if>
-            <if test="frequencyUnit != null"> AND c.frequency_unit = #{frequencyUnit}</if>
-            <if test="frequencyValue != null"> AND c.frequency_value = #{frequencyValue}</if>
-            <if test="generateTime != null"> AND c.generate_time = #{generateTime}</if>
-            <if test="createdAt != null"> AND c.created_at = #{createdAt}</if>
-            <if test="updatedAt != null"> AND c.updated_at = #{updatedAt}</if>
-            <if test="companyId != null"> AND c.company_id = #{companyId}</if>
-            <if test="needAudit != null"> AND c.need_audit = #{needAudit}</if>
-            <!-- ✅ 可选:按审核状态筛选 -->
-            <if test="auditStatus != null"> AND c.audit_status = #{auditStatus}</if>
-        </where>
-        order by c.created_at desc
-    </select>
-    
-    <select id="selectServiceGenConfigById" parameterType="java.lang.Long" resultMap="ServiceGenConfigResult">
-        <include refid="selectServiceGenConfigVo"/>
-        WHERE c.id = #{id}
-    </select>
-        
-    <insert id="insertServiceGenConfig" parameterType="ServiceGenConfig" useGeneratedKeys="true" keyProperty="id">
-        insert into service_gen_config
-        <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="departmentId != null and departmentId != ''">department_id,</if>
-            <if test="taskTypes != null and taskTypes != ''">task_types,</if>
-            <if test="frequencyUnit != null and frequencyUnit != ''">frequency_unit,</if>
-            <if test="frequencyValue != null and frequencyValue != ''">frequency_value,</if>
-            <if test="generateTime != null">generate_time,</if>
-            <if test="createdAt != null">created_at,</if>
-            <if test="updatedAt != null">updated_at,</if>
-            <if test="companyId != null">company_id,</if>
-            <if test="needAudit != null">need_audit,</if>
-            <if test="auditInstanceId != null">audit_instance_id,</if>
-            <if test="auditStatus != null">audit_status,</if>
-         </trim>
-        <trim prefix="values (" suffix=")" suffixOverrides=",">
-            <if test="departmentId != null and departmentId != ''">#{departmentId},</if>
-            <if test="taskTypes != null and taskTypes != ''">#{taskTypes},</if>
-            <if test="frequencyUnit != null and frequencyUnit != ''">#{frequencyUnit},</if>
-            <if test="frequencyValue != null and frequencyValue != ''">#{frequencyValue},</if>
-            <if test="generateTime != null">#{generateTime},</if>
-            <if test="createdAt != null">#{createdAt},</if>
-            <if test="updatedAt != null">#{updatedAt},</if>
-            <if test="companyId != null">#{companyId},</if>
-            <if test="needAudit != null">#{needAudit},</if>
-            <if test="auditInstanceId != null">#{auditInstanceId},</if>
-            <if test="auditStatus != null">#{auditStatus},</if>
-         </trim>
-    </insert>
-
-    <update id="updateServiceGenConfig" parameterType="ServiceGenConfig">
-        update service_gen_config
-        <trim prefix="SET" suffixOverrides=",">
-            <if test="departmentId != null and departmentId != ''">department_id = #{departmentId},</if>
-            <if test="taskTypes != null and taskTypes != ''">task_types = #{taskTypes},</if>
-            <if test="frequencyUnit != null and frequencyUnit != ''">frequency_unit = #{frequencyUnit},</if>
-            <if test="frequencyValue != null and frequencyValue != ''">frequency_value = #{frequencyValue},</if>
-            <if test="generateTime != null">generate_time = #{generateTime},</if>
-            <if test="createdAt != null">created_at = #{createdAt},</if>
-            <if test="updatedAt != null">updated_at = #{updatedAt},</if>
-            <if test="companyId != null">company_id = #{companyId},</if>
-            <if test="needAudit != null">need_audit = #{needAudit},</if>
-            <!-- ✅ 新增:审核字段 -->
-            <if test="auditInstanceId != null">audit_instance_id = #{auditInstanceId},</if>
-            <if test="auditStatus != null">audit_status = #{auditStatus},</if>
-        </trim>
-        where id = #{id}
-    </update>
-
-    <delete id="deleteServiceGenConfigById" parameterType="java.lang.Long">
-        delete from service_gen_config where id = #{id}
-    </delete>
-
-    <delete id="deleteServiceGenConfigByIds" parameterType="String">
-        delete from service_gen_config where id in 
-        <foreach item="id" collection="array" open="(" separator="," close=")">
-            #{id}
-        </foreach>
-    </delete>
-
-
-
-    <select id="selectDueConfigs" resultType="com.fs.provider.domain.ServiceGenConfig">
-        SELECT
-        id, department_id, task_types, frequency_unit, frequency_value, generate_time,
-        created_at, updated_at, company_id, need_audit, audit_instance_id, audit_status
-        FROM service_gen_config
-        WHERE 1=1
-
-        <!-- ① 审核过滤:need_audit=0 或者 need_audit=1且审核通过 -->
-        AND (
-        need_audit = 0
-        OR (need_audit = 1 AND audit_status = 1)
-        )
-
-        <!-- ② 周期过滤:天/周/月 -->
-        AND (
-        frequency_unit = 1
-        OR (frequency_unit = 2 AND frequency_value = #{dow})
-        OR (frequency_unit = 3 AND frequency_value = #{dom})
-        )
-
-        <!-- ③ 时间窗口过滤(处理跨天) -->
-        <choose>
-            <!-- 不跨天:start <= end -->
-            <when test="crossDay == false">
-                AND generate_time <![CDATA[ >= ]]> #{startTime}
-                AND generate_time <![CDATA[ < ]]> #{endTime}
-            </when>
-
-            <!-- 跨天:start > end -->
-            <otherwise>
-                AND (
-                generate_time <![CDATA[ >= ]]> #{startTime}
-                OR generate_time <![CDATA[ < ]]> #{endTime}
-                )
-            </otherwise>
-        </choose>
-
-        ORDER BY company_id, department_id, id
-    </select>
-</mapper>

+ 0 - 53
fs-service/src/main/resources/mapper/provider/ServiceGenConfigRunLogMapper.xml

@@ -1,53 +0,0 @@
-<?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.fs.provider.mapper.ServiceGenConfigRunLogMapper">
-
-    <!-- 抢占执行权:插入成功返回1;如果(config_id,run_key)已存在则返回0 -->
-    <insert id="insertIgnoreForClaim" parameterType="com.fs.provider.domain.ServiceGenConfigRunLog">
-        INSERT IGNORE INTO service_gen_config_run_log
-        (config_id, run_key, frequency_unit, status, started_at, server_id, created_at, updated_at)
-        VALUES
-        (#{configId}, #{runKey}, #{frequencyUnit}, #{status}, #{startedAt}, #{serverId}, NOW(), NOW())
-    </insert>
-
-    <update id="markSuccess" parameterType="com.fs.provider.domain.ServiceGenConfigRunLog">
-        UPDATE service_gen_config_run_log
-        SET status = 1,
-        finished_at = NOW(),
-        task_total = #{taskTotal},
-        task_created = #{taskCreated},
-        order_created = #{orderCreated},
-        remark = #{remark},
-        updated_at = NOW()
-        WHERE config_id = #{configId}
-        AND run_key = #{runKey}
-    </update>
-
-    <update id="markFailed" parameterType="com.fs.provider.domain.ServiceGenConfigRunLog">
-        UPDATE service_gen_config_run_log
-        SET status = 2,
-        finished_at = NOW(),
-        remark = #{remark},
-        updated_at = NOW()
-        WHERE config_id = #{configId}
-        AND run_key = #{runKey}
-    </update>
-
-    <!-- 可选:一般不用 -->
-    <select id="exists" resultType="java.lang.Integer">
-        SELECT 1
-        FROM service_gen_config_run_log
-        WHERE config_id = #{configId}
-        AND run_key = #{runKey}
-        LIMIT 1
-    </select>
-
-
-
-
-
-
-
-</mapper>

+ 0 - 337
fs-service/src/main/resources/mapper/provider/ServiceOrderMapper.xml

@@ -1,337 +0,0 @@
-<?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.fs.provider.mapper.ServiceOrderMapper">
-
-    <resultMap type="ServiceOrder" id="ServiceOrderResult">
-        <result property="id"    column="id"    />
-        <result property="serviceOrderNo"    column="service_order_no"    />
-        <result property="companyName"    column="company_name"    />
-        <result property="companyId"    column="company_id"    />
-        <result property="doctorId"    column="doctor_id"    />
-        <result property="doctorName"    column="doctor_name"    />
-        <result property="deptId"    column="dept_id"    />
-        <result property="deptName"    column="dept_name"    />
-        <result property="settlementMethod"    column="settlement_method"    />
-        <result property="taskAmount"    column="task_amount"    />
-        <result property="afterTaxAmount"    column="after_tax_amount"    />
-        <result property="serviceFeeRate"    column="service_fee_rate"    />
-        <result property="serviceFeeAmount"    column="service_fee_amount"    />
-        <result property="totalAmount"    column="total_amount"    />
-        <result property="auditStatus"    column="audit_status"    />
-        <result property="auditTime"    column="audit_time"    />
-        <result property="doctorConfirm"    column="doctor_confirm"    />
-        <result property="settlementStatus"    column="settlement_status"    />
-        <result property="settlementTime"    column="settlement_time"    />
-        <result property="initiatorUserId"    column="initiator_user_id"    />
-        <result property="initiatorName"    column="initiator_name"    />
-        <result property="initiatorPhone"    column="initiator_phone"    />
-        <result property="createTime"    column="create_time"    />
-        <result property="updateTime"    column="update_time"    />
-        <result property="createBy"    column="create_by"    />
-        <result property="updateBy"    column="update_by"    />
-        <result property="deleted"    column="deleted"    />
-    </resultMap>
-
-    <sql id="selectServiceOrderVo">
-        select id, service_order_no, company_id,company_name, doctor_id,doctor_name,dept_id, dept_name, settlement_method, task_amount, after_tax_amount, service_fee_rate, service_fee_amount, total_amount, audit_status, audit_time, doctor_confirm, settlement_status, settlement_time, initiator_user_id, initiator_name, initiator_phone, create_time, update_time, create_by, update_by, deleted from service_order
-    </sql>
-
-    <select id="selectServiceOrderList" parameterType="ServiceOrder" resultMap="ServiceOrderResult">
-        <include refid="selectServiceOrderVo"/>
-        <where>
-            <if test="serviceOrderNo != null  and serviceOrderNo != ''"> and service_order_no = #{serviceOrderNo}</if>
-            <if test="companyId != null"> and company_id = #{companyId}</if>
-            <if test="companyName != null  and companyName != ''"> and company_name like concat('%', #{companyName}, '%')</if>
-            <if test="deptId != null "> and dept_id = #{deptId}</if>
-            <if test="deptName != null  and deptName != ''"> and dept_name like concat('%', #{deptName}, '%')</if>
-            <if test="settlementMethod != null  and settlementMethod != ''"> and settlement_method = #{settlementMethod}</if>
-            <if test="taskAmount != null "> and task_amount = #{taskAmount}</if>
-            <if test="afterTaxAmount != null "> and after_tax_amount = #{afterTaxAmount}</if>
-            <if test="serviceFeeRate != null "> and service_fee_rate = #{serviceFeeRate}</if>
-            <if test="serviceFeeAmount != null "> and service_fee_amount = #{serviceFeeAmount}</if>
-            <if test="totalAmount != null "> and total_amount = #{totalAmount}</if>
-            <if test="auditStatus != null "> and audit_status = #{auditStatus}</if>
-            <if test="auditTime != null "> and audit_time = #{auditTime}</if>
-            <if test="doctorConfirm != null "> and doctor_confirm = #{doctorConfirm}</if>
-            <if test="settlementStatus != null "> and settlement_status = #{settlementStatus}</if>
-            <if test="settlementTime != null "> and settlement_time = #{settlementTime}</if>
-            <if test="initiatorUserId != null "> and initiator_user_id = #{initiatorUserId}</if>
-            <if test="initiatorName != null  and initiatorName != ''"> and initiator_name like concat('%', #{initiatorName}, '%')</if>
-            <if test="initiatorPhone != null  and initiatorPhone != ''"> and initiator_phone = #{initiatorPhone}</if>
-            <if test="deleted != null "> and deleted = #{deleted}</if>
-            <if test="doctorId != null "> and doctor_id = #{doctorId}</if>
-        </where>
-        order by create_time desc
-    </select>
-
-    <select id="selectServiceOrderById" parameterType="Long" resultMap="ServiceOrderResult">
-        <include refid="selectServiceOrderVo"/>
-        where id = #{id}
-    </select>
-
-    <insert id="insertServiceOrder" parameterType="ServiceOrder" useGeneratedKeys="true" keyProperty="id">
-        insert into service_order
-        <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="serviceOrderNo != null and serviceOrderNo != ''">service_order_no,</if>
-            <if test="companyName != null">company_name,</if>
-            <if test="companyId != null">company_id,</if>
-            <if test="deptId != null">dept_id,</if>
-            <if test="deptName != null">dept_name,</if>
-            <if test="settlementMethod != null">settlement_method,</if>
-            <if test="taskAmount != null">task_amount,</if>
-            <if test="afterTaxAmount != null">after_tax_amount,</if>
-            <if test="serviceFeeRate != null">service_fee_rate,</if>
-            <if test="serviceFeeAmount != null">service_fee_amount,</if>
-            <if test="totalAmount != null">total_amount,</if>
-            <if test="auditStatus != null">audit_status,</if>
-            <if test="auditTime != null">audit_time,</if>
-            <if test="doctorConfirm != null">doctor_confirm,</if>
-            <if test="settlementStatus != null">settlement_status,</if>
-            <if test="settlementTime != null">settlement_time,</if>
-            <if test="initiatorUserId != null">initiator_user_id,</if>
-            <if test="initiatorName != null">initiator_name,</if>
-            <if test="initiatorPhone != null">initiator_phone,</if>
-            <if test="createTime != null">create_time,</if>
-            <if test="updateTime != null">update_time,</if>
-            <if test="createBy != null">create_by,</if>
-            <if test="updateBy != null">update_by,</if>
-            <if test="deleted != null">deleted,</if>
-            <if test="doctorId != null">doctor_id,</if>
-            <if test="doctorName != null">doctor_name,</if>
-
-         </trim>
-        <trim prefix="values (" suffix=")" suffixOverrides=",">
-            <if test="serviceOrderNo != null and serviceOrderNo != ''">#{serviceOrderNo},</if>
-            <if test="companyName != null">#{companyName},</if>
-            <if test="companyId != null">#{companyId},</if>
-            <if test="deptId != null">#{deptId},</if>
-            <if test="deptName != null">#{deptName},</if>
-            <if test="settlementMethod != null">#{settlementMethod},</if>
-            <if test="taskAmount != null">#{taskAmount},</if>
-            <if test="afterTaxAmount != null">#{afterTaxAmount},</if>
-            <if test="serviceFeeRate != null">#{serviceFeeRate},</if>
-            <if test="serviceFeeAmount != null">#{serviceFeeAmount},</if>
-            <if test="totalAmount != null">#{totalAmount},</if>
-            <if test="auditStatus != null">#{auditStatus},</if>
-            <if test="auditTime != null">#{auditTime},</if>
-            <if test="doctorConfirm != null">#{doctorConfirm},</if>
-            <if test="settlementStatus != null">#{settlementStatus},</if>
-            <if test="settlementTime != null">#{settlementTime},</if>
-            <if test="initiatorUserId != null">#{initiatorUserId},</if>
-            <if test="initiatorName != null">#{initiatorName},</if>
-            <if test="initiatorPhone != null">#{initiatorPhone},</if>
-            <if test="createTime != null">#{createTime},</if>
-            <if test="updateTime != null">#{updateTime},</if>
-            <if test="createBy != null">#{createBy},</if>
-            <if test="updateBy != null">#{updateBy},</if>
-            <if test="deleted != null">#{deleted},</if>
-            <if test="doctorId != null">#{doctorId},</if>
-            <if test="doctorName != null">#{doctorName},</if>
-         </trim>
-    </insert>
-
-    <update id="updateServiceOrder" parameterType="ServiceOrder">
-        update service_order
-        <trim prefix="SET" suffixOverrides=",">
-            <if test="serviceOrderNo != null and serviceOrderNo != ''">service_order_no = #{serviceOrderNo},</if>
-            <if test="companyName != null">company_name = #{companyName},</if>
-            <if test="companyId != null">company_Id = #{companyId},</if>
-            <if test="deptId != null">dept_id = #{deptId},</if>
-            <if test="deptName != null">dept_name = #{deptName},</if>
-            <if test="settlementMethod != null">settlement_method = #{settlementMethod},</if>
-            <if test="taskAmount != null">task_amount = #{taskAmount},</if>
-            <if test="afterTaxAmount != null">after_tax_amount = #{afterTaxAmount},</if>
-            <if test="serviceFeeRate != null">service_fee_rate = #{serviceFeeRate},</if>
-            <if test="serviceFeeAmount != null">service_fee_amount = #{serviceFeeAmount},</if>
-            <if test="totalAmount != null">total_amount = #{totalAmount},</if>
-            <if test="auditStatus != null">audit_status = #{auditStatus},</if>
-            <if test="auditTime != null">audit_time = #{auditTime},</if>
-            <if test="doctorConfirm != null">doctor_confirm = #{doctorConfirm},</if>
-            <if test="settlementStatus != null">settlement_status = #{settlementStatus},</if>
-            <if test="settlementTime != null">settlement_time = #{settlementTime},</if>
-            <if test="initiatorUserId != null">initiator_user_id = #{initiatorUserId},</if>
-            <if test="initiatorName != null">initiator_name = #{initiatorName},</if>
-            <if test="initiatorPhone != null">initiator_phone = #{initiatorPhone},</if>
-            <if test="createTime != null">create_time = #{createTime},</if>
-            <if test="updateTime != null">update_time = #{updateTime},</if>
-            <if test="createBy != null">create_by = #{createBy},</if>
-            <if test="updateBy != null">update_by = #{updateBy},</if>
-            <if test="deleted != null">deleted = #{deleted},</if>
-        </trim>
-        where id = #{id}
-    </update>
-
-    <delete id="deleteServiceOrderById" parameterType="Long">
-        delete from service_order where id = #{id}
-    </delete>
-
-    <delete id="deleteServiceOrderByIds" parameterType="String">
-        delete from service_order where id in
-        <foreach item="id" collection="array" open="(" separator="," close=")">
-            #{id}
-        </foreach>
-    </delete>
-
-    <!-- 幂等抢占:只有仍满足条件的订单才能更新成功 -->
-    <update id="markAutoConfirmed">
-        update service_order
-        set doctor_confirm = 1,
-        settlement_status = 1,
-        settlement_time = #{settlementTime}
-        where id = #{orderId}
-        and deleted = 0
-        and doctor_confirm = 0
-        and settlement_status = 0
-        and audit_status in (1, 3)
-        and (
-        (audit_status = 3 and create_time &lt;= date_sub(now(), interval 30 minute))
-        or (audit_status = 1 and audit_time &lt;= date_sub(now(), interval 30 minute))
-        )
-    </update>
-
-
-
-
-    <select id="selectNeedAutoConfirmIds" resultType="java.lang.Long">
-        select id
-        from service_order
-        where deleted = 0
-        and doctor_confirm = 0
-        and settlement_status = 0
-        and audit_status in (1, 3)
-        and (
-        (audit_status = 3 and create_time &lt;= date_sub(now(), interval 30 minute))
-        or (audit_status = 1 and audit_time &lt;= date_sub(now(), interval 30 minute))
-        )
-        order by create_time asc
-        limit #{limit}
-    </select>
-    <select id="queryStatis" resultType="com.fs.provider.domain.ServiceOrder">
-        -- 服务单统计(含任务类型)
-        SELECT
-        so.dept_id AS dept_id,
-        so.dept_name AS dept_name,
-        ti.task_type AS task_type,
-        so.company_name AS company_name,
-        so.initiator_user_id AS company_user_id,
-        so.initiator_name AS initiator_name,
-        COUNT(DISTINCT so.service_order_no) AS service_order_count,
-        COUNT(DISTINCT ti.task_no) AS task_count,
-        SUM(so.total_amount) AS total_amount
-        FROM service_order so
-        LEFT JOIN service_order_task_rel sot ON so.id = sot.service_order_id AND sot.deleted = 0
-        LEFT JOIN task_info ti ON sot.task_id = ti.id AND ti.deleted = 0
-        <where>
-            so.deleted = 0
-            <if test="companyId != null">
-                AND so.company_id = #{companyId}
-            </if>
-            <if test="companyUserId != null">
-                AND so.initiator_user_id = #{companyUserId}
-            </if>
-            <if test="startDate != null and endDate != null">
-                AND so.create_time BETWEEN #{startDate} AND #{endDate}
-            </if>
-            <if test="taskType != null and taskType != ''">
-                AND ti.task_type = #{taskType}
-            </if>
-            <if test="taskStatus != null and taskStatus != ''">
-                AND ti.task_status = #{taskStatus}
-            </if>
-        </where>
-        GROUP BY so.dept_id, so.dept_name, ti.task_type, so.company_name, so.initiator_user_id, so.initiator_name
-        ORDER BY so.dept_id, ti.task_type
-    </select>
-
-    <!-- 服务单统计汇总(按部门分组) -->
-    <resultMap id="ServiceOrderStatisticsResult" type="com.fs.provider.vo.ServiceOrderStatisticsVO">
-        <result property="deptId" column="dept_id"/>
-        <result property="deptName" column="dept_name"/>
-        <result property="serviceOrderCount" column="service_order_count"/>
-        <result property="taskCount" column="task_count"/>
-        <result property="companyUserCount" column="company_user_count"/>
-        <result property="doctorCount" column="doctor_count"/>
-        <result property="totalAmount" column="total_amount"/>
-        <result property="taskAmount" column="task_amount"/>
-        <result property="serviceFeeAmount" column="service_fee_amount"/>
-    </resultMap>
-
-    <select id="selectServiceOrderStatistics" parameterType="com.fs.provider.vo.ServiceOrderStatisticsReqVO"
-            resultMap="ServiceOrderStatisticsResult">
-        SELECT
-            so.dept_id,
-            so.dept_name,
-            COUNT(DISTINCT so.id) AS service_order_count,
-            COUNT(DISTINCT rel.task_id) AS task_count,
-            COUNT(DISTINCT so.initiator_user_id) AS company_user_count,
-            COUNT(DISTINCT ti.doctor_id) AS doctor_count,
-            COALESCE(SUM(so.total_amount), 0) AS total_amount,
-            COALESCE(SUM(so.task_amount), 0) AS task_amount
-        FROM service_order so
-        LEFT JOIN service_order_task_rel rel ON so.id = rel.service_order_id AND rel.deleted = 0
-        LEFT JOIN task_info ti ON rel.task_id = ti.id AND ti.deleted = 0
-        <where>
-            so.deleted = 0
-            <if test="companyId != null">
-                AND so.company_id = #{companyId}
-            </if>
-            <if test="deptId != null">
-                AND so.dept_id = #{deptId}
-            </if>
-            <if test="startTime != null">
-                AND so.create_time &gt;= #{startTime}
-            </if>
-            <if test="endTime != null">
-                AND so.create_time &lt;= #{endTime}
-            </if>
-            <if test="auditStatus != null">
-                AND so.audit_status = #{auditStatus}
-            </if>
-            <if test="settlementStatus != null">
-                AND so.settlement_status = #{settlementStatus}
-            </if>
-        </where>
-        GROUP BY so.dept_id, so.dept_name
-        ORDER BY so.dept_id
-    </select>
-    <select id="selectServiceOrderStatCount" resultType="java.lang.Long">
-        SELECT
-        so.dept_id,
-        so.dept_name,
-        COUNT(DISTINCT so.id) AS service_order_count,
-        COUNT(DISTINCT rel.task_id) AS task_count,
-        COUNT(DISTINCT so.initiator_user_id) AS company_user_count,
-        COUNT(DISTINCT ti.doctor_id) AS doctor_count,
-        COALESCE(SUM(so.total_amount), 0) AS total_amount,
-        COALESCE(SUM(so.task_amount), 0) AS task_amount
-        FROM service_order so
-        LEFT JOIN service_order_task_rel rel ON so.id = rel.service_order_id AND rel.deleted = 0
-        LEFT JOIN task_info ti ON rel.task_id = ti.id AND ti.deleted = 0
-        <where>
-            so.deleted = 0
-            <if test="companyId != null">
-                AND so.company_id = #{companyId}
-            </if>
-            <if test="deptId != null">
-                AND so.dept_id = #{deptId}
-            </if>
-            <if test="startTime != null">
-                AND so.create_time &gt;= #{startTime}
-            </if>
-            <if test="endTime != null">
-                AND so.create_time &lt;= #{endTime}
-            </if>
-            <if test="auditStatus != null">
-                AND so.audit_status = #{auditStatus}
-            </if>
-            <if test="settlementStatus != null">
-                AND so.settlement_status = #{settlementStatus}
-            </if>
-        </where>
-        GROUP BY so.dept_id, so.dept_name
-        ORDER BY so.dept_id
-    </select>
-
-</mapper>

+ 0 - 83
fs-service/src/main/resources/mapper/provider/ServiceOrderTaskRelMapper.xml

@@ -1,83 +0,0 @@
-<?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.fs.provider.mapper.ServiceOrderTaskRelMapper">
-    
-    <resultMap type="ServiceOrderTaskRel" id="ServiceOrderTaskRelResult">
-        <result property="id"    column="id"    />
-        <result property="serviceOrderId"    column="service_order_id"    />
-        <result property="taskId"    column="task_id"    />
-        <result property="createTime"    column="create_time"    />
-        <result property="updateTime"    column="update_time"    />
-        <result property="createBy"    column="create_by"    />
-        <result property="updateBy"    column="update_by"    />
-        <result property="deleted"    column="deleted"    />
-    </resultMap>
-
-    <sql id="selectServiceOrderTaskRelVo">
-        select id, service_order_id, task_id, create_time, update_time, create_by, update_by, deleted from service_order_task_rel
-    </sql>
-
-    <select id="selectServiceOrderTaskRelList" parameterType="ServiceOrderTaskRel" resultMap="ServiceOrderTaskRelResult">
-        <include refid="selectServiceOrderTaskRelVo"/>
-        <where>  
-            <if test="serviceOrderId != null "> and service_order_id = #{serviceOrderId}</if>
-            <if test="taskId != null  and taskId != ''"> and task_id = #{taskId}</if>
-            <if test="deleted != null "> and deleted = #{deleted}</if>
-        </where>
-        order by create_time desc
-    </select>
-    
-    <select id="selectServiceOrderTaskRelById" parameterType="Long" resultMap="ServiceOrderTaskRelResult">
-        <include refid="selectServiceOrderTaskRelVo"/>
-        where id = #{id}
-    </select>
-        
-    <insert id="insertServiceOrderTaskRel" parameterType="ServiceOrderTaskRel" useGeneratedKeys="true" keyProperty="id">
-        insert into service_order_task_rel
-        <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="serviceOrderId != null">service_order_id,</if>
-            <if test="taskId != null and taskId != ''">task_id,</if>
-            <if test="createTime != null">create_time,</if>
-            <if test="updateTime != null">update_time,</if>
-            <if test="createBy != null">create_by,</if>
-            <if test="updateBy != null">update_by,</if>
-            <if test="deleted != null">deleted,</if>
-         </trim>
-        <trim prefix="values (" suffix=")" suffixOverrides=",">
-            <if test="serviceOrderId != null">#{serviceOrderId},</if>
-            <if test="taskId != null and taskId != ''">#{taskId},</if>
-            <if test="createTime != null">#{createTime},</if>
-            <if test="updateTime != null">#{updateTime},</if>
-            <if test="createBy != null">#{createBy},</if>
-            <if test="updateBy != null">#{updateBy},</if>
-            <if test="deleted != null">#{deleted},</if>
-         </trim>
-    </insert>
-
-    <update id="updateServiceOrderTaskRel" parameterType="ServiceOrderTaskRel">
-        update service_order_task_rel
-        <trim prefix="SET" suffixOverrides=",">
-            <if test="serviceOrderId != null">service_order_id = #{serviceOrderId},</if>
-            <if test="taskId != null and taskId != ''">task_id = #{taskId},</if>
-            <if test="createTime != null">create_time = #{createTime},</if>
-            <if test="updateTime != null">update_time = #{updateTime},</if>
-            <if test="createBy != null">create_by = #{createBy},</if>
-            <if test="updateBy != null">update_by = #{updateBy},</if>
-            <if test="deleted != null">deleted = #{deleted},</if>
-        </trim>
-        where id = #{id}
-    </update>
-
-    <delete id="deleteServiceOrderTaskRelById" parameterType="Long">
-        delete from service_order_task_rel where id = #{id}
-    </delete>
-
-    <delete id="deleteServiceOrderTaskRelByIds" parameterType="String">
-        delete from service_order_task_rel where id in 
-        <foreach item="id" collection="array" open="(" separator="," close=")">
-            #{id}
-        </foreach>
-    </delete>
-</mapper>

+ 0 - 198
fs-service/src/main/resources/mapper/survey/DrugResearchMapper.xml

@@ -1,198 +0,0 @@
-<?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.fs.survey.mapper.DrugResearchMapper">
-
-    <resultMap type="DrugResearch" id="DrugResearchResult">
-        <result property="id"    column="id"    />
-        <result property="title"    column="title"    />
-        <result property="description"    column="description"    />
-        <result property="coverImage"    column="cover_image"    />
-        <result property="formId"    column="form_id"    />
-        <result property="doctorId"    column="doctor_id"    />
-        <result property="category"    column="category"    />
-        <result property="startTime"    column="start_time"    />
-        <result property="endTime"    column="end_time"    />
-        <result property="status"    column="status"    />
-        <result property="sort"    column="sort"    />
-        <result property="createBy"    column="create_by"    />
-        <result property="createTime"    column="create_time"    />
-        <result property="updateTime"    column="update_time"    />
-        <result property="deleted"    column="deleted"    />
-        <result property="companyId"    column="company_id"    />
-        <result property="companyName" column="company_name"/>
-        <result property="doctorName" column="doctor_name"/>
-        <result property="formName" column="form_name"/>
-        <result property="surveyQuestionnaireType" column="surveyQuestionnaireType"/>
-
-    </resultMap>
-
-    <sql id="selectDrugResearchVo">
-        SELECT
-        dr.id,
-        dr.company_id,
-        c.company_name,
-        dr.title,
-        dr.description,
-        q.name AS form_name,
-        q.survey_questionnaire_type AS surveyQuestionnaireType,
-        dr.cover_image,
-        dr.form_id,
-        dr.doctor_id,
-        d.doctor_name,
-        dr.category,
-        dr.start_time,
-        dr.end_time,
-        dr.status,
-        dr.sort,
-        dr.create_by,
-        dr.create_time,
-        dr.update_time,
-        dr.deleted
-        FROM drug_research dr
-        LEFT JOIN company c ON dr.company_id = c.company_id
-        LEFT JOIN survey_questionnaire q ON dr.form_id = q.id
-        LEFT JOIN doctor d ON dr.doctor_id = d.id
-
-    </sql>
-
-
-    <select id="selectDrugResearchList" parameterType="DrugResearch" resultMap="DrugResearchResult">
-        <include refid="selectDrugResearchVo"/>
-        <where>
-            <if test="companyId != null">
-                AND dr.company_id = #{companyId}
-            </if>
-            <if test="doctorId != null">
-                AND dr.doctor_id = #{doctorId}
-            </if>
-            <if test="title != null and title != ''">
-                AND dr.title = #{title}
-            </if>
-            <if test="description != null and description != ''">
-                AND dr.description = #{description}
-            </if>
-            <if test="coverImage != null and coverImage != ''">
-                AND dr.cover_image = #{coverImage}
-            </if>
-            <if test="formId != null">
-                AND dr.form_id = #{formId}
-            </if>
-            <if test="category != null and category != ''">
-                AND dr.category = #{category}
-            </if>
-            <if test="status != null">
-                AND dr.status = #{status}
-            </if>
-            <if test="sort != null">
-                AND dr.sort = #{sort}
-            </if>
-            <!-- 可选:按公司名筛选(如果你前端会传 companyName) -->
-            <if test="companyName != null and companyName != ''">
-                AND c.company_name LIKE CONCAT('%', #{companyName}, '%')
-            </if>
-            <if test="startTime != null ">
-                AND dr.start_time &gt;= #{startTime}
-            </if>
-            <if test="endTime != null ">
-                AND dr.end_time &lt;= #{endTime}
-            </if>
-            <if test="timeStatus != null and timeStatus != ''">
-                <choose>
-                    <!-- 未开始:当前时间 < 开始时间 -->
-                    <when test="timeStatus == 'before'">
-                        AND (dr.start_time > NOW() OR dr.start_time IS NULL)
-                    </when>
-                    <!-- 进行中:当前时间 BETWEEN 开始时间 AND 结束时间 -->
-                    <when test="timeStatus == 'during'">
-                        AND (NOW() BETWEEN dr.start_time AND dr.end_time)
-                    </when>
-                    <!-- 已结束:当前时间 > 结束时间 -->
-                    <when test="timeStatus == 'after'">
-                        AND dr.end_time &lt; NOW()
-                        AND dr.end_time IS NOT NULL
-                    </when>
-                </choose>
-            </if>
-        </where>
-        order by dr.sort, dr.create_time desc
-    </select>
-
-
-    <select id="selectDrugResearchById" parameterType="Long" resultMap="DrugResearchResult">
-        <include refid="selectDrugResearchVo"/>
-        WHERE dr.id = #{id}
-    </select>
-
-    <insert id="insertDrugResearch" parameterType="DrugResearch" useGeneratedKeys="true" keyProperty="id">
-        insert into drug_research
-        <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="title != null and title != ''">title,</if>
-            <if test="description != null">description,</if>
-            <if test="coverImage != null">cover_image,</if>
-            <if test="formId != null">form_id,</if>
-            <if test="category != null and category != ''">category,</if>
-            <if test="startTime != null">start_time,</if>
-            <if test="endTime != null">end_time,</if>
-            <if test="status != null">status,</if>
-            <if test="sort != null">sort,</if>
-            <if test="createBy != null">create_by,</if>
-            <if test="createTime != null">create_time,</if>
-            <if test="updateTime != null">update_time,</if>
-            <if test="deleted != null">deleted,</if>
-            <if test="companyId != null">company_id,</if>
-            <if test="doctorId != null">doctor_id,</if>
-        </trim>
-        <trim prefix="values (" suffix=")" suffixOverrides=",">
-            <if test="title != null and title != ''">#{title},</if>
-            <if test="description != null">#{description},</if>
-            <if test="coverImage != null">#{coverImage},</if>
-            <if test="formId != null">#{formId},</if>
-            <if test="category != null and category != ''">#{category},</if>
-            <if test="startTime != null">#{startTime},</if>
-            <if test="endTime != null">#{endTime},</if>
-            <if test="status != null">#{status},</if>
-            <if test="sort != null">#{sort},</if>
-            <if test="createBy != null">#{createBy},</if>
-            <if test="createTime != null">#{createTime},</if>
-            <if test="updateTime != null">#{updateTime},</if>
-            <if test="deleted != null">#{deleted},</if>
-            <if test="companyId != null">#{companyId},</if>
-            <if test="doctorId != null">#{doctorId},</if>
-        </trim>
-    </insert>
-
-    <update id="updateDrugResearch" parameterType="DrugResearch">
-        update drug_research
-        <trim prefix="SET" suffixOverrides=",">
-            <if test="title != null and title != ''">title = #{title},</if>
-            <if test="description != null">description = #{description},</if>
-            <if test="coverImage != null">cover_image = #{coverImage},</if>
-            <if test="formId != null">form_id = #{formId},</if>
-            <if test="category != null and category != ''">category = #{category},</if>
-            <if test="startTime != null">start_time = #{startTime},</if>
-            <if test="endTime != null">end_time = #{endTime},</if>
-            <if test="status != null">status = #{status},</if>
-            <if test="sort != null">sort = #{sort},</if>
-            <if test="createBy != null">create_by = #{createBy},</if>
-            <if test="createTime != null">create_time = #{createTime},</if>
-            <if test="updateTime != null">update_time = #{updateTime},</if>
-            <if test="deleted != null">deleted = #{deleted},</if>
-            <if test="companyId != null">company_id = #{companyId},</if>
-            <if test="doctorId != null">doctor_id = #{doctorId},</if>
-        </trim>
-        where id = #{id}
-    </update>
-
-    <delete id="deleteDrugResearchById" parameterType="Long">
-        delete from drug_research where id = #{id}
-    </delete>
-
-    <delete id="deleteDrugResearchByIds" parameterType="String">
-        delete from drug_research where id in
-        <foreach item="id" collection="array" open="(" separator="," close=")">
-            #{id}
-        </foreach>
-    </delete>
-</mapper>

+ 0 - 102
fs-service/src/main/resources/mapper/survey/DynamicTableMapper.xml

@@ -1,102 +0,0 @@
-<?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.fs.survey.mapper.DynamicTableMapper">
-
-    <!-- 检查表是否存在 -->
-    <select id="checkTableExists" resultType="int">
-        SELECT COUNT(*)
-        FROM information_schema.TABLES
-        WHERE TABLE_SCHEMA = (SELECT DATABASE())
-        AND TABLE_NAME = #{tableName}
-    </select>
-
-    <!-- 创建表 -->
-    <update id="createTable">
-        ${sql}
-    </update>
-
-    <!-- 删除表 -->
-    <update id="dropTable">
-        DROP TABLE IF EXISTS `${tableName}`
-    </update>
-
-    <!-- 动态插入数据 -->
-    <insert id="insertData" useGeneratedKeys="true" keyProperty="data.id">
-        INSERT INTO `${tableName}`
-        <trim prefix="(" suffix=")" suffixOverrides=",">
-            <foreach collection="data.keys" item="key" separator=",">
-                `${key}`
-            </foreach>
-        </trim>
-        <trim prefix="VALUES (" suffix=")" suffixOverrides=",">
-            <foreach collection="data.keys" item="key" separator=",">
-                #{data[${key}]}
-            </foreach>
-        </trim>
-    </insert>
-
-    <!-- 动态查询数据列表 -->
-    <select id="selectDataList" resultType="map">
-        SELECT * FROM `${tableName}`
-        <where>
-            del_flag = '0'
-            <if test="params.companyId != null">
-                AND company_id = #{params.companyId}
-            </if>
-            <if test="params.versionId != null">
-                AND version_id = #{params.versionId}
-            </if>
-            <if test="params.userId != null">
-                AND user_id = #{params.userId}
-            </if>
-            <if test="params.beginTime != null and params.beginTime != ''">
-                AND submit_time &gt;= #{params.beginTime}
-            </if>
-            <if test="params.endTime != null and params.endTime != ''">
-                AND submit_time &lt;= #{params.endTime}
-            </if>
-        </where>
-        ORDER BY submit_time DESC
-    </select>
-
-    <!-- 查询数据详情 -->
-    <select id="selectDataById" resultType="map">
-        SELECT * FROM `${tableName}` WHERE id = #{id} AND del_flag = '0'
-    </select>
-
-    <!-- 动态更新数据 -->
-    <update id="updateData">
-        UPDATE `${tableName}`
-        <set>
-            <foreach collection="data.keys" item="key" separator=",">
-                <if test="key != 'id'">
-                    `${key}` = #{data[${key}]}
-                </if>
-            </foreach>
-        </set>
-        WHERE id = #{data.id}
-    </update>
-
-    <!-- 删除数据(逻辑删除) -->
-    <update id="deleteData">
-        UPDATE `${tableName}` SET del_flag = '1' WHERE id = #{id}
-    </update>
-
-
-    <insert id="companyDoctorApplyinsertData" useGeneratedKeys="true" keyProperty="id">
-        INSERT INTO `${tableName}`
-        <trim prefix="(" suffix=")" suffixOverrides=",">
-            <foreach collection="data.keys" item="key" separator=",">
-                `${key}`
-            </foreach>
-        </trim>
-        <trim prefix="VALUES (" suffix=")" suffixOverrides=",">
-            <foreach collection="data.keys" item="key" separator=",">
-                #{data[${key}]}
-            </foreach>
-        </trim>
-    </insert>
-
-</mapper>

+ 0 - 159
fs-service/src/main/resources/mapper/survey/SurveyFieldConfigMapper.xml

@@ -1,159 +0,0 @@
-<?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.fs.survey.mapper.SurveyFieldConfigMapper">
-
-    <resultMap type="SurveyFieldConfig" id="SurveyFieldConfigResult">
-        <result property="id"    column="id"    />
-        <result property="companyId"    column="company_id"    />
-        <result property="versionId"    column="version_id"    />
-        <result property="questionnaireId"    column="questionnaire_id"    />
-        <result property="fieldKey"    column="field_key"    />
-        <result property="fieldLabel"    column="field_label"    />
-        <result property="fieldTag"    column="field_tag"    />
-        <result property="fieldTagIcon"    column="field_tag_icon"    />
-        <result property="dbColumnType"    column="db_column_type"    />
-        <result property="dbColumnLength"    column="db_column_length"    />
-        <result property="isRequired"    column="is_required"    />
-        <result property="isSearchable"    column="is_searchable"    />
-        <result property="searchType"    column="search_type"    />
-        <result property="isListShow"    column="is_list_show"    />
-        <result property="listWidth"    column="list_width"    />
-        <result property="isExport"    column="is_export"    />
-        <result property="exportLabel"    column="export_label"    />
-        <result property="sortOrder"    column="sort_order"    />
-        <result property="defaultValue"    column="default_value"    />
-        <result property="optionsJson"    column="options_json"    />
-        <result property="regListJson"    column="reg_list_json"    />
-        <result property="rawConfigJson"    column="raw_config_json"    />
-        <result property="createBy"    column="create_by"    />
-        <result property="createTime"    column="create_time"    />
-    </resultMap>
-
-    <sql id="selectSurveyFieldConfigVo">
-        select id, company_id, version_id, questionnaire_id, field_key, field_label,
-               field_tag, field_tag_icon, db_column_type, db_column_length, is_required,
-               is_searchable, search_type, is_list_show, list_width, is_export,
-               export_label, sort_order, default_value, options_json, reg_list_json,
-               raw_config_json, create_by, create_time
-        from survey_field_config
-    </sql>
-
-    <select id="selectSurveyFieldConfigList" parameterType="SurveyFieldConfig" resultMap="SurveyFieldConfigResult">
-        <include refid="selectSurveyFieldConfigVo"/>
-        <where>
-            <if test="companyId != null "> and company_id = #{companyId}</if>
-            <if test="versionId != null "> and version_id = #{versionId}</if>
-            <if test="questionnaireId != null "> and questionnaire_id = #{questionnaireId}</if>
-            <if test="fieldKey != null  and fieldKey != ''"> and field_key = #{fieldKey}</if>
-            <if test="fieldLabel != null  and fieldLabel != ''"> and field_label like concat('%', #{fieldLabel}, '%')</if>
-            <if test="fieldTag != null  and fieldTag != ''"> and field_tag = #{fieldTag}</if>
-        </where>
-        order by sort_order asc
-    </select>
-
-    <select id="selectSurveyFieldConfigById" parameterType="Long" resultMap="SurveyFieldConfigResult">
-        <include refid="selectSurveyFieldConfigVo"/>
-        where id = #{id}
-    </select>
-
-    <select id="selectFieldConfigByVersionId" parameterType="Long" resultMap="SurveyFieldConfigResult">
-        <include refid="selectSurveyFieldConfigVo"/>
-        where version_id = #{versionId}
-        order by sort_order asc
-    </select>
-
-    <insert id="insertSurveyFieldConfig" parameterType="SurveyFieldConfig" useGeneratedKeys="true" keyProperty="id">
-        insert into survey_field_config
-        <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="companyId != null">company_id,</if>
-            <if test="versionId != null">version_id,</if>
-            <if test="questionnaireId != null">questionnaire_id,</if>
-            <if test="fieldKey != null and fieldKey != ''">field_key,</if>
-            <if test="fieldLabel != null and fieldLabel != ''">field_label,</if>
-            <if test="fieldTag != null and fieldTag != ''">field_tag,</if>
-            <if test="fieldTagIcon != null">field_tag_icon,</if>
-            <if test="dbColumnType != null and dbColumnType != ''">db_column_type,</if>
-            <if test="dbColumnLength != null">db_column_length,</if>
-            <if test="isRequired != null">is_required,</if>
-            <if test="isSearchable != null">is_searchable,</if>
-            <if test="searchType != null">search_type,</if>
-            <if test="isListShow != null">is_list_show,</if>
-            <if test="listWidth != null">list_width,</if>
-            <if test="isExport != null">is_export,</if>
-            <if test="exportLabel != null">export_label,</if>
-            <if test="sortOrder != null">sort_order,</if>
-            <if test="defaultValue != null">default_value,</if>
-            <if test="optionsJson != null">options_json,</if>
-            <if test="regListJson != null">reg_list_json,</if>
-            <if test="rawConfigJson != null">raw_config_json,</if>
-            <if test="createBy != null">create_by,</if>
-            create_time
-        </trim>
-        <trim prefix="values (" suffix=")" suffixOverrides=",">
-            <if test="companyId != null">#{companyId},</if>
-            <if test="versionId != null">#{versionId},</if>
-            <if test="questionnaireId != null">#{questionnaireId},</if>
-            <if test="fieldKey != null and fieldKey != ''">#{fieldKey},</if>
-            <if test="fieldLabel != null and fieldLabel != ''">#{fieldLabel},</if>
-            <if test="fieldTag != null and fieldTag != ''">#{fieldTag},</if>
-            <if test="fieldTagIcon != null">#{fieldTagIcon},</if>
-            <if test="dbColumnType != null and dbColumnType != ''">#{dbColumnType},</if>
-            <if test="dbColumnLength != null">#{dbColumnLength},</if>
-            <if test="isRequired != null">#{isRequired},</if>
-            <if test="isSearchable != null">#{isSearchable},</if>
-            <if test="searchType != null">#{searchType},</if>
-            <if test="isListShow != null">#{isListShow},</if>
-            <if test="listWidth != null">#{listWidth},</if>
-            <if test="isExport != null">#{isExport},</if>
-            <if test="exportLabel != null">#{exportLabel},</if>
-            <if test="sortOrder != null">#{sortOrder},</if>
-            <if test="defaultValue != null">#{defaultValue},</if>
-            <if test="optionsJson != null">#{optionsJson},</if>
-            <if test="regListJson != null">#{regListJson},</if>
-            <if test="rawConfigJson != null">#{rawConfigJson},</if>
-            <if test="createBy != null">#{createBy},</if>
-            sysdate()
-        </trim>
-    </insert>
-
-    <update id="updateSurveyFieldConfig" parameterType="SurveyFieldConfig">
-        update survey_field_config
-        <trim prefix="SET" suffixOverrides=",">
-            <if test="fieldLabel != null and fieldLabel != ''">field_label = #{fieldLabel},</if>
-            <if test="fieldTag != null and fieldTag != ''">field_tag = #{fieldTag},</if>
-            <if test="fieldTagIcon != null">field_tag_icon = #{fieldTagIcon},</if>
-            <if test="dbColumnType != null and dbColumnType != ''">db_column_type = #{dbColumnType},</if>
-            <if test="dbColumnLength != null">db_column_length = #{dbColumnLength},</if>
-            <if test="isRequired != null">is_required = #{isRequired},</if>
-            <if test="isSearchable != null">is_searchable = #{isSearchable},</if>
-            <if test="searchType != null">search_type = #{searchType},</if>
-            <if test="isListShow != null">is_list_show = #{isListShow},</if>
-            <if test="listWidth != null">list_width = #{listWidth},</if>
-            <if test="isExport != null">is_export = #{isExport},</if>
-            <if test="exportLabel != null">export_label = #{exportLabel},</if>
-            <if test="sortOrder != null">sort_order = #{sortOrder},</if>
-            <if test="defaultValue != null">default_value = #{defaultValue},</if>
-            <if test="optionsJson != null">options_json = #{optionsJson},</if>
-            <if test="regListJson != null">reg_list_json = #{regListJson},</if>
-            <if test="rawConfigJson != null">raw_config_json = #{rawConfigJson},</if>
-        </trim>
-        where id = #{id}
-    </update>
-
-    <delete id="deleteSurveyFieldConfigById" parameterType="Long">
-        delete from survey_field_config where id = #{id}
-    </delete>
-
-    <delete id="deleteSurveyFieldConfigByIds" parameterType="Long">
-        delete from survey_field_config where id in
-        <foreach item="id" collection="array" open="(" separator="," close=")">
-            #{id}
-        </foreach>
-    </delete>
-
-    <delete id="deleteSurveyFieldConfigByVersionId" parameterType="Long">
-        delete from survey_field_config where version_id = #{versionId}
-    </delete>
-</mapper>

+ 0 - 103
fs-service/src/main/resources/mapper/survey/SurveyFieldTypeMappingMapper.xml

@@ -1,103 +0,0 @@
-<?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.fs.survey.mapper.SurveyFieldTypeMappingMapper">
-
-    <resultMap type="SurveyFieldTypeMapping" id="SurveyFieldTypeMappingResult">
-        <result property="id"    column="id"    />
-        <result property="tagName"    column="tag_name"    />
-        <result property="tagIcon"    column="tag_icon"    />
-        <result property="dbType"    column="db_type"    />
-        <result property="dbLength"    column="db_length"    />
-        <result property="searchType"    column="search_type"    />
-        <result property="description"    column="description"    />
-        <result property="status"    column="status"    />
-        <result property="sortOrder"    column="sort_order"    />
-    </resultMap>
-
-    <sql id="selectSurveyFieldTypeMappingVo">
-        select id, tag_name, tag_icon, db_type, db_length, search_type,
-               description, status, sort_order
-        from survey_field_type_mapping
-    </sql>
-
-    <select id="selectSurveyFieldTypeMappingList" parameterType="SurveyFieldTypeMapping" resultMap="SurveyFieldTypeMappingResult">
-        <include refid="selectSurveyFieldTypeMappingVo"/>
-        <where>
-            <if test="tagName != null  and tagName != ''"> and tag_name = #{tagName}</if>
-            <if test="tagIcon != null  and tagIcon != ''"> and tag_icon = #{tagIcon}</if>
-            <if test="status != null "> and status = #{status}</if>
-        </where>
-        order by sort_order asc
-    </select>
-
-    <select id="selectSurveyFieldTypeMappingById" parameterType="Long" resultMap="SurveyFieldTypeMappingResult">
-        <include refid="selectSurveyFieldTypeMappingVo"/>
-        where id = #{id}
-    </select>
-
-    <select id="selectByTagAndIcon" resultMap="SurveyFieldTypeMappingResult">
-        <include refid="selectSurveyFieldTypeMappingVo"/>
-        where tag_name = #{tagName}
-        <if test="tagIcon != null and tagIcon != ''">
-            and tag_icon = #{tagIcon}
-        </if>
-        and status = 1
-        limit 1
-    </select>
-
-    <insert id="insertSurveyFieldTypeMapping" parameterType="SurveyFieldTypeMapping" useGeneratedKeys="true" keyProperty="id">
-        insert into survey_field_type_mapping
-        <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="tagName != null and tagName != ''">tag_name,</if>
-            <if test="tagIcon != null">tag_icon,</if>
-            <if test="dbType != null and dbType != ''">db_type,</if>
-            <if test="dbLength != null">db_length,</if>
-            <if test="searchType != null">search_type,</if>
-            <if test="description != null">description,</if>
-            <if test="status != null">status,</if>
-            <if test="sortOrder != null">sort_order,</if>
-        </trim>
-        <trim prefix="values (" suffix=")" suffixOverrides=",">
-            <if test="tagName != null and tagName != ''">#{tagName},</if>
-            <if test="tagIcon != null">#{tagIcon},</if>
-            <if test="dbType != null and dbType != ''">#{dbType},</if>
-            <if test="dbLength != null">#{dbLength},</if>
-            <if test="searchType != null">#{searchType},</if>
-            <if test="description != null">#{description},</if>
-            <if test="status != null">#{status},</if>
-            <if test="sortOrder != null">#{sortOrder},</if>
-        </trim>
-    </insert>
-
-    <update id="updateSurveyFieldTypeMapping" parameterType="SurveyFieldTypeMapping">
-        update survey_field_type_mapping
-        <trim prefix="SET" suffixOverrides=",">
-            <if test="tagName != null and tagName != ''">tag_name = #{tagName},</if>
-            <if test="tagIcon != null">tag_icon = #{tagIcon},</if>
-            <if test="dbType != null and dbType != ''">db_type = #{dbType},</if>
-            <if test="dbLength != null">db_length = #{dbLength},</if>
-            <if test="searchType != null">search_type = #{searchType},</if>
-            <if test="description != null">description = #{description},</if>
-            <if test="status != null">status = #{status},</if>
-            <if test="sortOrder != null">sort_order = #{sortOrder},</if>
-        </trim>
-        where id = #{id}
-    </update>
-
-    <delete id="deleteSurveyFieldTypeMappingById" parameterType="Long">
-        delete from survey_field_type_mapping where id = #{id}
-    </delete>
-
-    <delete id="deleteSurveyFieldTypeMappingByIds" parameterType="Long">
-        delete from survey_field_type_mapping where id in
-        <foreach item="id" collection="array" open="(" separator="," close=")">
-            #{id}
-        </foreach>
-    </delete>
-
-    <update id="truncateTable">
-        truncate table survey_field_type_mapping
-    </update>
-</mapper>

+ 0 - 115
fs-service/src/main/resources/mapper/survey/SurveyQuestionnaireMapper.xml

@@ -1,115 +0,0 @@
-<?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.fs.survey.mapper.SurveyQuestionnaireMapper">
-
-    <resultMap type="SurveyQuestionnaire" id="SurveyQuestionnaireResult">
-        <result property="id"    column="id"    />
-        <result property="companyId"    column="company_id"    />
-        <result property="companyName"    column="company_name"    />
-        <result property="name"    column="name"    />
-        <result property="description"    column="description"    />
-        <result property="status"    column="status"    />
-        <result property="currentVersionId"    column="current_version_id"    />
-        <result property="createBy"    column="create_by"    />
-        <result property="createTime"    column="create_time"    />
-        <result property="updateBy"    column="update_by"    />
-        <result property="updateTime"    column="update_time"    />
-        <result property="remark"    column="remark"    />
-        <result property="delFlag"    column="del_flag"    />
-        <result property="surveyQuestionnaireType"    column="survey_questionnaire_type"    />
-    </resultMap>
-
-    <!-- 修改基础查询SQL,添加公司表关联 -->
-    <sql id="selectSurveyQuestionnaireVo">
-        select
-        sq.id,
-        sq.company_id,
-        c.company_name,
-        sq.name,
-        sq.survey_questionnaire_type,
-        sq.description,
-        sq.status,
-        sq.current_version_id,
-        sq.create_by,
-        sq.create_time,
-        sq.update_by,
-        sq.update_time,
-        sq.remark,
-        sq.del_flag
-        from survey_questionnaire sq
-        left join company c on sq.company_id = c.company_id and c.is_del = '0'
-    </sql>
-
-    <select id="selectSurveyQuestionnaireList" parameterType="SurveyQuestionnaire" resultMap="SurveyQuestionnaireResult">
-        <include refid="selectSurveyQuestionnaireVo"/>
-        <where>
-            sq.del_flag = '0'
-            <if test="companyId != null "> and sq.company_id = #{companyId}</if>
-            <if test="name != null  and name != ''"> and sq.name like concat('%', #{name}, '%')</if>
-            <if test="status != null "> and sq.status = #{status}</if>
-            <if test="companyName != null  and companyName != ''"> and c.company_name like concat('%', #{companyName}, '%')</if>
-            <if test="surveyQuestionnaireType != null "> and sq.survey_questionnaire_type = #{surveyQuestionnaireType}</if>
-
-        </where>
-        order by sq.create_time desc
-    </select>
-
-    <select id="selectSurveyQuestionnaireById" parameterType="Long" resultMap="SurveyQuestionnaireResult">
-        <include refid="selectSurveyQuestionnaireVo"/>
-        where sq.id = #{id} and sq.del_flag = '0'
-    </select>
-
-    <insert id="insertSurveyQuestionnaire" parameterType="SurveyQuestionnaire" useGeneratedKeys="true" keyProperty="id">
-        insert into survey_questionnaire
-        <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="companyId != null">company_id,</if>
-            <if test="surveyQuestionnaireType != null">survey_questionnaire_type,</if>
-            <if test="name != null and name != ''">name,</if>
-            <if test="description != null">description,</if>
-            <if test="status != null">status,</if>
-            <if test="currentVersionId != null">current_version_id,</if>
-            <if test="createBy != null">create_by,</if>
-            <if test="remark != null">remark,</if>
-            create_time
-        </trim>
-        <trim prefix="values (" suffix=")" suffixOverrides=",">
-            <if test="companyId != null">#{companyId},</if>
-            <if test="surveyQuestionnaireType != null">#{surveyQuestionnaireType},</if>
-            <if test="name != null and name != ''">#{name},</if>
-            <if test="description != null">#{description},</if>
-            <if test="status != null">#{status},</if>
-            <if test="currentVersionId != null">#{currentVersionId},</if>
-            <if test="createBy != null">#{createBy},</if>
-            <if test="remark != null">#{remark},</if>
-            sysdate()
-        </trim>
-    </insert>
-
-    <update id="updateSurveyQuestionnaire" parameterType="SurveyQuestionnaire">
-        update survey_questionnaire
-        <trim prefix="SET" suffixOverrides=",">
-            <if test="name != null and name != ''">name = #{name},</if>
-            <if test="surveyQuestionnaireType != null">survey_questionnaire_type = #{surveyQuestionnaireType},</if>
-            <if test="description != null">description = #{description},</if>
-            <if test="status != null">status = #{status},</if>
-            <if test="currentVersionId != null">current_version_id = #{currentVersionId},</if>
-            <if test="updateBy != null">update_by = #{updateBy},</if>
-            <if test="remark != null">remark = #{remark},</if>
-            update_time = sysdate()
-        </trim>
-        where id = #{id}
-    </update>
-
-    <delete id="deleteSurveyQuestionnaireById" parameterType="Long">
-        update survey_questionnaire set del_flag = '1' where id = #{id}
-    </delete>
-
-    <delete id="deleteSurveyQuestionnaireByIds" parameterType="Long">
-        update survey_questionnaire set del_flag = '1' where id in
-        <foreach item="id" collection="array" open="(" separator="," close=")">
-            #{id}
-        </foreach>
-    </delete>
-</mapper>

+ 0 - 134
fs-service/src/main/resources/mapper/survey/SurveyQuestionnaireVersionMapper.xml

@@ -1,134 +0,0 @@
-<?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.fs.survey.mapper.SurveyQuestionnaireVersionMapper">
-
-    <resultMap type="SurveyQuestionnaireVersion" id="SurveyQuestionnaireVersionResult">
-        <result property="id"    column="id"    />
-        <result property="companyId"    column="company_id"    />
-        <result property="questionnaireId"    column="questionnaire_id"    />
-        <result property="versionNo"    column="version_no"    />
-        <result property="versionName"    column="version_name"    />
-        <result property="formJson"    column="form_json"    />
-        <result property="tableName"    column="table_name"    />
-        <result property="status"    column="status"    />
-        <result property="publishTime"    column="publish_time"    />
-        <result property="publishBy"    column="publish_by"    />
-        <result property="createBy"    column="create_by"    />
-        <result property="createTime"    column="create_time"    />
-        <result property="updateBy"    column="update_by"    />
-        <result property="updateTime"    column="update_time"    />
-        <result property="remark"    column="remark"    />
-        <result property="delFlag"    column="del_flag"    />
-    </resultMap>
-
-    <sql id="selectSurveyQuestionnaireVersionVo">
-        select id, company_id, questionnaire_id, version_no, version_name, form_json,
-               table_name, status, publish_time, publish_by, create_by, create_time,
-               update_by, update_time, remark, del_flag
-        from survey_questionnaire_version
-    </sql>
-
-    <select id="selectSurveyQuestionnaireVersionList" parameterType="SurveyQuestionnaireVersion" resultMap="SurveyQuestionnaireVersionResult">
-        <include refid="selectSurveyQuestionnaireVersionVo"/>
-        <where>
-            del_flag = '0'
-            <if test="companyId != null "> and company_id = #{companyId}</if>
-            <if test="questionnaireId != null "> and questionnaire_id = #{questionnaireId}</if>
-            <if test="versionNo != null "> and version_no = #{versionNo}</if>
-            <if test="versionName != null  and versionName != ''"> and version_name like concat('%', #{versionName}, '%')</if>
-            <if test="status != null "> and status = #{status}</if>
-        </where>
-        order by version_no desc
-    </select>
-
-    <select id="selectSurveyQuestionnaireVersionById" parameterType="Long" resultMap="SurveyQuestionnaireVersionResult">
-        <include refid="selectSurveyQuestionnaireVersionVo"/>
-        where id = #{id} and del_flag = '0'
-    </select>
-
-    <select id="selectVersionListByQuestionnaireId" parameterType="Long" resultMap="SurveyQuestionnaireVersionResult">
-        <include refid="selectSurveyQuestionnaireVersionVo"/>
-        where questionnaire_id = #{questionnaireId} and del_flag = '0'
-        order by version_no desc
-    </select>
-
-    <select id="selectMaxVersionNo" parameterType="Long" resultType="Integer">
-        select IFNULL(MAX(version_no), 0) from survey_questionnaire_version
-        where questionnaire_id = #{questionnaireId} and del_flag = '0'
-    </select>
-    <select id="getLatestInfo" resultType="com.fs.survey.domain.SurveyQuestionnaireVersion">
-        SELECT *
-        FROM survey_questionnaire_version
-        WHERE questionnaire_id = #{id}
-          AND version_no = (
-            SELECT MAX(version_no)
-            FROM survey_questionnaire_version
-            WHERE questionnaire_id = #{id}
-        );
-    </select>
-
-    <insert id="insertSurveyQuestionnaireVersion" parameterType="SurveyQuestionnaireVersion" useGeneratedKeys="true" keyProperty="id">
-        insert into survey_questionnaire_version
-        <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="companyId != null">company_id,</if>
-            <if test="questionnaireId != null">questionnaire_id,</if>
-            <if test="versionNo != null">version_no,</if>
-            <if test="versionName != null">version_name,</if>
-            <if test="formJson != null and formJson != ''">form_json,</if>
-            <if test="tableName != null">table_name,</if>
-            <if test="status != null">status,</if>
-            <if test="publishTime != null">publish_time,</if>
-            <if test="publishBy != null">publish_by,</if>
-            <if test="createBy != null">create_by,</if>
-            <if test="remark != null">remark,</if>
-            <if test="createTime != null">create_time</if>
-        </trim>
-        <trim prefix="values (" suffix=")" suffixOverrides=",">
-            <if test="companyId != null">#{companyId},</if>
-            <if test="questionnaireId != null">#{questionnaireId},</if>
-            <if test="versionNo != null">#{versionNo},</if>
-            <if test="versionName != null">#{versionName},</if>
-            <if test="formJson != null and formJson != ''">#{formJson},</if>
-            <if test="tableName != null">#{tableName},</if>
-            <if test="status != null">#{status},</if>
-            <if test="publishTime != null">#{publishTime},</if>
-            <if test="publishBy != null">#{publishBy},</if>
-            <if test="createBy != null">#{createBy},</if>
-            <if test="remark != null">#{remark},</if>
-            <if test="createTime != null">#{createTime}</if>
-        </trim>
-    </insert>
-
-    <update id="updateSurveyQuestionnaireVersion" parameterType="SurveyQuestionnaireVersion">
-        update survey_questionnaire_version
-        <trim prefix="SET" suffixOverrides=",">
-            <if test="versionName != null">version_name = #{versionName},</if>
-            <if test="formJson != null and formJson != ''">form_json = #{formJson},</if>
-            <if test="tableName != null">table_name = #{tableName},</if>
-            <if test="status != null">status = #{status},</if>
-            <if test="publishTime != null">publish_time = #{publishTime},</if>
-            <if test="publishBy != null">publish_by = #{publishBy},</if>
-            <if test="updateBy != null">update_by = #{updateBy},</if>
-            <if test="remark != null">remark = #{remark},</if>
-            update_time = sysdate()
-        </trim>
-        where id = #{id}
-    </update>
-
-    <delete id="deleteSurveyQuestionnaireVersionById" parameterType="Long">
-        update survey_questionnaire_version set del_flag = '1' where id = #{id}
-    </delete>
-
-    <delete id="deleteSurveyQuestionnaireVersionByIds" parameterType="Long">
-        update survey_questionnaire_version set del_flag = '1' where id in
-        <foreach item="id" collection="array" open="(" separator="," close=")">
-            #{id}
-        </foreach>
-    </delete>
-
-    <delete id="deleteSurveyQuestionnaireVersionByQuestionnaireId" parameterType="Long">
-        update survey_questionnaire_version set del_flag = '1' where questionnaire_id = #{questionnaireId}
-    </delete>
-</mapper>

+ 0 - 228
fs-service/src/main/resources/mapper/survey/SurveyTaskMapper.xml

@@ -1,228 +0,0 @@
-<?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.fs.survey.mapper.SurveyTaskMapper">
-
-    <resultMap type="SurveyTask" id="SurveyTaskResult">
-        <result property="id"    column="id"    />
-        <result property="title"    column="title"    />
-        <result property="description"    column="description"    />
-        <result property="coverImage"    column="cover_image"    />
-        <result property="formId"    column="form_id"    />
-        <result property="category"    column="category"    />
-        <result property="year"    column="year"    />
-        <result property="totalPeriods"    column="total_periods"    />
-        <result property="intervalDays"    column="interval_days"    />
-        <result property="status"    column="status"    />
-        <result property="sort"    column="sort"    />
-        <result property="viewCount"    column="view_count"    />
-        <result property="companyId"    column="company_id"    />
-        <result property="createBy"    column="create_by"    />
-        <result property="createTime"    column="create_time"    />
-        <result property="updateTime"    column="update_time"    />
-        <result property="deleted"    column="deleted"    />
-        <result property="periodStartTime"    column="period_start_time"    />
-        <result property="periodEndTime"    column="period_end_time"    />
-        <!-- 关联企业信息 -->
-        <result property="companyName"    column="company_name"    />
-        <!-- 新增:问卷名称 -->
-        <result property="questionnaireName"    column="questionnaire_name"    />
-        <result property="surveyQuestionnaireType" column="surveyQuestionnaireType"/>
-        <result property="doctorId" column="doctor_id"/>
-        <result property="doctorName" column="doctor_name"/>
-
-    </resultMap>
-
-    <sql id="selectSurveyTaskVo">
-        select
-        st.id,
-        st.title,
-        st.description,
-        st.cover_image,
-        st.form_id,
-        st.category,
-        st.year,
-        st.total_periods,
-        st.interval_days,
-        st.status,
-        st.sort,
-        st.view_count,
-        st.company_id,
-        st.create_by,
-        st.create_time,
-        st.update_time,
-        st.doctor_id,
-        d.doctor_name,
-        st.deleted,
-        c.company_name,
-        period_agg.min_start AS period_start_time,
-        period_agg.max_end AS period_end_time,
-        <!-- 新增:问卷名称 -->
-        sq.name as questionnaire_name,
-        sq.survey_questionnaire_type as surveyQuestionnaireType
-        from survey_task st
-        left join company c on st.company_id = c.company_id
-        left join doctor d on st.doctor_id = d.id
-        left join survey_questionnaire sq on st.form_id = sq.id and sq.del_flag = '0'
-        LEFT JOIN (
-        SELECT
-        task_id,
-        MIN(period_start_time) AS min_start,
-        MAX(period_end_time) AS max_end,
-        COUNT(*) AS total_count,
-        SUM(CASE WHEN is_period = 1 THEN 1 ELSE 0 END) AS period_1_count
-        FROM survey_task_period
-        GROUP BY task_id
-        ) period_agg ON period_agg.task_id = st.id
-    </sql>
-
-    <select id="selectSurveyTaskList" parameterType="SurveyTask" resultMap="SurveyTaskResult">
-        <include refid="selectSurveyTaskVo"/>
-        <where>
-            <if test="title != null  and title != ''"> and st.title like concat('%', #{title}, '%')</if>
-            <if test="description != null  and description != ''"> and st.description = #{description}</if>
-            <if test="coverImage != null  and coverImage != ''"> and st.cover_image = #{coverImage}</if>
-            <if test="formId != null "> and st.form_id = #{formId}</if>
-            <if test="category != null  and category != ''"> and st.category = #{category}</if>
-            <if test="year != null "> and st.year = #{year}</if>
-            <if test="totalPeriods != null "> and st.total_periods = #{totalPeriods}</if>
-            <if test="intervalDays != null "> and st.interval_days = #{intervalDays}</if>
-            <if test="status != null "> and st.status = #{status}</if>
-            <if test="sort != null "> and st.sort = #{sort}</if>
-            <if test="viewCount != null "> and st.view_count = #{viewCount}</if>
-            <if test="companyId != null "> and st.company_id = #{companyId}</if>
-            <if test="doctorId != null">
-                AND st.doctor_id = #{doctorId}
-            </if>
-            <if test="deleted != null "> and st.deleted = #{deleted}</if>
-            <!-- 企业名称查询条件 -->
-            <if test="companyName != null  and companyName != ''"> and c.company_name like concat('%', #{companyName}, '%')</if>
-            <!-- 新增:问卷名称查询条件 -->
-            <if test="questionnaireName != null  and questionnaireName != ''"> and sq.name like concat('%', #{questionnaireName}, '%')</if>
-            <if test="timeStatus != null">
-                <choose>
-                    <when test="timeStatus == 'before'">
-                        AND EXISTS (
-                        SELECT 1
-                        FROM survey_task_period stp
-                        WHERE stp.task_id = st.id
-                        AND stp.is_period = 0
-                        AND NOW() BETWEEN stp.period_start_time AND stp.period_end_time
-                        )
-                    </when>
-                    <when test="timeStatus == 'during'">
-                        <!-- 兼容原逻辑:存在 is_period=1 的周期 -->
-                        AND period_agg.period_1_count > 0
-                        AND period_agg.period_1_count &lt; period_agg.total_count
-                        <!-- 增强时间准确性:当前时间必须在某个周期时间窗口内 -->
-                        AND EXISTS (
-                        SELECT 1
-                        FROM survey_task_period stp
-                        WHERE stp.task_id = st.id
-                        AND stp.period_start_time &lt;= NOW()
-                        AND stp.period_end_time >= NOW()
-                        )
-                    </when>
-                    <when test="timeStatus == 'after'">
-                        AND period_agg.total_count IS NOT NULL
-                        AND period_agg.total_count > 0
-                        AND (
-                        <!-- 原逻辑:所有周期都标记为 is_period=1 -->
-                        period_agg.period_1_count = period_agg.total_count
-                        OR
-                        <!-- 新逻辑:当前时间已超过所有周期的结束时间 -->
-                        (period_agg.max_end IS NOT NULL AND NOW() &gt; period_agg.max_end)
-                        )
-                    </when>
-                </choose>
-            </if>
-        </where>
-        order by st.sort asc, st.create_time desc
-    </select>
-
-    <select id="selectSurveyTaskById" parameterType="Long" resultMap="SurveyTaskResult">
-        <include refid="selectSurveyTaskVo"/>
-        where st.id = #{id}
-    </select>
-
-    <insert id="insertSurveyTask" parameterType="SurveyTask" useGeneratedKeys="true" keyProperty="id">
-        insert into survey_task
-        <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="title != null and title != ''">title,</if>
-            <if test="description != null">description,</if>
-            <if test="coverImage != null">cover_image,</if>
-            <if test="formId != null">form_id,</if>
-            <if test="category != null and category != ''">category,</if>
-            <if test="year != null">year,</if>
-            <if test="totalPeriods != null">total_periods,</if>
-            <if test="intervalDays != null">interval_days,</if>
-            <if test="status != null">status,</if>
-            <if test="sort != null">sort,</if>
-            <if test="viewCount != null">view_count,</if>
-            <if test="companyId != null">company_id,</if>
-            <if test="createBy != null">create_by,</if>
-            <if test="createTime != null">create_time,</if>
-            <if test="updateTime != null">update_time,</if>
-            <if test="deleted != null">deleted,</if>
-            <if test="doctorId != null">doctor_id,</if>
-
-        </trim>
-        <trim prefix="values (" suffix=")" suffixOverrides=",">
-            <if test="title != null and title != ''">#{title},</if>
-            <if test="description != null">#{description},</if>
-            <if test="coverImage != null">#{coverImage},</if>
-            <if test="formId != null">#{formId},</if>
-            <if test="category != null and category != ''">#{category},</if>
-            <if test="year != null">#{year},</if>
-            <if test="totalPeriods != null">#{totalPeriods},</if>
-            <if test="intervalDays != null">#{intervalDays},</if>
-            <if test="status != null">#{status},</if>
-            <if test="sort != null">#{sort},</if>
-            <if test="viewCount != null">#{viewCount},</if>
-            <if test="companyId != null">#{companyId},</if>
-            <if test="createBy != null">#{createBy},</if>
-            <if test="createTime != null">#{createTime},</if>
-            <if test="updateTime != null">#{updateTime},</if>
-            <if test="deleted != null">#{deleted},</if>
-            <if test="doctorId != null">#{doctorId},</if>
-
-        </trim>
-    </insert>
-
-    <update id="updateSurveyTask" parameterType="SurveyTask">
-        update survey_task
-        <trim prefix="SET" suffixOverrides=",">
-            <if test="title != null and title != ''">title = #{title},</if>
-            <if test="description != null">description = #{description},</if>
-            <if test="coverImage != null">cover_image = #{coverImage},</if>
-            <if test="formId != null">form_id = #{formId},</if>
-            <if test="category != null and category != ''">category = #{category},</if>
-            <if test="year != null">year = #{year},</if>
-            <if test="totalPeriods != null">total_periods = #{totalPeriods},</if>
-            <if test="intervalDays != null">interval_days = #{intervalDays},</if>
-            <if test="status != null">status = #{status},</if>
-            <if test="sort != null">sort = #{sort},</if>
-            <if test="viewCount != null">view_count = #{viewCount},</if>
-            <if test="companyId != null">company_id = #{companyId},</if>
-            <if test="createBy != null">create_by = #{createBy},</if>
-            <if test="createTime != null">create_time = #{createTime},</if>
-            <if test="updateTime != null">update_time = #{updateTime},</if>
-            <if test="deleted != null">deleted = #{deleted},</if>
-            <if test="doctorId != null">doctor_id = #{doctorId},</if>
-
-        </trim>
-        where id = #{id}
-    </update>
-
-    <delete id="deleteSurveyTaskById" parameterType="Long">
-        delete from survey_task where id = #{id}
-    </delete>
-
-    <delete id="deleteSurveyTaskByIds" parameterType="String">
-        delete from survey_task where id in
-        <foreach item="id" collection="array" open="(" separator="," close=")">
-            #{id}
-        </foreach>
-    </delete>
-</mapper>

+ 0 - 153
fs-service/src/main/resources/mapper/survey/SurveyTaskPeriodMapper.xml

@@ -1,153 +0,0 @@
-<?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.fs.survey.mapper.SurveyTaskPeriodMapper">
-
-    <resultMap type="SurveyTaskPeriod" id="SurveyTaskPeriodResult">
-        <result property="id"              column="id" />
-        <result property="taskId"          column="task_id" />
-        <result property="periodNum"       column="period_num" />
-        <result property="periodStartTime" column="period_start_time" />
-        <result property="periodEndTime"   column="period_end_time" />
-        <result property="createTime"      column="create_time" />
-        <result property="companyId"       column="company_id" />
-        <result property="isPeriod"       column="is_period" />
-        <!-- 添加任务名称字段映射 -->
-        <result property="taskTitle"       column="task_title" />
-        <!-- 添加公司名称字段映射 -->
-        <result property="companyName"     column="company_name" />
-    </resultMap>
-
-    <!-- 修改基础查询SQL,添加关联查询 -->
-    <sql id="selectSurveyTaskPeriodVo">
-        select
-        stp.id,
-        stp.task_id,
-        stp.period_num,
-        stp.period_start_time,
-        stp.period_end_time,
-        stp.create_time,
-        stp.company_id,
-        stp.is_period,
-        <!-- 添加任务名称 -->
-        st.title as task_title,
-        <!-- 添加公司名称 -->
-        c.company_name as company_name
-        from survey_task_period stp
-        left join survey_task st on stp.task_id = st.id and st.deleted = 0
-        left join company c on stp.company_id = c.company_id and c.is_del = 0
-    </sql>
-
-    <select id="selectSurveyTaskPeriodList"
-            parameterType="SurveyTaskPeriod"
-            resultMap="SurveyTaskPeriodResult">
-        <include refid="selectSurveyTaskPeriodVo"/>
-        <where>
-            <if test="taskId != null">and stp.task_id = #{taskId}</if>
-            <if test="periodNum != null">and stp.period_num = #{periodNum}</if>
-            <if test="periodStartTime != null">and stp.period_start_time = #{periodStartTime}</if>
-            <if test="periodEndTime != null">and stp.period_end_time = #{periodEndTime}</if>
-            <if test="companyId != null">and stp.company_id = #{companyId}</if>
-            <!-- 可以添加任务名称作为查询条件 -->
-            <if test="taskTitle != null and taskTitle != ''">and st.title like concat('%', #{taskTitle}, '%')</if>
-            <!-- 可以添加公司名称作为查询条件 -->
-            <if test="companyName != null and companyName != ''">and c.company_name like concat('%', #{companyName}, '%')</if>
-        </where>
-        order by stp.period_num asc
-    </select>
-
-    <select id="selectSurveyTaskPeriodById"
-            parameterType="Long"
-            resultMap="SurveyTaskPeriodResult">
-        <include refid="selectSurveyTaskPeriodVo"/>
-        where stp.id = #{id}
-    </select>
-
-    <!-- 原有的插入、更新、删除方法保持不变 -->
-    <insert id="insertSurveyTaskPeriod"
-            parameterType="SurveyTaskPeriod"
-            useGeneratedKeys="true"
-            keyProperty="id">
-        insert into survey_task_period
-        <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="taskId != null">task_id,</if>
-            <if test="periodNum != null">period_num,</if>
-            <if test="periodStartTime != null">period_start_time,</if>
-            <if test="periodEndTime != null">period_end_time,</if>
-            <if test="createTime != null">create_time,</if>
-            <if test="companyId != null">company_id,</if>
-            <if test="isPeriod != null">is_period,</if>
-        </trim>
-        <trim prefix="values (" suffix=")" suffixOverrides=",">
-            <if test="taskId != null">#{taskId},</if>
-            <if test="periodNum != null">#{periodNum},</if>
-            <if test="periodStartTime != null">#{periodStartTime},</if>
-            <if test="periodEndTime != null">#{periodEndTime},</if>
-            <if test="createTime != null">#{createTime},</if>
-            <if test="companyId != null">#{companyId},</if>
-            <if test="isPeriod != null">#{isPeriod},</if>
-        </trim>
-    </insert>
-
-    <update id="updateSurveyTaskPeriod" parameterType="SurveyTaskPeriod">
-        update survey_task_period
-        <trim prefix="SET" suffixOverrides=",">
-            <if test="taskId != null">task_id = #{taskId},</if>
-            <if test="periodNum != null">period_num = #{periodNum},</if>
-            <if test="periodStartTime != null">period_start_time = #{periodStartTime},</if>
-            <if test="periodEndTime != null">period_end_time = #{periodEndTime},</if>
-            <if test="createTime != null">create_time = #{createTime},</if>
-            <if test="companyId != null">company_id = #{companyId},</if>
-            <if test="isPeriod != null">is_period = #{isPeriod},</if>
-        </trim>
-        where id = #{id}
-    </update>
-
-    <delete id="deleteSurveyTaskPeriodById" parameterType="Long">
-        delete from survey_task_period where id = #{id}
-    </delete>
-
-    <delete id="deleteSurveyTaskPeriodByIds" parameterType="String">
-        delete from survey_task_period where id in
-        <foreach item="id" collection="array" open="(" separator="," close=")">
-            #{id}
-        </foreach>
-    </delete>
-
-    <!-- 修改:根据任务ID查询期数列表,已包含任务名称 -->
-    <select id="selectSurveyTaskPeriodListByTaskId"
-            parameterType="Long"
-            resultMap="SurveyTaskPeriodResult">
-        <include refid="selectSurveyTaskPeriodVo"/>
-        where stp.task_id = #{taskId}
-        order by stp.period_num asc
-    </select>
-    <select id="getPeriodData" resultType="com.fs.survey.dto.PeriodDataDto">
-        SELECT
-            COUNT(*) AS totalPeriodNum,
-            SUM(CASE WHEN is_period = 1 THEN 1 ELSE 0 END) AS alreadyPeriodNum
-        FROM survey_task_period
-        WHERE task_id = #{taskId};
-    </select>
-    <select id="getPeriodNum" resultType="java.lang.Long">
-    <![CDATA[
-        SELECT IFNULL(
-                       (SELECT id
-                        FROM survey_task_period
-                        WHERE task_id = #{taskId}
-                          AND NOW() >= period_start_time
-                          AND NOW() <= period_end_time
-                          AND is_period = 0
-                       ),
-                       0
-               ) AS id;
-        ]]>
-</select>
-
-    <!-- 添加:根据任务ID删除期数 -->
-    <delete id="deleteSurveyTaskPeriodByTaskId" parameterType="Long">
-        delete from survey_task_period where task_id = #{taskId}
-    </delete>
-
-</mapper>

+ 0 - 165
fs-service/src/main/resources/mapper/task/TaskDeliveryInfoMapper.xml

@@ -1,165 +0,0 @@
-<?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.fs.task.mapper.TaskDeliveryInfoMapper">
-    
-    <resultMap type="TaskDeliveryInfo" id="TaskDeliveryInfoResult">
-        <result property="id"    column="id"    />
-        <result property="taskId"    column="task_id"    />
-        <result property="deliveryNo"    column="delivery_no"    />
-        <result property="deliveryName"    column="delivery_name"    />
-        <result property="validViews"    column="valid_views"    />
-        <result property="viewCount"    column="view_count"    />
-        <result property="projectLink"    column="project_link"    />
-        <result property="createTime"    column="create_time"    />
-        <result property="updateTime"    column="update_time"    />
-        <result property="createBy"    column="create_by"    />
-        <result property="updateBy"    column="update_by"    />
-        <result property="deleted"    column="deleted"    />
-        <result property="taskName"    column="task_name"    />
-        <result property="taskType" column="task_type"/>
-    </resultMap>
-
-    <sql id="selectTaskDeliveryInfoVo">
-        SELECT
-        tdi.id,
-        tdi.task_id,
-        ti.task_type,
-        ti.task_name,
-        tdi.delivery_no,
-        tdi.delivery_name,
-        tdi.valid_views,
-        tdi.view_count,
-        tdi.project_link,
-        tdi.create_time,
-        tdi.update_time,
-        tdi.create_by,
-        tdi.update_by,
-        tdi.deleted
-        FROM task_delivery_info tdi
-        LEFT JOIN task_info ti ON ti.id = tdi.task_id
-    </sql>
-
-    <select id="selectTaskDeliveryInfoList" parameterType="TaskDeliveryInfo" resultMap="TaskDeliveryInfoResult">
-        <include refid="selectTaskDeliveryInfoVo"/>
-        <where>
-            <if test="taskId != null "> and tdi.task_id = #{taskId}</if>
-
-            <!-- 如果要按任务名称搜,就加这条 -->
-            <if test="taskName != null and taskName != ''">
-                and ti.task_name like concat('%', #{taskName}, '%')
-            </if>
-            <if test="companyId != null">
-                and ti.company_id = #{companyId}
-            </if>
-            <if test="deliveryNo != null  and deliveryNo != ''"> and tdi.delivery_no = #{deliveryNo}</if>
-            <if test="deliveryName != null  and deliveryName != ''"> and tdi.delivery_name like concat('%', #{deliveryName}, '%')</if>
-            <if test="validViews != null "> and tdi.valid_views = #{validViews}</if>
-            <if test="viewCount != null "> and tdi.view_count = #{viewCount}</if>
-            <if test="projectLink != null  and projectLink != ''"> and tdi.project_link = #{projectLink}</if>
-            <if test="deleted != null "> and tdi.deleted = #{deleted}</if>
-        </where>
-        <!-- 添加排序:最新创建的任务在最前面 -->
-        order by tdi.create_time desc
-    </select>
-
-
-    <select id="selectTaskDeliveryInfoById" parameterType="Long" resultMap="TaskDeliveryInfoResult">
-        <include refid="selectTaskDeliveryInfoVo"/>
-        where tdi.id = #{id}
-    </select>
-        
-    <insert id="insertTaskDeliveryInfo" parameterType="TaskDeliveryInfo" useGeneratedKeys="true" keyProperty="id">
-        insert into task_delivery_info
-        <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="taskId != null">task_id,</if>
-            <if test="taskType != null">task_type,</if>
-            <if test="deliveryNo != null">delivery_no,</if>
-            <if test="deliveryName != null">delivery_name,</if>
-            <if test="validViews != null">valid_views,</if>
-            <if test="viewCount != null">view_count,</if>
-            <if test="projectLink != null">project_link,</if>
-            <if test="createTime != null">create_time,</if>
-            <if test="updateTime != null">update_time,</if>
-            <if test="createBy != null">create_by,</if>
-            <if test="updateBy != null">update_by,</if>
-            <if test="deleted != null">deleted,</if>
-         </trim>
-        <trim prefix="values (" suffix=")" suffixOverrides=",">
-            <if test="taskId != null">#{taskId},</if>
-            <if test="taskType != null">#{taskType},</if>
-            <if test="deliveryNo != null">#{deliveryNo},</if>
-            <if test="deliveryName != null">#{deliveryName},</if>
-            <if test="validViews != null">#{validViews},</if>
-            <if test="viewCount != null">#{viewCount},</if>
-            <if test="projectLink != null">#{projectLink},</if>
-            <if test="createTime != null">#{createTime},</if>
-            <if test="updateTime != null">#{updateTime},</if>
-            <if test="createBy != null">#{createBy},</if>
-            <if test="updateBy != null">#{updateBy},</if>
-            <if test="deleted != null">#{deleted},</if>
-         </trim>
-    </insert>
-
-    <update id="updateTaskDeliveryInfo" parameterType="TaskDeliveryInfo">
-        update task_delivery_info
-        <trim prefix="SET" suffixOverrides=",">
-            <if test="taskId != null">task_id = #{taskId},</if>
-            <if test="taskType != null">task_type = #{taskType},</if> <!-- ✅ -->
-            <if test="deliveryNo != null">delivery_no = #{deliveryNo},</if>
-            <if test="deliveryName != null">delivery_name = #{deliveryName},</if>
-            <if test="validViews != null">valid_views = #{validViews},</if>
-            <if test="viewCount != null">view_count = #{viewCount},</if>
-            <if test="projectLink != null">project_link = #{projectLink},</if>
-            <if test="createTime != null">create_time = #{createTime},</if>
-            <if test="updateTime != null">update_time = #{updateTime},</if>
-            <if test="createBy != null">create_by = #{createBy},</if>
-            <if test="updateBy != null">update_by = #{updateBy},</if>
-            <if test="deleted != null">deleted = #{deleted},</if>
-        </trim>
-        where id = #{id}
-    </update>
-
-    <delete id="deleteTaskDeliveryInfoById" parameterType="Long">
-        delete from task_delivery_info where id = #{id}
-    </delete>
-
-    <delete id="deleteTaskDeliveryInfoByIds" parameterType="String">
-        delete from task_delivery_info where id in 
-        <foreach item="id" collection="array" open="(" separator="," close=")">
-            #{id}
-        </foreach>
-    </delete>
-
-
-
-    <select
-            id="getDeliveryInfoByTaskTypeAndDeliveryNo"
-            parameterType="TaskDeliveryInfo"
-            resultMap="TaskDeliveryInfoResult"
-    >
-        SELECT
-        tdi.id,
-        tdi.task_id,
-        tdi.task_type,
-        ti.task_name,
-        tdi.delivery_no,
-        tdi.delivery_name,
-        tdi.valid_views,
-        tdi.view_count,
-        tdi.project_link,
-        tdi.create_time,
-        tdi.update_time,
-        tdi.create_by,
-        tdi.update_by,
-        tdi.deleted
-        FROM task_delivery_info tdi
-        LEFT JOIN task_info ti ON ti.id = tdi.task_id
-        WHERE tdi.task_type = #{taskType}
-        AND tdi.delivery_no = #{deliveryNo}
-        AND tdi.deleted = 0
-        LIMIT 1
-    </select>
-
-</mapper>

+ 0 - 725
fs-service/src/main/resources/mapper/task/TaskInfoMapper.xml

@@ -1,725 +0,0 @@
-<?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.fs.task.mapper.TaskInfoMapper">
-
-    <resultMap type="TaskInfo" id="TaskInfoResult">
-        <result property="id"    column="id"    />
-        <result property="taskNo"    column="task_no"    />
-        <result property="taskName"    column="task_name"    />
-        <result property="deptId"    column="dept_id"    />
-        <result property="projectId"    column="project_id"    />
-        <result property="costShareId"    column="cost_share_id"    />
-        <result property="taskType" column="task_type" />
-        <result property="taskIntegral"    column="task_integral"    />
-        <result property="taskCount"    column="task_count"    />
-        <result property="taskUnit"    column="task_unit"    />
-        <result property="taskStatus"    column="task_status"    />
-        <result property="productId"    column="product_id"    />
-        <result property="doctorId"    column="doctor_id"    />
-        <result property="planStartTime"    column="plan_start_time"    />
-        <result property="planEndTime"    column="plan_end_time"    />
-        <result property="applyTime"    column="apply_time"    />
-        <result property="createAuditTime"    column="create_audit_time"    />
-        <result property="deliveryAuditTime"    column="delivery_audit_time"    />
-        <result property="serviceConfirmStatus"    column="service_confirm_status"    />
-        <result property="finishStatus"    column="finish_status"    />
-        <result property="belongType"    column="belong_type"    />
-        <result property="isSpotCheck"    column="is_spot_check"    />
-        <result property="spotCheckUserId"    column="spot_check_user_id"    />
-        <result property="spotCheckTime"    column="spot_check_time"    />
-        <result property="auditStatus"    column="audit_status"    />
-        <result property="isSupplementLive"    column="is_supplement_live"    />
-        <result property="supplementLiveTaskId"    column="supplement_live_task_id"    />
-        <result property="supplementLiveReason"    column="supplement_live_reason"    />
-        <result property="createTime"    column="create_time"    />
-        <result property="updateTime"    column="update_time"    />
-        <result property="createBy"    column="create_by"    />
-        <result property="updateBy"    column="update_by"    />
-        <result property="deleted"    column="deleted"    />
-        <result property="createAuditStatus"    column="create_audit_status"    />
-        <result property="createAuditUserId"    column="create_audit_user_id"    />
-        <result property="createAuditRemark"    column="create_audit_remark"    />
-        <result property="finishAuditStatus"    column="finish_audit_status"    />
-        <result property="finishAuditUserId"    column="finish_audit_user_id"    />
-        <result property="finishAuditTime"    column="finish_audit_time"    />
-        <result property="finishAuditRemark"    column="finish_audit_remark"    />
-        <result property="createAuditInstanceId"    column="create_audit_instance_id"    />
-        <result property="finishAuditInstanceId"    column="finish_audit_instance_id"    />
-        <result property="caUserType"    column="ca_user_type"    />
-        <result property="companyUserId"    column="company_user_id"    />
-
-        <result property="deptName" column="dept_name"/>
-        <result property="projectName" column="project_name"/>
-        <result property="costShareName" column="cost_share_name"/>
-        <result property="spotCheckUserName" column="spotCheckUserName"/>
-        <result property="createAuditUserName" column="createAuditUserName" />
-        <result property="finishAuditUserName" column="finishAuditUserName" />
-        <result property="companyName" column="companyName" />
-        <result property="productName" column="productName" />
-        <result property="doctorName" column="doctorName" />
-        <result property="remark" column="remark" />
-    </resultMap>
-
-
-    <sql id="selectTaskInfoVo">
-        SELECT
-        t.id,
-        t.task_no,
-        t.task_name,
-        t.dept_id,
-        t.project_id,
-        t.cost_share_id,
-        t.task_type,
-        t.task_integral,
-        t.task_count,
-        t.task_unit,
-        t.task_status,
-        t.product_id,
-        t.doctor_id,
-        t.plan_start_time,
-        t.plan_end_time,
-        t.apply_time,
-        t.create_audit_time,
-        t.delivery_audit_time,
-        t.service_confirm_status,
-        t.finish_status,
-        t.belong_type,
-        t.is_spot_check,
-        t.spot_check_user_id,
-        t.spot_check_time,
-        t.audit_status,
-        t.is_supplement_live,
-        t.supplement_live_task_id,
-        t.supplement_live_reason,
-        t.create_time,
-        t.update_time,
-        t.create_by,
-        t.update_by,
-        t.deleted,
-
-        t.create_audit_status,
-        t.create_audit_user_id,
-        t.create_audit_remark,
-
-        t.finish_audit_status,
-        t.finish_audit_user_id,
-        t.finish_audit_time,
-        t.finish_audit_remark,
-
-        t.create_audit_instance_id,
-        t.finish_audit_instance_id,
-        t.ca_user_type,
-        t.company_user_id,
-        t.remark,
-
-        -- ===== 关联名称字段 =====
-        d.dept_name                AS dept_name,
-        p.project_name             AS project_name,
-        cs.dept_name               AS cost_share_name,
-        doc.doctor_name            AS doctorName,
-
-        cu.nick_name               AS spotCheckUserName,
-        cu2.nick_name              AS createAuditUserName,
-        cu3.nick_name              AS finishAuditUserName,
-
-        c.company_id               AS companyId,
-        c.company_name             AS companyName,
-        product.product_name       AS productName
-
-        FROM task_info t
-
-        LEFT JOIN company_dept d
-        ON d.dept_id = t.dept_id
-
-        LEFT JOIN project p
-        ON p.id = t.project_id
-
-        LEFT JOIN company_dept cs
-        ON cs.dept_id = t.cost_share_id
-
-        LEFT JOIN doctor doc
-        ON doc.id = t.doctor_id
-
-        LEFT JOIN company_user cu
-        ON cu.user_id = t.spot_check_user_id
-
-        LEFT JOIN company_user cu2
-        ON cu2.user_id = t.create_audit_user_id
-
-        -- ✅ 关键修正点:完成审核人
-        LEFT JOIN company_user cu3
-        ON cu3.user_id = t.finish_audit_user_id
-
-        LEFT JOIN company c
-        ON c.company_id = t.company_id
-
-        LEFT JOIN company_product product
-        ON product.id = t.product_id
-    </sql>
-
-    <select id="selectTaskInfoList" parameterType="TaskInfo" resultMap="TaskInfoResult">
-        <include refid="selectTaskInfoVo"/>
-        <where>
-            <if test="companyId != null "> and t.company_id = #{companyId}</if>
-            <if test="companyUserId != null "> and t.company_user_id = #{companyUserId}</if>
-            <if test="taskNo != null  and taskNo != ''"> and t.task_no = #{taskNo}</if>
-            <if test="taskName != null  and taskName != ''"> and t.task_name like concat('%', #{taskName}, '%')</if>
-            <if test="deptId != null "> and t.dept_id = #{deptId}</if>
-            <if test="projectId != null "> and t.project_id = #{projectId}</if>
-            <if test="costShareId != null "> and t.cost_share_id = #{costShareId}</if>
-            <if test="taskType != null">and t.task_type = #{taskType}</if>
-            <if test="taskIntegral != null "> and t.task_integral = #{taskIntegral}</if>
-            <if test="taskCount != null "> and t.task_count = #{taskCount}</if>
-            <if test="taskUnit != null "> and t.task_unit = #{taskUnit}</if>
-            <if test="taskStatus != null "> and t.task_status = #{taskStatus}</if>
-            <if test="productId != null "> and t.product_id = #{productId}</if>
-            <if test="doctorId != null "> and t.doctor_id = #{doctorId}</if>
-            <if test="applyTime != null "> and t.apply_time = #{applyTime}</if>
-            <if test="createAuditTime != null "> and t.create_audit_time = #{createAuditTime}</if>
-            <if test="deliveryAuditTime != null "> and t.delivery_audit_time = #{deliveryAuditTime}</if>
-            <if test="serviceConfirmStatus != null "> and t.service_confirm_status = #{serviceConfirmStatus}</if>
-            <if test="finishStatus != null "> and t.finish_status = #{finishStatus}</if>
-            <if test="belongType != null "> and t.belong_type = #{belongType}</if>
-            <if test="isSpotCheck != null "> and t.is_spot_check = #{isSpotCheck}</if>
-            <if test="spotCheckUserId != null "> and t.spot_check_user_id = #{spotCheckUserId}</if>
-            <if test="spotCheckTime != null "> and t.spot_check_time = #{spotCheckTime}</if>
-            <if test="auditStatus != null "> and t.audit_status = #{auditStatus}</if>
-            <if test="isSupplementLive != null "> and t.is_supplement_live = #{isSupplementLive}</if>
-            <if test="supplementLiveTaskId != null  and supplementLiveTaskId != ''"> and t.supplement_live_task_id = #{supplementLiveTaskId}</if>
-            <if test="supplementLiveReason != null  and supplementLiveReason != ''"> and t.supplement_live_reason = #{supplementLiveReason}</if>
-            <if test="deleted != null "> and t.deleted = #{deleted}</if>
-            <if test="createAuditStatus != null "> and t.create_audit_status = #{createAuditStatus}</if>
-            <if test="createAuditUserId != null "> and t.create_audit_user_id = #{createAuditUserId}</if>
-            <if test="finishAuditStatus != null "> and t.finish_audit_status = #{finishAuditStatus}</if>
-            <if test="finishAuditUserId != null "> and t.finish_audit_user_id = #{finishAuditUserId}</if>
-            <if test="finishAuditTime != null "> and t.finish_audit_time = #{finishAuditTime}</if>
-            <!--前端切换标签-->
-            <if test="auditTab != null and auditTab != ''">
-                <choose>
-                    <!-- 创建待审核 -->
-                    <when test="auditTab == 'CREATE_PENDING'">
-                        and t.create_audit_status = 0
-                    </when>
-                    <!-- 创建审核完成 -->
-                    <when test="auditTab == 'CREATE_DONE'">
-                        and t.create_audit_status != 0
-                    </when>
-                    <!-- 完成待审核 -->
-                    <when test="auditTab == 'FINISH_PENDING'">
-                        and t.create_audit_status = 1
-                        and t.finish_audit_status = 0
-                    </when>
-                    <!-- 完成审核完成 -->
-                    <when test="auditTab == 'FINISH_DONE'">
-                        and t.finish_audit_status != 0
-                    </when>
-                    <otherwise>
-                    </otherwise>
-                </choose>
-            </if>
-
-            <!-- 修改现有的申请时间范围查询 -->
-            <if test="applyStartTime != null and applyStartTime != '' and applyEndTime != null and applyEndTime != ''">
-                AND t.apply_time &gt;= #{applyStartTime}
-                AND t.apply_time &lt;= #{applyEndTime}
-            </if>
-            <if test="timeType != null">
-                <bind name="now" value="new java.util.Date()" />
-                AND t.plan_start_time &lt;= #{now}
-                AND t.plan_end_time &gt;= #{now}
-            </if>
-
-            <!-- 添加完成审核时间范围查询 -->
-            <if test="finishAuditTimeStart != null and finishAuditTimeStart != '' and finishAuditTimeEnd != null and finishAuditTimeEnd != ''">
-                AND t.finish_audit_time &gt;= #{finishAuditTimeStart}
-                AND t.finish_audit_time &lt;= #{finishAuditTimeEnd}
-            </if>
-
-            <!-- 添加任务完成时间范围查询(需要确认对应的数据库字段名) -->
-            <if test="taskFinishTimeStart != null and taskFinishTimeStart != '' and taskFinishTimeEnd != null and taskFinishTimeEnd != ''">
-                AND t.finish_audit_time &gt;= #{taskFinishTimeStart}
-                AND t.finish_audit_time &lt;= #{taskFinishTimeEnd}
-            </if>
-            <if test="selectType != null and selectType == 'kp'">
-                AND (t.task_type = 4 or t.task_type = 5 or t.task_type = 6)
-            </if>
-
-            <!-- 新增 keywords 模糊匹配 -->
-            <if test="keywords != null and keywords != ''">
-                AND (doc.doctor_name LIKE CONCAT('%', #{keywords}, '%')
-                OR doc.mobile LIKE CONCAT('%', #{keywords}, '%'))
-            </if>
-
-        </where>
-        <!-- 添加排序:最新创建的任务在最前面 -->
-        order by t.create_time desc
-    </select>
-
-
-
-
-
-    <select id="selectTaskInfoById" parameterType="Long" resultMap="TaskInfoResult">
-        <include refid="selectTaskInfoVo"/>
-        where t.id = #{id}
-    </select>
-
-    <insert id="insertTaskInfo" parameterType="TaskInfo" useGeneratedKeys="true" keyProperty="id">
-        insert into task_info
-        <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="taskNo != null and taskNo != ''">task_no,</if>
-            <if test="taskName != null and taskName != ''">task_name,</if>
-            <if test="deptId != null">dept_id,</if>
-            <if test="projectId != null">project_id,</if>
-            <if test="costShareId != null">cost_share_id,</if>
-            <if test="taskType  != null">task_type,</if>
-            <if test="taskIntegral != null">task_integral,</if>
-            <if test="taskCount != null">task_count,</if>
-            <if test="taskUnit != null">task_unit,</if>
-            <if test="taskStatus != null">task_status,</if>
-            <if test="productId != null">product_id,</if>
-            <if test="doctorId != null">doctor_id,</if>
-            <if test="planStartTime != null">plan_start_time,</if>
-            <if test="planEndTime != null">plan_end_time,</if>
-            <if test="applyTime != null">apply_time,</if>
-            <if test="createAuditTime != null">create_audit_time,</if>
-            <if test="deliveryAuditTime != null">delivery_audit_time,</if>
-            <if test="serviceConfirmStatus != null">service_confirm_status,</if>
-            <if test="finishStatus != null">finish_status,</if>
-            <if test="belongType != null">belong_type,</if>
-            <if test="isSpotCheck != null">is_spot_check,</if>
-            <if test="spotCheckUserId != null">spot_check_user_id,</if>
-            <if test="spotCheckTime != null">spot_check_time,</if>
-            <if test="auditStatus != null">audit_status,</if>
-            <if test="isSupplementLive != null">is_supplement_live,</if>
-            <if test="supplementLiveTaskId != null">supplement_live_task_id,</if>
-            <if test="supplementLiveReason != null">supplement_live_reason,</if>
-            <if test="createTime != null">create_time,</if>
-            <if test="updateTime != null">update_time,</if>
-            <if test="createBy != null">create_by,</if>
-            <if test="updateBy != null">update_by,</if>
-            <if test="deleted != null">deleted,</if>
-            <if test="createAuditStatus != null">create_audit_status,</if>
-            <if test="createAuditUserId != null">create_audit_user_id,</if>
-            <if test="createAuditRemark != null">create_audit_remark,</if>
-            <if test="finishAuditStatus != null">finish_audit_status,</if>
-            <if test="finishAuditUserId != null">finish_audit_user_id,</if>
-            <if test="finishAuditTime != null">finish_audit_time,</if>
-            <if test="finishAuditRemark != null">finish_audit_remark,</if>
-            <if test="companyId != null">company_id,</if>
-            <if test="createAuditInstanceId != null">create_audit_instance_id,</if>
-            <if test="finishAuditInstanceId != null">finish_audit_instance_id,</if>
-            <if test="caUserType != null">ca_user_type,</if>
-            <if test="companyUserId != null">company_user_id,</if>
-            <if test="targetId != null">target_id,</if>
-         </trim>
-        <trim prefix="values (" suffix=")" suffixOverrides=",">
-            <if test="taskNo != null and taskNo != ''">#{taskNo},</if>
-            <if test="taskName != null and taskName != ''">#{taskName},</if>
-            <if test="deptId != null">#{deptId},</if>
-            <if test="projectId != null">#{projectId},</if>
-            <if test="costShareId != null">#{costShareId},</if>
-            <if test="taskType != null">#{taskType},</if>
-            <if test="taskIntegral != null">#{taskIntegral},</if>
-            <if test="taskCount != null">#{taskCount},</if>
-            <if test="taskUnit != null">#{taskUnit},</if>
-            <if test="taskStatus != null">#{taskStatus},</if>
-            <if test="productId != null">#{productId},</if>
-            <if test="doctorId != null">#{doctorId},</if>
-            <if test="planStartTime != null">#{planStartTime},</if>
-            <if test="planEndTime != null">#{planEndTime},</if>
-            <if test="applyTime != null">#{applyTime},</if>
-            <if test="createAuditTime != null">#{createAuditTime},</if>
-            <if test="deliveryAuditTime != null">#{deliveryAuditTime},</if>
-            <if test="serviceConfirmStatus != null">#{serviceConfirmStatus},</if>
-            <if test="finishStatus != null">#{finishStatus},</if>
-            <if test="belongType != null">#{belongType},</if>
-            <if test="isSpotCheck != null">#{isSpotCheck},</if>
-            <if test="spotCheckUserId != null">#{spotCheckUserId},</if>
-            <if test="spotCheckTime != null">#{spotCheckTime},</if>
-            <if test="auditStatus != null">#{auditStatus},</if>
-            <if test="isSupplementLive != null">#{isSupplementLive},</if>
-            <if test="supplementLiveTaskId != null">#{supplementLiveTaskId},</if>
-            <if test="supplementLiveReason != null">#{supplementLiveReason},</if>
-            <if test="createTime != null">#{createTime},</if>
-            <if test="updateTime != null">#{updateTime},</if>
-            <if test="createBy != null">#{createBy},</if>
-            <if test="updateBy != null">#{updateBy},</if>
-            <if test="deleted != null">#{deleted},</if>
-            <if test="createAuditStatus != null">#{createAuditStatus},</if>
-            <if test="createAuditUserId != null">#{createAuditUserId},</if>
-            <if test="createAuditRemark != null">#{createAuditRemark},</if>
-            <if test="finishAuditStatus != null">#{finishAuditStatus},</if>
-            <if test="finishAuditUserId != null">#{finishAuditUserId},</if>
-            <if test="finishAuditTime != null">#{finishAuditTime},</if>
-            <if test="finishAuditRemark != null">#{finishAuditRemark},</if>
-            <if test="companyId != null">#{companyId},</if>
-            <if test="createAuditInstanceId != null">#{createAuditInstanceId},</if>
-            <if test="finishAuditInstanceId != null">#{finishAuditInstanceId},</if>
-            <if test="caUserType != null">#{caUserType},</if>
-            <if test="companyUserId != null">#{companyUserId},</if>
-            <if test="targetId != null">#{targetId},</if>
-         </trim>
-    </insert>
-
-    <update id="updateTaskInfo" parameterType="TaskInfo">
-        update task_info
-        <trim prefix="SET" suffixOverrides=",">
-            <if test="taskNo != null and taskNo != ''">task_no = #{taskNo},</if>
-            <if test="taskName != null and taskName != ''">task_name = #{taskName},</if>
-            <if test="deptId != null">dept_id = #{deptId},</if>
-            <if test="projectId != null">project_id = #{projectId},</if>
-            <if test="costShareId != null">cost_share_id = #{costShareId},</if>
-            <if test="taskType != null">task_type = #{taskType},</if>
-            <if test="taskIntegral != null">task_integral = #{taskIntegral},</if>
-            <if test="taskCount != null">task_count = #{taskCount},</if>
-            <if test="taskUnit != null">task_unit = #{taskUnit},</if>
-            <if test="taskStatus != null">task_status = #{taskStatus},</if>
-            <if test="productId != null">product_id = #{productId},</if>
-            <if test="doctorId != null">doctor_id = #{doctorId},</if>
-            <if test="planStartTime != null">plan_start_time = #{planStartTime},</if>
-            <if test="planEndTime != null">plan_end_time = #{planEndTime},</if>
-            <if test="applyTime != null">apply_time = #{applyTime},</if>
-            <if test="createAuditTime != null">create_audit_time = #{createAuditTime},</if>
-            <if test="deliveryAuditTime != null">delivery_audit_time = #{deliveryAuditTime},</if>
-            <if test="serviceConfirmStatus != null">service_confirm_status = #{serviceConfirmStatus},</if>
-            <if test="finishStatus != null">finish_status = #{finishStatus},</if>
-            <if test="belongType != null">belong_type = #{belongType},</if>
-            <if test="isSpotCheck != null">is_spot_check = #{isSpotCheck},</if>
-            <if test="spotCheckUserId != null">spot_check_user_id = #{spotCheckUserId},</if>
-            <if test="spotCheckTime != null">spot_check_time = #{spotCheckTime},</if>
-            <if test="auditStatus != null">audit_status = #{auditStatus},</if>
-            <if test="isSupplementLive != null">is_supplement_live = #{isSupplementLive},</if>
-            <if test="supplementLiveTaskId != null">supplement_live_task_id = #{supplementLiveTaskId},</if>
-            <if test="supplementLiveReason != null">supplement_live_reason = #{supplementLiveReason},</if>
-            <if test="createTime != null">create_time = #{createTime},</if>
-            <if test="updateTime != null">update_time = #{updateTime},</if>
-            <if test="createBy != null">create_by = #{createBy},</if>
-            <if test="updateBy != null">update_by = #{updateBy},</if>
-            <if test="deleted != null">deleted = #{deleted},</if>
-            <if test="createAuditStatus != null">create_audit_status = #{createAuditStatus},</if>
-            <if test="createAuditUserId != null">create_audit_user_id = #{createAuditUserId},</if>
-            <if test="createAuditRemark != null">create_audit_remark = #{createAuditRemark},</if>
-            <if test="finishAuditStatus != null">finish_audit_status = #{finishAuditStatus},</if>
-            <if test="finishAuditUserId != null">finish_audit_user_id = #{finishAuditUserId},</if>
-            <if test="finishAuditTime != null">finish_audit_time = #{finishAuditTime},</if>
-            <if test="finishAuditRemark != null">finish_audit_remark = #{finishAuditRemark},</if>
-            <if test="companyId != null">company_id = #{companyId},</if>
-            <if test="createAuditInstanceId != null">create_audit_instance_id = #{createAuditInstanceId},</if>
-            <if test="finishAuditInstanceId != null">finish_audit_instance_id = #{finishAuditInstanceId},</if>
-            <if test="companyUserId != null">company_user_id = #{companyUserId},</if>
-            <if test="targetId != null">target_id = #{targetId},</if>
-        </trim>
-        where id = #{id}
-    </update>
-
-    <delete id="deleteTaskInfoById" parameterType="Long">
-        delete from task_info where id = #{id}
-    </delete>
-
-    <delete id="deleteTaskInfoByIds" parameterType="String">
-        delete from task_info where id in
-        <foreach item="id" collection="array" open="(" separator="," close=")">
-            #{id}
-        </foreach>
-    </delete>
-
-
-
-    <select id="selectAuditTaskInfoVO"
-            parameterType="java.lang.Long"
-            resultType="com.fs.task.vo.audit_Info.AuditTaskInfoVO">
-
-        select
-        t.task_no                as taskNo,
-        t.task_type                as taskType,
-        t.task_name              as taskName,
-        t.cost_share_id          as costShareId,
-        cs.dept_name             as costShareName,
-        t.task_integral          as taskIntegral,
-        t.task_count             as taskCount,
-        t.task_unit              as taskUnit,
-        t.belong_type            as belongType,
-        t.project_id              as projectId,
-        t.doctor_id              as doctorId,
-        t.create_audit_instance_id              as createAuditInstanceId,
-        t.finish_audit_instance_id              as finishAuditInstanceId,
-        t.company_user_id        as companyUserId,
-        t.plan_start_time        as planStartTime,
-        t.plan_end_time          as planEndTime,
-        t.project_id             as projectId,
-        p.project_name           as projectName,
-        t.dept_id                as deptId,
-        d.dept_name              as deptName,
-        t.delivery_audit_time    as deliveryAuditTime
-        from task_info t
-        left join company_dept d
-        on d.dept_id = t.dept_id
-        left join project p
-        on p.id = t.project_id
-        left join company_dept cs
-        on cs.dept_id = t.cost_share_id
-        where t.id = #{taskId}
-        and t.deleted = 0
-    </select>
-
-
-    <update id="updateSpotCheck" parameterType="com.fs.task.vo.TaskSpotCheckUpdateReqVO">
-        update task_info
-        set
-        is_spot_check = #{isSpotCheck},
-        spot_check_user_id = #{spotCheckUserId},
-        spot_check_time = #{spotCheckTime},
-        update_time = now()
-        where id = #{id}
-    </update>
-
-
-    <select id="selectPendingTasksForGen" resultType="com.fs.task.domain.TaskInfo">
-        SELECT t.*
-        FROM task_info t
-        WHERE t.deleted = 0
-        AND t.company_id = #{companyId}
-        AND t.dept_id = #{deptId}
-        AND t.create_audit_status = 1
-        AND t.finish_audit_status = 1
-        AND t.service_confirm_status = 1
-        AND t.doctor_id IS NOT NULL
-        AND t.task_integral <![CDATA[ > ]]> 0
-        AND t.task_type IN
-        <foreach collection="taskTypes" item="x" open="(" separator="," close=")">
-            #{x}
-        </foreach>
-        AND NOT EXISTS (
-        SELECT 1 FROM service_order_task_rel r
-        WHERE r.deleted = 0 AND r.task_id = t.id
-        )
-    </select>
-    <select id="getTaskCompleteStats" resultType="com.fs.task.dto.TaskStatsDTO">
-        -- 任务完成统计
-        SELECT
-            ti.dept_id as dept_id,
-            ti.task_type as task_type,
-            ti.doctor_id as doctor_id,
-            ti.company_user_id as company_user_id,
-            COUNT(DISTINCT ti.task_no) AS `count`,
-            SUM(ti.task_integral) AS total_points
-        FROM task_info ti
-        <where>
-            ti.deleted = 0
-            <if test="companyId != null">
-                AND ti.company_id = #{companyId}
-            </if>
-            <if test="companyUserId != null">
-                AND ti.company_user_id = #{companyUserId}
-            </if>
-            <if test="startDate != null and endDate!= null">
-                AND ti.create_time BETWEEN #{startDate} AND #{endDate}
-            </if>
-            <if test="taskType != null">
-                and ti.task_type=#{taskType}
-            </if>
-            <if test="taskStatus != null">
-                and ti.finish_audit_status=#{taskStatus}
-            </if>
-            AND ti.task_status = 1
-            group by ti.dept_id,ti.task_type,ti.doctor_id,ti.company_user_id
-        </where>
-    </select>
-    <select id="getTaskCreateStats" resultType="com.fs.task.dto.TaskStatsDTO">
-        -- 任务完成统计
-        SELECT
-        ti.dept_id as dept_id,
-        ti.task_type as task_type,
-        ti.doctor_id as doctor_id,
-        ti.company_user_id as company_user_id,
-        COUNT(DISTINCT ti.task_no) AS `count`,
-        SUM(ti.task_integral) AS total_points
-        FROM task_info ti
-        <where>
-            ti.deleted = 0
-            <if test="companyId != null">
-                AND ti.company_id = #{companyId}
-            </if>
-            <if test="companyUserId != null">
-                AND ti.company_user_id = #{companyUserId}
-            </if>
-            <if test="startDate != null and endDate!= null">
-                AND ti.create_time BETWEEN #{startDate} AND #{endDate}
-            </if>
-            <if test="taskType != null">
-                and ti.task_type=#{taskType}
-            </if>
-            <if test="taskStatus != null">
-                and ti.create_audit_status=#{taskStatus}
-            </if>
-        </where>
-        group by ti.dept_id,ti.task_type,ti.doctor_id,ti.company_user_id
-    </select>
-    <select id="getTaskCompleteStatsCount" resultType="java.math.BigDecimal">
-        -- 任务完成统计总积分
-        SELECT
-        COALESCE(SUM(ti.task_integral), 0) AS total_points
-        FROM task_info ti
-        <where>
-            ti.deleted = 0
-            AND ti.task_status = 1
-            <if test="companyId != null">
-                AND ti.company_id = #{companyId}
-            </if>
-            <if test="companyUserId != null">
-                AND ti.company_user_id = #{companyUserId}
-            </if>
-            <if test="startDate != null and endDate != null">
-                AND ti.create_time BETWEEN #{startDate} AND #{endDate}
-            </if>
-            <if test="taskType != null and taskType != ''">
-                AND ti.task_type = #{taskType}
-            </if>
-            <if test="taskStatus != null and taskStatus != ''">
-                AND ti.finish_audit_status = #{taskStatus}
-            </if>
-        </where>
-    </select>
-    <select id="getTaskCreateStatsCount" resultType="java.math.BigDecimal">
-        -- 任务完成统计
-        SELECT
-        COALESCE(SUM(ti.task_integral),0) AS total_points
-        FROM task_info ti
-        <where>
-            ti.deleted = 0
-            <if test="companyId != null">
-                AND ti.company_id = #{companyId}
-            </if>
-            <if test="companyUserId != null">
-                AND ti.company_user_id = #{companyUserId}
-            </if>
-            <if test="startDate != null and endDate!= null">
-                AND ti.create_time BETWEEN #{startDate} AND #{endDate}
-            </if>
-            <if test="taskType != null">
-                and ti.task_type=#{taskType}
-            </if>
-            <if test="taskStatus != null">
-                and ti.create_audit_status=#{taskStatus}
-            </if>
-        </where>
-    </select>
-
-    <select id="selectTaskInfoByIds" resultMap="TaskInfoResult">
-        <include refid="selectTaskInfoVo"/>
-        <where>
-            t.id in
-            <foreach collection="taskIds" item="id" open="(" separator="," close=")">
-                #{id}
-            </foreach>
-            and t.deleted = 0
-        </where>
-    </select>
-
-    <select id="getTaskDelivery" resultType="com.fs.task.dto.TaskDeliveryDto">
-        SELECT
-        ti.id AS taskId,
-        ti.task_name AS taskName,
-        ti.task_no AS taskNo,
-        tdi.delivery_no AS deliveryNo,
-        tdi.valid_views AS validViews,
-        tdi.view_count AS viewCount,
-        ti.task_type AS taskType,
-
-        <!-- 统一映射 title -->
-        CASE
-        WHEN ti.task_type = 4 THEN ca.title
-        WHEN ti.task_type = 5 THEN csv.title
-        WHEN ti.task_type IN (3, 6) THEN clv.title
-        ELSE NULL
-        END AS title,
-
-        <!-- 统一映射 content -->
-        CASE
-        WHEN ti.task_type = 4 THEN ca.content
-        WHEN ti.task_type = 5 THEN csv.summary
-        WHEN ti.task_type IN (3, 6) THEN clv.summary
-        ELSE NULL
-        END AS content,
-
-        <!-- 统一映射 coverImage -->
-        CASE
-        WHEN ti.task_type = 4 THEN ca.cover_image
-        WHEN ti.task_type = 5 THEN csv.cover_url
-        WHEN ti.task_type IN (3, 6) THEN clv.cover_url
-        ELSE NULL
-        END AS coverImage
-
-        FROM task_info ti
-        JOIN (
-        SELECT
-        t1.*
-        FROM
-        task_delivery_info t1
-        INNER JOIN (
-        SELECT
-        task_id,
-        MAX(create_time) AS max_create_time
-        FROM
-        task_delivery_info
-        WHERE
-        deleted = 0
-        GROUP BY
-        task_id
-        ) t2 ON t1.task_id = t2.task_id
-        AND t1.create_time = t2.max_create_time
-        AND t1.deleted = 0
-        ) tdi ON ti.id = tdi.task_id
-
-        LEFT JOIN ct_article ca
-        ON ti.task_type = 4 AND ca.id = tdi.project_link
-
-        LEFT JOIN ct_short_video csv
-        ON ti.task_type = 5 AND csv.id = tdi.project_link
-
-        LEFT JOIN ct_long_video clv
-        ON (ti.task_type = 3 OR ti.task_type = 6) AND clv.id = tdi.project_link
-
-        WHERE ti.id = #{taskId}
-        AND ti.deleted = 0
-        AND tdi.deleted = 0
-    </select>
-    <select id="getClassroomList" resultType="com.fs.task.dto.PublicIndexDto" parameterType="com.fs.task.dto.PublicIndexDto">
-        SELECT id, title, cover_url, video_url, "short" as video_type, summary
-        FROM ct_short_video
-        WHERE is_original = 1 AND del_flag = 0
-        <if test="tags != null">
-            AND tags LIKE CONCAT('%', #{tags}, '%')
-        </if>
-        UNION ALL
-        SELECT id, title, cover_url, video_url, "long" as video_type, summary
-        FROM ct_long_video
-        WHERE is_original = 1 AND del_flag = 0
-        <if test="tags != null">
-            AND tags LIKE CONCAT('%', #{tags}, '%')
-        </if>
-    </select>
-    <select id="getTaskDoctorDetail" resultType="com.fs.doctor.domain.Doctor">
-        SELECT
-            d.institution AS hospital,
-            d.job_title AS  jobTitle,
-            d.department,
-            d.doctor_name as doctorName,
-            d.institution
-        FROM task_delivery_info tdi
-                 JOIN task_info ti ON tdi.task_id = ti.id
-                 JOIN doctor d ON ti.doctor_id = d.id
-        WHERE tdi.project_link = #{id}
-          AND tdi.deleted = 0
-          AND ti.deleted = 0
-          AND d.deleted = 0
-            LIMIT 1
-    </select>
-    <select id="getTaskByTargetId" resultType="com.fs.task.domain.TaskInfo">
-        select * from task_info where target_id = #{targetId}
-    </select>
-
-</mapper>

+ 0 - 112
fs-service/src/main/resources/mapper/task/TaskMaterialInfoMapper.xml

@@ -1,112 +0,0 @@
-<?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.fs.task.mapper.TaskMaterialInfoMapper">
-
-    <resultMap type="TaskMaterialInfo" id="TaskMaterialInfoResult">
-        <result property="id"    column="id"    />
-        <result property="taskId"    column="task_id"    />
-        <result property="materialName"    column="material_name"    />
-        <result property="materialDesc"    column="material_desc"    />
-        <result property="materialLink"    column="material_link"    />
-        <result property="createTime"    column="create_time"    />
-        <result property="updateTime"    column="update_time"    />
-        <result property="createBy"    column="create_by"    />
-        <result property="updateBy"    column="update_by"    />
-        <result property="deleted"    column="deleted"    />
-        <result property="fileSize"    column="file_size"    />
-    </resultMap>
-
-    <sql id="selectTaskMaterialInfoVo">
-        select
-        tmi.id,
-        tmi.task_id,
-        tmi.material_name,
-        tmi.material_desc,
-        tmi.material_link,
-        tmi.create_time,
-        tmi.update_time,
-        tmi.create_by,
-        tmi.update_by,
-        tmi.deleted,
-        tmi.file_size
-        from task_material_info tmi
-        left join task_info ti on ti.id = tmi.task_id
-    </sql>
-
-    <select id="selectTaskMaterialInfoList" parameterType="TaskMaterialInfo" resultMap="TaskMaterialInfoResult">
-        <include refid="selectTaskMaterialInfoVo"/>
-        <where>
-            <!-- 公司过滤(必须传入 companyId) -->
-            <if test="companyId != null">
-                and ti.company_id = #{companyId}
-            </if>
-            <if test="taskId != null "> and task_id = #{taskId}</if>
-            <if test="materialName != null  and materialName != ''"> and material_name like concat('%', #{materialName}, '%')</if>
-            <if test="materialDesc != null  and materialDesc != ''"> and material_desc = #{materialDesc}</if>
-            <if test="materialLink != null  and materialLink != ''"> and material_link = #{materialLink}</if>
-            <if test="deleted != null "> and deleted = #{deleted}</if>
-        </where>
-        <!-- 添加排序:最新创建的材料在最前面 -->
-        order by create_time desc
-    </select>
-
-    <select id="selectTaskMaterialInfoById" parameterType="Long" resultMap="TaskMaterialInfoResult">
-        <include refid="selectTaskMaterialInfoVo"/>
-        where id = #{id}
-    </select>
-
-    <insert id="insertTaskMaterialInfo" parameterType="TaskMaterialInfo" useGeneratedKeys="true" keyProperty="id">
-        insert into task_material_info
-        <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="taskId != null">task_id,</if>
-            <if test="materialName != null">material_name,</if>
-            <if test="materialDesc != null">material_desc,</if>
-            <if test="materialLink != null">material_link,</if>
-            <if test="createTime != null">create_time,</if>
-            <if test="updateTime != null">update_time,</if>
-            <if test="createBy != null">create_by,</if>
-            <if test="updateBy != null">update_by,</if>
-            <if test="deleted != null">deleted,</if>
-         </trim>
-        <trim prefix="values (" suffix=")" suffixOverrides=",">
-            <if test="taskId != null">#{taskId},</if>
-            <if test="materialName != null">#{materialName},</if>
-            <if test="materialDesc != null">#{materialDesc},</if>
-            <if test="materialLink != null">#{materialLink},</if>
-            <if test="createTime != null">#{createTime},</if>
-            <if test="updateTime != null">#{updateTime},</if>
-            <if test="createBy != null">#{createBy},</if>
-            <if test="updateBy != null">#{updateBy},</if>
-            <if test="deleted != null">#{deleted},</if>
-         </trim>
-    </insert>
-
-    <update id="updateTaskMaterialInfo" parameterType="TaskMaterialInfo">
-        update task_material_info
-        <trim prefix="SET" suffixOverrides=",">
-            <if test="taskId != null">task_id = #{taskId},</if>
-            <if test="materialName != null">material_name = #{materialName},</if>
-            <if test="materialDesc != null">material_desc = #{materialDesc},</if>
-            <if test="materialLink != null">material_link = #{materialLink},</if>
-            <if test="createTime != null">create_time = #{createTime},</if>
-            <if test="updateTime != null">update_time = #{updateTime},</if>
-            <if test="createBy != null">create_by = #{createBy},</if>
-            <if test="updateBy != null">update_by = #{updateBy},</if>
-            <if test="deleted != null">deleted = #{deleted},</if>
-        </trim>
-        where id = #{id}
-    </update>
-
-    <delete id="deleteTaskMaterialInfoById" parameterType="Long">
-        delete from task_material_info where id = #{id}
-    </delete>
-
-    <delete id="deleteTaskMaterialInfoByIds" parameterType="String">
-        delete from task_material_info where id in
-        <foreach item="id" collection="array" open="(" separator="," close=")">
-            #{id}
-        </foreach>
-    </delete>
-</mapper>