洪城义警-正式版后台
tangzy
2021-11-04 1eed1bd989b81e1bb32979b49c5bc2e51b366cd4
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
<?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="org.springblade.modules.taskqd.mapper.TaskqdMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="taskResultMap" type="org.springblade.modules.taskqd.vo.TaskqdVO">
        <id column="id" property="id"/>
        <result column="rname" property="rname"/>
        <result column="content" property="content"/>
        <result column="time" property="time"/>
        <result column="province" property="province"/>
        <result column="city" property="city"/>
        <result column="county" property="county"/>
        <result column="jnum" property="jnum"/>
        <result column="line" property="line"/>
        <result column="rtype" property="rtype"/>
        <result column="serid" property="serid"/>
        <result column="integral" property="integral"/>
        <result column="url" property="url"/>
    </resultMap>
 
 
    <update id="updatet">
        update sys_taskqd
        SET serid=#{serid},
            num=#{num}
        where id = #{id}
    </update>
 
 
    <!--日常任务列表-->
    <select id="selectList" resultMap="taskResultMap">
        select jnum, num, serid
        from sys_taskqd
        where id = #{id}
    </select>
 
 
    <select id="selectLi" resultMap="taskResultMap">
        SELECT A.*,IFNULL(B.num,0) as nums FROM (
        select * from sys_taskqd where 1=1
        <if test="type==0">
            and find_in_set(#{serid}, serid)) A LEFT JOIN (SELECT COUNT(*) as num,hdid,serid FROM sys_taskfk WHERE
            serid=#{serid} GROUP BY hdid,serid) B ON A.id=B.hdid
        </if>
        <if test="type==1">
            and id NOT IN ( SELECT id FROM sys_taskqd WHERE find_in_set(#{serid}, serid ))) A LEFT JOIN (SELECT COUNT(*)
            as num,hdid,serid FROM sys_taskfk WHERE serid=#{serid} GROUP BY hdid,serid) B ON A.id=B.hdid
        </if>
    </select>
</mapper>