wuzeyu
2024-05-15 fbd4cf5aeb4274938c12030e5d235c65c20c19c3
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
<?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.dy.pipIrrGlobal.daoIr.IrProjectMapper">
    <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoIr.IrProject">
        <!--@mbg.generated-->
        <!--@Table ir_project-->
        <id column="id" jdbcType="BIGINT" property="id" />
        <result column="project_name" jdbcType="VARCHAR" property="projectName" />
        <result column="province_id" jdbcType="BIGINT" property="provinceId" />
        <result column="city_id" jdbcType="BIGINT" property="cityId" />
        <result column="county_id" jdbcType="BIGINT" property="countyId" />
        <result column="town_id" jdbcType="BIGINT" property="townId" />
        <result column="village_id" jdbcType="BIGINT" property="villageId" />
        <result column="project_state" jdbcType="TINYINT" property="projectState" />
        <result column="remarks" jdbcType="VARCHAR" property="remarks" />
        <result column="operator" jdbcType="BIGINT" property="operator" />
        <result column="operate_time" jdbcType="TIMESTAMP" property="operateDt" />
        <result column="deleted" jdbcType="TINYINT" property="deleted" />
    </resultMap>
 
    <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoIr.IrProject">
        <!--@mbg.generated-->
        insert into ir_project
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">
                id,
            </if>
            <if test="projectName != null">
                project_name,
            </if>
            <if test="provinceId != null">
                province_id,
            </if>
            <if test="cityId != null">
                city_id,
            </if>
            <if test="countyId != null">
                county_id,
            </if>
            <if test="townId != null">
                town_id,
            </if>
            <if test="villageId != null">
                village_id,
            </if>
            <if test="projectState != null">
                project_state,
            </if>
            <if test="remarks != null">
                remarks,
            </if>
            <if test="operator != null">
                `operator`,
            </if>
            <if test="operateDt != null">
                operate_time,
            </if>
            <if test="deleted != null">
                deleted,
            </if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null">
                #{id,jdbcType=BIGINT},
            </if>
            <if test="projectName != null">
                #{projectName,jdbcType=VARCHAR},
            </if>
            <if test="provinceId != null">
                #{provinceId,jdbcType=BIGINT},
            </if>
            <if test="cityId != null">
                #{cityId,jdbcType=BIGINT},
            </if>
            <if test="countyId != null">
                #{countyId,jdbcType=BIGINT},
            </if>
            <if test="townId != null">
                #{townId,jdbcType=BIGINT},
            </if>
            <if test="villageId != null">
                #{villageId,jdbcType=BIGINT},
            </if>
            <if test="projectState != null">
                #{projectState,jdbcType=TINYINT},
            </if>
            <if test="remarks != null">
                #{remarks,jdbcType=VARCHAR},
            </if>
            <if test="operator != null">
                #{operator,jdbcType=BIGINT},
            </if>
            <if test="operateDt != null">
                #{operateDt,jdbcType=TIMESTAMP},
            </if>
            <if test="deleted != null">
                #{deleted,jdbcType=TINYINT},
            </if>
        </trim>
    </insert>
 
    <!--根据下级获取上一级地址-->
    <select id="getSupperByVillageId" parameterType="_long" resultType="java.lang.Long">
        select dis_tow.*
        from ba_district dis_vil
        inner join
        ba_district dis_tow
        on dis_vil.supperId = dis_tow.id
        where dis_vil.id = #{vaId,jdbcType=BIGINT}
    </select>
 
    <delete id="deleteLogicById" parameterType="java.lang.Long">
        <!--@mbg.generated-->
        update ir_project
        set deleted = 1
        where id = #{id,jdbcType=BIGINT}
    </delete>
</mapper>