ard-work/src/main/resources/mapper/sy/ArdTankWallMapper.xml
@@ -7,22 +7,20 @@
    <resultMap type="ArdTankWall" id="ArdTankWallResult">
        <result property="id"    column="id"    />
        <result property="wallName"    column="wall_name"    />
        <result property="longitude"    column="longitude"    />
        <result property="latitude"    column="latitude"    />
        <result property="distance"    column="distance"    />
        <result property="wallPoi"    column="wall_poi"    />
        <result property="wallType"    column="wall_type"    />
    </resultMap>
    <sql id="selectArdTankWallVo">
        select id, wall_name, longitude, latitude, distance from ard_tank_wall
        select id, wall_name, wall_poi, wall_type from ard_tank_wall
    </sql>
    <select id="selectArdTankWallList" parameterType="ArdTankWall" resultMap="ArdTankWallResult">
        <include refid="selectArdTankWallVo"/>
        <where>  
            <if test="wallName != null  and wallName != ''"> and wall_name like '%'||#{wallName}||'%'</if>
            <if test="longitude != null "> and longitude = #{longitude}</if>
            <if test="latitude != null "> and latitude = #{latitude}</if>
            <if test="distance != null "> and distance = #{distance}</if>
            <if test="wallPoi != null  and wallPoi != ''"> and wall_poi = #{wallPoi}</if>
            <if test="wallType != null  and wallType != ''"> and wall_type = #{wallType}</if>
        </where>
    </select>
    
@@ -36,16 +34,14 @@
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">id,</if>
            <if test="wallName != null">wall_name,</if>
            <if test="longitude != null">longitude,</if>
            <if test="latitude != null">latitude,</if>
            <if test="distance != null">distance,</if>
            <if test="wallPoi != null">wall_poi,</if>
            <if test="wallType != null">wall_type,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id},</if>
            <if test="wallName != null">#{wallName},</if>
            <if test="longitude != null">#{longitude},</if>
            <if test="latitude != null">#{latitude},</if>
            <if test="distance != null">#{distance},</if>
            <if test="wallPoi != null">#{wallPoi},</if>
            <if test="wallType != null">#{wallType},</if>
         </trim>
    </insert>
@@ -53,9 +49,8 @@
        update ard_tank_wall
        <trim prefix="SET" suffixOverrides=",">
            <if test="wallName != null">wall_name = #{wallName},</if>
            <if test="longitude != null">longitude = #{longitude},</if>
            <if test="latitude != null">latitude = #{latitude},</if>
            <if test="distance != null">distance = #{distance},</if>
            <if test="wallPoi != null">wall_poi = #{wallPoi},</if>
            <if test="wallType != null">wall_type = #{wallType},</if>
        </trim>
        where id = #{id}
    </update>
@@ -70,4 +65,44 @@
            #{id}
        </foreach>
    </delete>
    <select id="getAllArdTankWall" resultMap="ArdTankWallResult">
        select * from ard_tank_wall order by wall_name
    </select>
    <select id="getArdTankWallByLockId" resultType="java.util.Map" parameterType="java.lang.String">
        select atw.id as "wallId",atw.wall_name as "wallName",atw.wall_poi as "wallPoi",
        atwl.process_type as "processType",case process_type when '-1' then '关动作'
        when '0' then '无动作' when '1' then '开动作' end as process
        from ard_tank_wall_lock atwl
        inner join ard_tank_wall atw on atwl.wall_id = atw.id
        where atwl.lock_id = #{id}
    </select>
    <select id="selectArdTankWallTotal" parameterType="java.lang.String" resultType="java.lang.Long">
        select count(*) from ard_tank_wall atw
        <where>
            <if test="wallName != null  and wallName != ''"> and wall_name like '%'||#{wallName}||'%'</if>
        </where>
    </select>
    <select id="getDistinctArdTankWallByCarId" resultMap="ArdTankWallResult" parameterType="java.lang.String">
        select distinct atw.* from ard_tank_lock atl
        inner join ard_tank_wall_lock atwl on atl.id = atwl.lock_id
        inner join ard_tank_wall atw on atwl.wall_id = atw.id
        where atl.car_id = #{carId}
    </select>
    <select id="getArdTankWallProcessByLockId" resultMap="ArdTankWallResult" parameterType="java.lang.String">
        select atw.* from ard_tank_wall_lock atwl
        inner join ard_tank_wall atw on atwl.wall_id = atw.id
        where atwl.lock_id = #{lockId} and atwl.process_type != '0'
    </select>
    <select id="getDistinctArdTankWallByCarId" resultMap="ArdTankWallResult" parameterType="java.lang.String">
        select distinct atw.* from ard_tank_lock atl
        inner join ard_tank_wall_lock atwl on atl.id = atwl.lock_id
        inner join ard_tank_wall atw on atwl.wall_id = atw.id
        where atl.car_id = #{carId}
    </select>
</mapper>