地质所 沉降监测网建设项目
zmk
2024-05-15 9e3afc6d0fa514f986d3fea40fa23124e6fb5070
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
<?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.javaweb.geo.mapper.LaborUnitMapper">
    
    <resultMap type="LaborUnit" id="LaborUnitResult">
        <result property="ids"    column="ids"    />
        <result property="fullName"    column="full_name"    />
        <result property="laborCode"    column="labor_code"    />
        <result property="laborRange"    column="labor_range"    />
        <result property="laborStatus"    column="labor_status"    />
        <result property="laborType"    column="labor_type"    />
        <result property="datasource"    column="datasource"    />
    </resultMap>
 
    <sql id="selectLaborUnitVo">
        select ids, full_name, labor_code, labor_range, labor_status, labor_type, datasource from js_labor_unit
    </sql>
 
    <select id="selectLaborUnitList" parameterType="LaborUnit" resultMap="LaborUnitResult">
        <include refid="selectLaborUnitVo"/>
        <where>  
            <if test="ids != null  and ids != ''"> and ids = #{ids}</if>
            <if test="fullName != null  and fullName != ''"> and full_name like concat('%', #{fullName}, '%')</if>
            <if test="laborCode != null  and laborCode != ''"> and labor_code = #{laborCode}</if>
            <if test="laborRange != null  and laborRange != ''"> and labor_range = #{laborRange}</if>
            <if test="laborStatus != null  and laborStatus != ''"> and labor_status = #{laborStatus}</if>
            <if test="laborType != null  and laborType != ''"> and labor_type = #{laborType}</if>
            <if test="datasource != null  and datasource != ''"> and datasource = #{datasource}</if>
        </where>
    </select>
    
    <select id="selectLaborUnitById" parameterType="String" resultMap="LaborUnitResult">
        <include refid="selectLaborUnitVo"/>
        where ids = #{ids}
    </select>
        
    <insert id="insertLaborUnit" parameterType="LaborUnit">
        insert into js_labor_unit
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="ids != null  and ids != ''">ids,</if>
            <if test="fullName != null  and fullName != ''">full_name,</if>
            <if test="laborCode != null  and laborCode != ''">labor_code,</if>
            <if test="laborRange != null  and laborRange != ''">labor_range,</if>
            <if test="laborStatus != null  and laborStatus != ''">labor_status,</if>
            <if test="laborType != null  and laborType != ''">labor_type,</if>
            <if test="datasource != null  and datasource != ''">datasource,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="ids != null  and ids != ''">#{ids},</if>
            <if test="fullName != null  and fullName != ''">#{fullName},</if>
            <if test="laborCode != null  and laborCode != ''">#{laborCode},</if>
            <if test="laborRange != null  and laborRange != ''">#{laborRange},</if>
            <if test="laborStatus != null  and laborStatus != ''">#{laborStatus},</if>
            <if test="laborType != null  and laborType != ''">#{laborType},</if>
            <if test="datasource != null  and datasource != ''">#{datasource},</if>
         </trim>
    </insert>
 
    <update id="updateLaborUnit" parameterType="LaborUnit">
        update js_labor_unit
        <trim prefix="SET" suffixOverrides=",">
            <if test="fullName != null  and fullName != ''">full_name = #{fullName},</if>
            <if test="laborCode != null  and laborCode != ''">labor_code = #{laborCode},</if>
            <if test="laborRange != null  and laborRange != ''">labor_range = #{laborRange},</if>
            <if test="laborStatus != null  and laborStatus != ''">labor_status = #{laborStatus},</if>
            <if test="laborType != null  and laborType != ''">labor_type = #{laborType},</if>
            <if test="datasource != null  and datasource != ''">datasource = #{datasource},</if>
        </trim>
        where ids = #{ids}
    </update>
 
    <delete id="deleteLaborUnitById" parameterType="String">
        delete from js_labor_unit where ids = #{ids}
    </delete>
 
    <delete id="deleteLaborUnitByIds" parameterType="String">
        delete from js_labor_unit where ids in 
        <foreach item="ids" collection="array" open="(" separator="," close=")">
            #{ids}
        </foreach>
    </delete>
    
</mapper>