Administrator
2021-08-13 ddebcfaf85cbb400668f38b1efd82e439c6e1012
src/main/java/org/springblade/modules/system/mapper/UserMapper.xml
@@ -41,7 +41,10 @@
        <result column="securitynumber" property="securitynumber"/>
        <result column="dispatch" property="dispatch"/>
        <result column="my_picture" property="myPicture"/>
        <result column="deptname" property="deptname"/>
        <result column="is_apply" property="isApply"/>
        <result column="is_apply" property="isApply"/>
        <result column="is_train" property="isTrain"/>
        <result column="birthtime" property="birthtime"/>
    </resultMap>
    <select id="selectUserPage" resultMap="userResultMap">
@@ -207,7 +210,6 @@
    <select id="selectUserPageSecurityApply" resultMap="userResultMap">
        select
        bu.*,
        sa.id applyId,sa.apply_status applyStatus,
        bd.dept_name
        from
        blade_user bu
@@ -215,10 +217,6 @@
        blade_dept bd
        on
        bu.dept_id = bd.id
        left join
        sys_apply sa
        on
        sa.user_id = bu.id
        where
        bu.is_deleted = 0
        and
@@ -234,8 +232,8 @@
        <if test="user.deptId!=null and user.deptId != ''">
            and bu.dept_id = #{user.deptId}
        </if>
        <if test="user.applyStatus!=null">
            and sa.apply_status = #{user.applyStatus}
        <if test="user.isApply!=null">
            and sa.is_apply = #{user.isApply}
        </if>
        <if test="user.roleId!=null and user.roleId != ''">
            and bu.role_id = #{user.roleId}
@@ -268,4 +266,48 @@
        ORDER BY bu.id
    </select>
    <!--保安员列表树 安员列表树,帅选无保安证,下拉tree-->
    <select id="getSecurityApplyTree" resultType="org.springblade.modules.system.node.TreeNode">
        (select #{user.deptId} as id,
            '全部' as name,
            0 as parentId
            from blade_user)
        union all
        (select
            bu.id,
            bu.real_name as name,
            #{user.deptId} parentId
        from
            blade_user bu
        left join
        blade_dept bd
        on
        bu.dept_id = bd.id
        where
        bu.is_deleted = 0
        and
        bd.dept_category = 1
        and
        (hold = 2 or hold = 3)
        and bd.id = #{user.deptId}
        )
    </select>
    <select id="selectInr" resultType="java.util.HashMap">
        SELECT real_name as realName,id FROM  blade_user
        WHERE role_id='1412226235153731586'
          <if test="deptid!=null and deptid!='' and dept!='1123598813738675201'">
              and dept_id=#{deptid}
          </if>
    </select>
    <!--查询当前年份已有的保安证编号-->
    <select id="getSecurityPaperCount" resultType="java.lang.Integer">
        select count(*) from blade_user
        where securitynumber like concat('%', #{pre},'%')
    </select>
</mapper>