TPipeInfoMapper.xml 8.08 KB
Newer Older
1 2 3 4 5
<?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.zehong.system.mapper.TPipeInfoMapper">
6

7 8 9 10 11 12
    <resultMap type="TPipeInfo" id="TPipeInfoResult">
        <result property="pipeId"    column="pipe_id"    />
        <result property="pipeLength"    column="pipe_length"    />
        <result property="pipeDiameter"    column="pipe_diameter"    />
        <result property="pipePressure"    column="pipe_pressure"    />
        <result property="pipeMaterial"    column="pipe_material"    />
13
        <result property="pipeAddr"    column="pipe_addr"    />
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
        <result property="buriedDepth"    column="buried_depth"    />
        <result property="pipeTrend"    column="pipe_trend"    />
        <result property="buildDate"    column="build_date"    />
        <result property="buildUnit"    column="build_unit"    />
        <result property="beyondEnterpriseId"    column="beyond_enterprise_id"    />
        <result property="beyondEnterpriseName"    column="beyond_enterprise_name"    />
        <result property="coordinates"    column="coordinates"    />
        <result property="createBy"    column="create_by"    />
        <result property="createTime"    column="create_time"    />
        <result property="updateBy"    column="update_by"    />
        <result property="updateTime"    column="update_time"    />
        <result property="isDel"    column="is_del"    />
        <result property="remarks"    column="remarks"    />
    </resultMap>

    <sql id="selectTPipeInfoVo">
wuqinghua's avatar
wuqinghua committed
30
        select pipe_id,pipe_length, pipe_diameter, pipe_pressure, pipe_material, pipe_addr, buried_depth, pipe_trend, build_date, build_unit, beyond_enterprise_id, beyond_enterprise_name, coordinates, create_by, create_time, update_by, update_time, is_del, remarks from t_pipe_info
31 32 33 34
    </sql>

    <select id="selectTPipeInfoList" parameterType="TPipeInfo" resultMap="TPipeInfoResult">
        <include refid="selectTPipeInfoVo"/>
35
        <where>
wuqinghua's avatar
wuqinghua committed
36
            is_del='0'
37 38 39 40
            <if test="pipeLength != null "> and pipe_length = #{pipeLength}</if>
            <if test="pipeDiameter != null "> and pipe_diameter = #{pipeDiameter}</if>
            <if test="pipePressure != null "> and pipe_pressure = #{pipePressure}</if>
            <if test="pipeMaterial != null  and pipeMaterial != ''"> and pipe_material = #{pipeMaterial}</if>
41
            <if test="pipeAddr != null  and pipeAddr != ''"> and pipe_addr = #{pipeAddr}</if>
42 43
            <if test="buriedDepth != null "> and buried_depth = #{buriedDepth}</if>
            <if test="pipeTrend != null  and pipeTrend != ''"> and pipe_trend = #{pipeTrend}</if>
44
            <if test="buildDate != null  and buildDate != ''"> and build_date = #{buildDate}</if>
