洪城义警-正式版后台
zengh
2022-09-14 df878618a8882fc057a5863738df43e1fcd878ea
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
<?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.zc.mapper.ZcMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="zcResultMap" type="org.springblade.modules.zc.vo.ZcVO">
        <id column="id" property="id"/>
        <result column="username" property="username"/>
        <result column="password" property="password"/>
        <result column="sname" property="sname"/>
        <result column="sex" property="sex"/>
        <result column="phone" property="phone"/>
        <result column="zctime" property="zctime"/>
        <result column="type" property="type"/>
        <result column="deptid" property="deptid"/>
        <result column="parent_id" property="parentId"/>
        <result column="jurisdiction" property="jurisdiction"/>
        <result column="cardid" property="cardid"/>
        <result column="examination_type" property="examination_type"/>
        <result column="examination_mx" property="examination_mx"/>
        <result column="audit_time" property="auditTime"/>
        <result column="address" property="address"/>
        <result column="team" property="team"/>
    </resultMap>
 
 
    <select id="selectZcPage" resultMap="zcResultMap">
        select * from act_zc where
        1 = 1
        <if test="zc.username != null and zc.username != '' ">
            and username like CONCAT('%',#{zc.username},'%')
        </if>
        <if test="zc.sname != null and zc.sname != '' ">
            and sname like CONCAT('%',#{zc.sname},'%')
        </if>
        <if test="zc.sex != null and zc.sex != '' ">
            and sex like CONCAT('%',#{zc.sex},'%')
        </if>
        <if test="zc.type != null and zc.type != '' ">
            and type like CONCAT('%',#{zc.type},'%')
        </if>
        <if test="zc.cardid != null and zc.cardid != '' ">
            and cardid like CONCAT('%',#{zc.cardid},'%')
        </if>
        <if test="zc.examination_type != null and zc.examination_type != '' ">
            and examination_type = #{zc.examination_type}
        </if>
        <if test="zc.jurisdiction != null and zc.jurisdiction != '' ">
            and (jurisdiction = #{zc.jurisdiction} or workjurisdiction = #{zc.jurisdiction})
        </if>
        and type != 1 ORDER BY zctime DESC
    </select>
 
 
    <!--注册新增-->
    <insert id="inster" useGeneratedKeys="true" keyProperty="id" keyColumn="id">
        insert into act_zc(username, password, sname, sex, phone, zctime, deptid, parent_id, jurisdiction, cardid,address,workaddress, workjurisdiction, signals,job_unit,team)
        values (#{username}, #{password}, #{sname}, #{sex}, #{phone}, #{zctime}, #{deptid}, #{parentId},
                #{jurisdiction}, #{cardid},#{address},#{workaddress},#{workjurisdiction},#{signals},#{jobUnit},#{team})
    </insert>
 
    <select id="selectType" resultType="String">
        select type
        from act_zc
        where username = #{param1}
    </select>
 
    <update id="updateExamine">
        update act_zc set type=1 where id in (${ids});
        update blade_user set stype=1,firstlogin = "1" where  account in
        <foreach collection="names" index="index" item="item" open="(" separator="," close=")">
            "${item}"
        </foreach>
    </update>
 
    <select id="selecyZcCount" resultType="java.lang.Integer">
        select count(*)
        from act_zc
        where username =#{account}
    </select>
 
    <delete id="deleteZc">
        delete from  act_zc where username=#{account}
    </delete>
 
</mapper>