From b04753affc29f1042d0eb75b0af87824a0f4a8aa Mon Sep 17 00:00:00 2001 From: fuliqi <fuliqi@qq.com> Date: 星期五, 09 八月 2024 15:41:48 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- ycl-server/src/main/resources/mapper/zgyw/YwUnitMapper.xml | 20 ++++++++++++++++++++ 1 files changed, 20 insertions(+), 0 deletions(-) diff --git a/ycl-server/src/main/resources/mapper/zgyw/YwUnitMapper.xml b/ycl-server/src/main/resources/mapper/zgyw/YwUnitMapper.xml index 7908573..21f0424 100644 --- a/ycl-server/src/main/resources/mapper/zgyw/YwUnitMapper.xml +++ b/ycl-server/src/main/resources/mapper/zgyw/YwUnitMapper.xml @@ -99,4 +99,24 @@ #{id} </foreach> </delete> + + <select id="getByUserId" resultMap="YwUnitResult"> + SELECT + tyw.* + FROM + t_yw_unit tyw + 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> -- Gitblit v1.8.0