45 46 47 48 49 50 51
            <if test="buildUnit != null  and buildUnit != ''"> and build_unit = #{buildUnit}</if>
            <if test="beyondEnterpriseId != null "> and beyond_enterprise_id = #{beyondEnterpriseId}</if>
            <if test="beyondEnterpriseName != null  and beyondEnterpriseName != ''"> and beyond_enterprise_name like concat('%', #{beyondEnterpriseName}, '%')</if>
            <if test="coordinates != null  and coordinates != ''"> and coordinates = #{coordinates}</if>
            <if test="isDel != null  and isDel != ''"> and is_del = #{isDel}</if>
            <if test="remarks != null  and remarks != ''"> and remarks = #{remarks}</if>
        </where>
52
        group by pipe_id desc
53
    </select>
54

55
    <select id="selectTPipeInfoById" parameterType="Long" resultMap="TPipeInfoResult">
56
        <include refid="selectTPipeInfoVo"/>
wuqinghua's avatar
wuqinghua committed
57
        where pipe_id = #{pipeId} and is_del='0'
58
    </select>
59

60 61 62 63 64 65 66
    <insert id="insertTPipeInfo" parameterType="TPipeInfo" useGeneratedKeys="true" keyProperty="pipeId">
        insert into t_pipe_info
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="pipeLength != null">pipe_length,</if>
            <if test="pipeDiameter != null">pipe_diameter,</if>
            <if test="pipePressure != null">pipe_pressure,</if>
            <if test="pipeMaterial != null">pipe_material,</if>
67
            <if test="pipeAddr != null">pipe_addr,</if>
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86
            <if test="buriedDepth != null">buried_depth,</if>
            <if test="pipeTrend != null">pipe_trend,</if>
            <if test="buildDate != null">build_date,</if>
            <if test="buildUnit != null">build_unit,</if>
            <if test="beyondEnterpriseId != null">beyond_enterprise_id,</if>
            <if test="beyondEnterpriseName != null">beyond_enterprise_name,</if>
            <if test="coordinates != null">coordinates,</if>
            <if test="createBy != null">create_by,</if>
            <if test="createTime != null">create_time,</if>
            <if test="updateBy != null">update_by,</if>
            <if test="updateTime != null">update_time,</if>
            <if test="isDel != null">is_del,</if>
            <if test="remarks != null">remarks,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="pipeLength != null">#{pipeLength},</if>
            <if test="pipeDiameter != null">#{pipeDiameter},</if>
            <if test="pipePressure != null">#{pipePressure},</if>
            <if test="pipeMaterial != null">#{pipeMaterial},</if>
87
            <if test="pipeAddr != null">#{pipeAddr},</if>
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110
            <if test="buriedDepth != null">#{buriedDepth},</if>
            <if test="pipeTrend != null">#{pipeTrend},</if>
            <if test="buildDate != null">#{buildDate},</if>
            <if test="buildUnit != null">#{buildUnit},</if>
            <if test="beyondEnterpriseId != null">#{beyondEnterpriseId},</if>
            <if test="beyondEnterpriseName != null">#{beyondEnterpriseName},</if>
            <if test="coordinates != null">#{coordinates},</if>
            <if test="createBy != null">#{createBy},</if>
            <if test="createTime != null">#{createTime},</if>
            <if test="updateBy != null">#{updateBy},</if>
            <if test="updateTime != null">#{updateTime},</if>
            <if test="isDel != null">#{isDel},</if>
            <if test="remarks != null">#{remarks},</if>
         </trim>
    </insert>

    <update id="updateTPipeInfo" parameterType="TPipeInfo">
        update t_pipe_info
        <trim prefix="SET" suffixOverrides=",">
            <if test="pipeLength != null">pipe_length = #{pipeLength},</if>
            <if test="pipeDiameter != null">pipe_diameter = #{pipeDiameter},</if>
            <if test="pipePressure != null">pipe_pressure = #{pipePressure},</if>
            <if test="pipeMaterial != null">pipe_material = #{pipeMaterial},</if>
111
            <if test="pipeAddr != null">pipe_addr = #{pipeAddr},</if>
112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128
            <if test="buriedDepth != null">buried_depth = #{buriedDepth},</if>
            <if test="pipeTrend != null">pipe_trend = #{pipeTrend},</if>
            <if test="buildDate != null">build_date = #{buildDate},</if>
            <if test="buildUnit != null">build_unit = #{buildUnit},</if>
            <if test="beyondEnterpriseId != null">beyond_enterprise_id = #{beyondEnterpriseId},</if>
            <if test="beyondEnterpriseName != null">beyond_enterprise_name = #{beyondEnterpriseName},</if>
            <if test="coordinates != null">coordinates = #{coordinates},</if>
            <if test="createBy != null">create_by = #{createBy},</if>
            <if test="createTime != null">create_time = #{createTime},</if>
            <if test="updateBy != null">update_by = #{updateBy},</if>
            <if test="updateTime != null">update_time = #{updateTime},</if>
            <if test="isDel != null">is_del = #{isDel},</if>
            <if test="remarks != null">remarks = #{remarks},</if>
        </trim>
        where pipe_id = #{pipeId}
    </update>

wuqinghua's avatar
wuqinghua committed
129 130 131
    <update id="deleteTPipeInfoById" parameterType="Long">
        update  t_pipe_info  set is_del='1' where pipe_id = #{pipeId}
    </update>
132

wuqinghua's avatar
wuqinghua committed
133 134
    <update id="deleteTPipeInfoByIds" parameterType="String">
        update  t_pipe_info set is_del='1'  where pipe_id in
135 136 137
        <foreach item="pipeId" collection="array" open="(" separator="," close=")">
            #{pipeId}
        </foreach>
wuqinghua's avatar
wuqinghua committed
138
    </update>
139
</mapper>