wl
2022-10-26 6b0c99943f1ae73a55f54a721473b7cc8ddd1c24
ycl-platform/src/main/resources/mapper/caseHandler/DisposeRecordMapper.xml
@@ -4,41 +4,63 @@
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.ycl.entity.caseHandler.DisposeRecord">
        <id column="id" property="id" />
        <result column="base_case_id" property="baseCaseId" />
        <result column="workflow_config_step_id" property="workflowConfigStepId" />
        <result column="step_name" property="stepName" />
        <result column="start_time" property="startTime" />
        <result column="handler_role_id" property="handlerRoleId" />
        <result column="end_time" property="endTime" />
        <result column="state" property="state" />
        <result column="handler_id" property="handlerId" />
        <result column="create_user" property="createUser" />
        <result column="create_time" property="createTime" />
        <id column="id" property="id"/>
        <result column="base_case_id" property="baseCaseId"/>
        <result column="workflow_config_step_id" property="workflowConfigStepId"/>
        <result column="step_name" property="stepName"/>
        <result column="start_time" property="startTime"/>
        <result column="handler_role_id" property="handlerRoleId"/>
        <result column="end_time" property="endTime"/>
        <result column="state" property="state"/>
        <result column="handler_id" property="handlerId"/>
        <result column="create_user" property="createUser"/>
        <result column="create_time" property="createTime"/>
    </resultMap>
    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id, base_case_id, step_name, start_time, handler_role_id, end_time, state, handler_id, create_user, create_time
        id
        , base_case_id, step_name, start_time, handler_role_id, end_time, state, handler_id, create_user, create_time
    </sql>
    <select id="selectMyBackList" resultType="com.ycl.vo.MyBacklogVO">
        SELECT
            t3.event_source,
            t3.category,
            t2.step_name,
            t3.`code`,
            t2.create_time
        t3.event_source,
        t3.category,
        t2.step_name,
        t3.`code`,
        t2.create_time,
        t2.limit_time
        FROM
            ums_admin_role_relation t1
                JOIN ums_dispose_record t2 ON t1.role_id = t2.handler_role_id
                JOIN ums_base_case t3 ON t2.base_case_id=t3.id
        ums_admin_role_relation t1
        JOIN ums_dispose_record t2 ON t1.role_id = t2.handler_role_id
        JOIN ums_base_case t3 ON t2.base_case_id=t3.id
        <where>
            t1.admin_id = #{id}
            AND ISNULL( t2.end_time )
        <if test="code!='' and code!=null">
            and t3.`code` LIKE CONCAT('%',#{code},'%')
        </if>
            <if test="code!='' and code!=null">
                and t3.`code` LIKE CONCAT('%',#{code},'%')
            </if>
        </where>
        union all
        SELECT
        t3.event_source,
        t3.category,
        t2.step_name,
        t3.`code`,
        t2.create_time,
        t2.limit_time
        FROM
        ums_dispose_record t2
        LEFT JOIN ums_base_case t3 ON t2.base_case_id = t3.id
        <where>
            t2.handler_id = #{id}
            AND ISNULL(
            t2.end_time
            )
            <if test="code!='' and code!=null">
                and t3.`code` LIKE CONCAT('%',#{code},'%')
            </if>
        </where>
    </select>
</mapper>