于杰
2025-08-04 a00a32e331bbf32ebaf6850150977204d9de381a
north-glass-erp/src/main/resources/mapper/pp/ReportingWork.xml
@@ -102,7 +102,7 @@
    </select>
    <select id="SelectWorkBasicTeamsMp">
        select * from erp_user_info.`user` WHERE address=#{process}
        select id,login_name,user_name,address from erp_user_info.`user` WHERE address=#{process}
    </select>
    <!--    查询流程卡工艺流程-->
@@ -298,15 +298,13 @@
    <select id="historyTeamsMp">
        SELECT
            bdp.id,
            bdp.basic_type,
            bd.id,
            bd.basic_type,
            rw.teams  as basic_name,
            bd.basic_name,bd.id AS basic_category,
            rw.process
        FROM
            sd.basic_data AS bd
                LEFT JOIN `basic_data_produce` AS bdp
                          ON bd.id = bdp.basic_category
                right join (
                select distinct process,teams from
                    (   select distinct rw.this_process as  process,rw.teams_groups_name as teams
@@ -315,8 +313,6 @@
                    ) as t
            ) as  rw
                           on rw.process=bd.basic_name
        WHERE
            bdp.basic_type = 'teamsgroups'
        GROUP BY rw.process,rw.teams
    </select>
@@ -326,10 +322,9 @@
            bd.basic_name AS basic_category
        FROM
            sd.basic_data AS bd
                LEFT JOIN `basic_data_produce` AS bdp ON bd.id = bdp.basic_category
        WHERE
            bd.basic_category = 'process'
          AND bdp.basic_type = 'teamsgroups'
          AND POSITION(bd.basic_name in CONCAT(#{historyProcess},#{process}))
    </select>
@@ -545,8 +540,8 @@
            left join sd.`order` as o on o.order_id=rw.order_id
        where rw.reviewed_state != 2
          and rw.reporting_work_time >= #{selectTime1}
    AND rw.reporting_work_time &lt;  #{selectTime2}
          and date(rw.reporting_work_time) >= date(#{selectTime1})
    AND date(rw.reporting_work_time) &lt;=  date(#{selectTime2})
          and position(#{orderId} in rw.order_id)
          and rw.reviewed_state!=-1
          and o.create_order>0
@@ -557,7 +552,8 @@
            and o.order_id regexp #{reportingWork.orderId}
        </if>
        <if test="reportingWork.processId != null and reportingWork.processId != ''">
            and rw.process_id regexp #{reportingWork.processId}
            and CONCAT(rw.process_id,'/',rwd.goup) LIKE CONCAT('%', #{reportingWork.processId}, '%')
        </if>
        <if test="reportingWork.order.project != null and reportingWork.order.project != ''">
            and o.project regexp #{reportingWork.order.project}