智慧保安后台管理-外网项目备份
tangzy
2021-08-21 568025796c345fe0fdb7daf90b0d0f01f73ab9fc
src/main/java/org/springblade/modules/information/mapper/InformationMapper.xml
@@ -30,6 +30,11 @@
    </resultMap>
    <insert id="insertIn" useGeneratedKeys="true" keyProperty="id">
        insert into sys_information (creditcode) values (#{information.creditcode})
    </insert>
    <select id="selectInformationPage" resultMap="informationResultMap">
        select * from sys_information where 1=1
        <if test="information.enterprisename!=null and information.enterprisename!=''">
@@ -124,17 +129,19 @@
        ) B ON A.dept_id = B.dept_id
        WHERE A.dept_id = #{deptid}
    </select>
    <!--保安员持证和未持证数量-->
    <select id="selectHold" resultType="java.util.HashMap">
        SELECT IFNULL(A.thisnum, 0) AS cz,
               IFNULL(B.lastnum, 0) AS wcz
        FROM (SELECT COUNT(*) AS thisnum, dept_id
              FROM blade_user
              WHERE role_id = '1412226235153731586' AND hold = 0
              WHERE role_id = '1412226235153731586' AND hold = 1
              GROUP BY dept_id) A
                 LEFT JOIN (SELECT COUNT(*) AS lastnum, dept_id
                            FROM blade_user
                            WHERE role_id = '1412226235153731586' AND hold = 1
                            WHERE role_id = '1412226235153731586' AND hold = 2
                            GROUP BY dept_id) B ON A.dept_id = B.dept_id
        WHERE A.dept_id =#{deptid}
    </select>