WeatherDao.xml 8.85 KB
Newer Older
Rensq's avatar
Rensq committed
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 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218
<?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.testor.module.mq.dao.WeatherDao">
    <select id="getInfoByList" parameterType="java.lang.String" resultType="com.testor.module.mq.vo.WeatherWarnInfoVO">
        select   id, signal_type_code as code,record_time as warnTime,sender,signal_level_code as colorMsg,sender_area_code as
        areaCode from t_weather_notice
        <where>
            TO_CHAR(record_time)=TO_CHAR(now())
            <if test="list != null and list.size()>0">
                AND sender_area_code IN
                <foreach item="item" index="index" collection="list" open="(" close=")" separator=",">
                    #{item}
                </foreach>
            </if>
        </where>
        order by record_time desc
    </select>


    <select id="selectDirct" resultType="java.lang.String">
        select message
        from t_weather_dict
        where code = #{code}
    </select>
    <select id="numberOfUsers" resultType="java.lang.Integer">
        SELECT COUNT(tsu.user_id)
        FROM t_sys_org AS tso
                 LEFT JOIN t_sys_user AS tsu ON tso.org_id = tsu.org_id AND tsu.status = '0'
        WHERE tso.org_id = #{orgId}
        GROUP BY tso.org_id, tso.org_name;
    </select>
    <select id="dutyLogQuantity" resultType="java.lang.Integer">

        SELECT COUNT(tsdl.id)
        FROM t_sys_org AS tso
                 LEFT JOIN t_sys_duty_log AS tsdl ON tso.org_id = tsdl.company_id AND tsdl.status = '0'
        WHERE tso.org_id = #{orgId}
        GROUP BY tso.org_id, tso.org_name;
    </select>
    <select id="numberOfRiskSources" resultType="java.lang.Integer">
        SELECT COUNT(tsrs.id)
        FROM t_sys_org AS tso
                 LEFT JOIN t_safe_risk_source AS tsrs ON tso.org_id = tsrs.org_id AND tsrs.status = '0'
        WHERE tso.org_id = #{orgId}
        GROUP BY tso.org_id, tso.org_name;
    </select>
    <select id="numberOfRiskPoints" resultType="java.lang.Integer">
        SELECT COUNT(tsrp.id)
        FROM t_sys_org AS tso
                 LEFT JOIN t_safe_risk_point AS tsrp ON tso.org_id = tsrp.org_id AND tsrp.status = '0'
        WHERE tso.org_id = #{orgId}
        GROUP BY tso.org_id, tso.org_name;
    </select>
    <select id="theNumberOfHiddenLedger" resultType="java.lang.Integer">
        SELECT COUNT(tsho.id)
        FROM t_sys_org AS tso
                 LEFT JOIN t_safe_hazard_org AS tsho ON tso.org_id = tsho.org_id AND tsho.status = '0'
        WHERE tso.org_id = #{orgId}
        GROUP BY tso.org_id, tso.org_name;
    </select>
    <select id="numberOfMonitoringDevices" resultType="java.lang.Integer">
        SELECT count(t.id)
        FROM t_sys_org AS tso
                 LEFT JOIN t_video_equipment_info t
                           on tso.org_id = t.org_id and t.status = '0'
        WHERE tso.org_id = #{orgId}
        GROUP BY tso.org_id, tso.org_name;
    </select>
    <select id="totalAlarm" resultType="java.lang.Integer">
        SELECT count(t.id)
        FROM t_sys_org AS tso
                 LEFT JOIN t_global_alarm t
                           on tso.org_id = t.org_id and t.status = '0'
        WHERE tso.org_id = #{orgId}
        GROUP BY tso.org_id, tso.org_name;
    </select>
    <select id="numberOfHazardousOperations" resultType="java.lang.Integer">
        SELECT count(t.id)
        FROM t_sys_org AS tso
                 LEFT JOIN t_job_statistics t
                           on tso.org_id = t.org_id and t.status = '0'
        WHERE tso.org_id = #{orgId}
        GROUP BY tso.org_id, tso.org_name;
    </select>
    <select id="numberOfInterestedParties" resultType="java.lang.Integer">
        SELECT count(t.id)
        FROM t_sys_org AS tso
                 LEFT JOIN t_partner_org_res t
                           on tso.org_id = t.org_id and t.status = '0'
        WHERE tso.org_id = #{orgId}
        GROUP BY tso.org_id, tso.org_name;
    </select>
    <select id="numberOfRelevantPartyPersonnel" resultType="java.lang.Integer">
        SELECT count(t.id)
        FROM t_sys_org AS tso
                 LEFT JOIN t_partner_staff t
                           on tso.org_id = t.org_id and t.status = '0'
        WHERE tso.org_id = #{orgId}
        GROUP BY tso.org_id, tso.org_name;
    </select>

    <select id="numberOfEmergencyPlans" resultType="java.lang.Integer">
        SELECT count(t.id)
        FROM t_sys_org AS tso
                 LEFT JOIN t_contingency_plan t
                           on tso.org_id = t.org_id and t.status = '0'
        WHERE tso.org_id = #{orgId}
        GROUP BY tso.org_id, tso.org_name;
    </select>
    <select id="numberOfStaffTraining" resultType="java.lang.Integer">
        SELECT count(t.id)
        FROM t_sys_org AS tso
                 LEFT JOIN t_train_my_management t
                           on tso.org_id = t.org_id and t.status = '0'
        WHERE tso.org_id = #{orgId}
        GROUP BY tso.org_id, tso.org_name;
    </select>
    <select id="trisimultaneousQuantity" resultType="java.lang.Integer">
        SELECT count(t.id)
        FROM t_sys_org AS tso
                 LEFT JOIN t_three_time t
                           on tso.org_id = t.org_id and t.status = '0'
        WHERE tso.org_id = #{orgId}
        GROUP BY tso.org_id, tso.org_name;
    </select>
    <select id="energyConservationQuantity" resultType="java.lang.Integer">
        SELECT count(t.id)
        FROM t_sys_org AS tso
                 LEFT JOIN t_environment_monthly t
                           on tso.org_id = t.org_id and t.status = '0'
        WHERE tso.org_id = #{orgId}
        GROUP BY tso.org_id, tso.org_name;
    </select>
    <select id="numberOfBrightSpots" resultType="java.lang.Integer">
        SELECT count(t.id)
        FROM t_sys_org AS tso
                 LEFT JOIN t_fives_tool_use t
                           on tso.org_id = t.org_id and t.status = '0'
        WHERE tso.org_id = #{orgId}
        GROUP BY tso.org_id, tso.org_name;
    </select>
    <select id="numberOfAccidents" resultType="java.lang.Integer">
        SELECT count(t.id)
        FROM t_sys_org AS tso
                 LEFT JOIN t_accident_report t
                           on tso.org_id = t.org_id and t.status = '0'
        WHERE tso.org_id = #{orgId}
        GROUP BY tso.org_id, tso.org_name;
    </select>
    <select id="quantityOfAnnouncement" resultType="java.lang.Integer">
        SELECT count(t.id)
        FROM t_sys_org AS tso
                 LEFT JOIN t_sys_notice t
                           on tso.org_id = t.org_id and t.status = '0'
        WHERE tso.org_id = #{orgId}
        GROUP BY tso.org_id, tso.org_name;
    </select>
    <select id="newsQuantity" resultType="java.lang.Integer">
        SELECT count(t.id)
        FROM t_sys_org AS tso
                 LEFT JOIN t_sys_news t
                           on tso.org_id = t.release_org_id and t.status = '0'
        WHERE tso.org_id = #{orgId}
        GROUP BY tso.org_id, tso.org_name;
    </select>
    <select id="numberOfRentalWarehouses" resultType="java.lang.Integer">
        SELECT count(t.id)
        FROM t_sys_org AS tso
                 LEFT JOIN t_lease_bank t
                           on tso.org_id = t.org_id and t.status = '0'
        WHERE tso.org_id = #{orgId}
        GROUP BY tso.org_id, tso.org_name;
    </select>
    <select id="equipmentLedgerEntryQuantity" resultType="java.lang.Integer">
        SELECT count(t.id)
        FROM t_sys_org AS tso
                 LEFT JOIN t_safe_equipment t
                           on tso.org_id = t.org_id and t.status = '0'
        WHERE tso.org_id = #{orgId}
        GROUP BY tso.org_id, tso.org_name;
    </select>
    <select id="spaceLedgerEntryQuantity" resultType="java.lang.Integer">
        SELECT count(t.id)
        FROM t_sys_org AS tso
                 LEFT JOIN t_safe_space t
                           on tso.org_id = t.org_id and t.status = '0'
        WHERE tso.org_id = #{orgId}
        GROUP BY tso.org_id, tso.org_name;
    </select>
    <select id="selectToDoList" resultType="java.lang.Integer" parameterType="com.tongtech.tfw.workflow.apis.task.model.dto.TodoTaskSqlParam">
        SELECT DISTINCT
        count(task.ID_)
        FROM
        act_ru_task task
        LEFT JOIN
        act_hi_procinst hiproc ON task.PROC_INST_ID_ = hiproc.PROC_INST_ID_
        LEFT JOIN
        act_re_procdef procdef ON task.PROC_DEF_ID_ = procdef.ID_
        LEFT JOIN
        act_ru_identitylink idl ON task.ID_ = idl.TASK_ID_
        LEFT JOIN
        act_id_user usr ON hiproc.START_USER_ID_ = usr.ID_
        WHERE
        ((task.ASSIGNEE_ = #{todo.userId})
        OR (
        task.ASSIGNEE_ IS NULL and idl.USER_ID_ = #{todo.userId}
        OR (task.ASSIGNEE_ IS NULL and idl.GROUP_ID_ IN (SELECT
        g1.GROUP_ID_
        FROM
        act_id_membership g1
        WHERE
        g1.user_id_ = #{todo.userId}))
        ))
        ORDER BY task.CREATE_TIME_ desc
    </select>
</mapper>