龚焕茏
2024-08-02 8322676d29e1202e093016233b5c260d29fe92e7
ycl-server/src/main/resources/mapper/zgyw/YwUnitMapper.xml
@@ -108,4 +108,15 @@
                 INNER JOIN t_unit_people tup ON tup.unit_id = tyw.id and tyw.deleted = 0
                 INNER JOIN t_yw_people typ ON tup.yw_people_id = typ.id AND typ.user_id = #{userId} AND typ.deleted = 0
    </select>
    <select id="ywUnitCount" resultType="java.util.Map">
        SELECT
            u.unit_name AS name,
            COUNT(tcs.id) AS num
        FROM
            t_contract_score tcs
                LEFT JOIN t_yw_unit u ON tcs.unit_id = u.id
        WHERE tcs.deleted = 0
        GROUP BY tcs.unit_id
    </select>
</mapper>