2
13693261870
2022-09-16 653761a31dfeb50dd3d007e892d69c90bf0cdafc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.landtool.lanbase.modules.res.dao.PingTaiMenHuMapper" >
  <select id="selectWodeshenqing" parameterType="java.lang.Integer" resultType="java.lang.Integer">
    select COUNT(*) from RES_APPLYRECOMMEND a left join RES_MAININFO b on a.RESOURCEID = b.RESOURCEID where a.APPUSERID=#{userid}
    and RESOURCESTATUS=0  and apptype = 0 and ISRECOMMEND = 0
  </select>
  <select id="selectWodefabu" parameterType="java.lang.Integer" resultType="java.lang.Integer">
    SELECT COUNT(*) FROM RES_MAININFO where CREATEUSERID =#{userid}
    <!--(RESOURCESTATUS = 0 or RESOURCESTATUS = 3) and    //查询全部状态的资源  alert ykm 2018/12/26 -->
  </select>
  <select id="selectFaBuShenHe" resultType="java.lang.Integer">
    select COUNT(*) from RES_MAININFO where RESOURCESTATUS=0 and AUDITSTATUS=1
    <if test="ispermission != 0">
      and CREATEUSERID=#{ispermission}
    </if>
  </select>
  <select id="selectShenQingPiFu"  resultType="java.lang.Integer">
    select COUNT(*) from RES_APPLYRECOMMEND a left join RES_MAININFO b on a.RESOURCEID = b.RESOURCEID
    where auditresult = 0 and RESOURCESTATUS=0 and ISRECOMMEND = 0
    <if test="ispermission != 0">
      and CREATEUSERID=#{ispermission}
    </if>
    <if test="ispermission == 0">  <!--有权限批复,即当前用户是发布人且为管理员 或者是委托批复-->
      and (CREATEUSERID = #{createuserid} or INSTEADAUDIT = 1)
    </if>
  </select>
  <select id="selectWoDeShouCang" parameterType="java.lang.Integer" resultType="java.lang.Integer">
    select count(*) from RES_ACTIONRECORD a
    left join RES_MAININFO b on a.ResourceId = b.ResourceId
    where a.ActionType = '收藏' and a.UserId = #{userid}
    and b.ResourceStatus = 0 and b.AuditStatus = 2
  </select>
  <select id="selectWoDeDingYue" parameterType="java.lang.Integer" resultType="java.lang.Integer">
    select COUNT(*) from RES_SUBSCRIPTIONS a left join RES_MAININFO b on a.RESOURCEID = b.RESOURCEID  where RESOURCESTATUS = 0 and APPUSERID = #{userid}
  </select>
</mapper>