| | |
| | | <result column="name" property="name"/> |
| | | <result column="pId" property="pId"/> |
| | | <result column="eqid" property="eqid"/> |
| | | <result column="tenant_id" property="tenant_id"/> |
| | | </resultMap> |
| | | |
| | | <resultMap id="treeNodeResultMap" type="org.springblade.core.tool.node.TreeNode"> |
| | | <id column="id" property="id"/> |
| | | <result column="parent_id" property="parentId"/> |
| | | <result column="title" property="title"/> |
| | | <result column="value" property="value"/> |
| | | <result column="key" property="key"/> |
| | | <result column="has_children" property="hasChildren"/> |
| | | </resultMap> |
| | | |
| | | |
| | |
| | | SELECT COUNT(*) as cou,waringType FROM `sys_alarm` where DATE_FORMAT(alarmTime,'%Y-%m-%d')>=#{beginTime} and DATE_FORMAT(alarmTime,'%Y-%m-%d')<=#{endTime} GROUP BY waringType ORDER BY cou desc |
| | | </select> |
| | | |
| | | <select id="lazyTree" resultMap="treeNodeResultMap" > |
| | | SELECT |
| | | dept.id, |
| | | dept.pId as parent_id, |
| | | dept.name AS title, |
| | | dept.eqid AS "value", |
| | | dept.eqid AS "key", |
| | | ( |
| | | SELECT |
| | | CASE WHEN count(1) > 0 THEN 1 ELSE 0 END |
| | | FROM |
| | | sys_catalog |
| | | WHERE |
| | | pId = dept.id |
| | | ) AS "has_children" |
| | | FROM |
| | | sys_catalog dept |
| | | WHERE |
| | | dept.pId = #{param2} |
| | | <if test="param1!=null and param1!=''"> |
| | | and dept.tenant_id = #{param1} |
| | | </if> |
| | | </select> |
| | | |
| | | </mapper> |