| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 |
- <?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.zksy.WaterSupply.WaterPumpStation.mapper.WaterPumpStationMapper">
- <resultMap id="BaseResultMap" type="com.zksy.WaterSupply.WaterPumpStation.domain.WaterPumpStation">
- <id column="id" property="id" />
- <result column="station_code" property="stationCode" />
- <result column="station_name" property="stationName" />
- <result column="location" property="location" />
- <result column="longitude" property="longitude" />
- <result column="latitude" property="latitude" />
- <result column="pump_count" property="pumpCount" />
- <result column="design_flow" property="designFlow" />
- <result column="design_head" property="designHead" />
- <result column="power_capacity" property="powerCapacity" />
- <result column="commission_date" property="commissionDate" />
- <result column="status" property="status" />
- <result column="principal" property="principal" />
- <result column="contact_phone" property="contactPhone" />
- <result column="remark" property="remark" />
- <result column="del_flag" property="delFlag" />
- <result column="create_by" property="createBy" />
- <result column="create_time" property="createTime" />
- <result column="update_by" property="updateBy" />
- <result column="update_time" property="updateTime" />
- </resultMap>
- <sql id="Base_Column_List">
- id, station_code, station_name, location, longitude, latitude, pump_count, design_flow, design_head,
- power_capacity, commission_date, status, principal, contact_phone, remark,
- del_flag, create_by, create_time, update_by, update_time
- </sql>
- <!-- 条件查询泵站列表 -->
- <select id="selectStationList" resultMap="BaseResultMap">
- SELECT <include refid="Base_Column_List"/>
- FROM water_pump_station
- WHERE del_flag = '0'
- <if test="stationCode != null and stationCode != ''">
- AND station_code LIKE CONCAT('%', #{stationCode}, '%')
- </if>
- <if test="stationName != null and stationName != ''">
- AND station_name LIKE CONCAT('%', #{stationName}, '%')
- </if>
- <if test="status != null and status != ''">
- AND status = #{status}
- </if>
- <if test="principal != null and principal != ''">
- AND principal LIKE CONCAT('%', #{principal}, '%')
- </if>
- <if test="startTime != null">
- AND create_time >= #{startTime}
- </if>
- <if test="endTime != null">
- AND create_time <= #{endTime}
- </if>
- ORDER BY create_time DESC
- </select>
- <!-- 回收站SQL -->
- <select id="selectDeletedList" resultMap="BaseResultMap">
- SELECT <include refid="Base_Column_List"/>
- FROM water_pump_station
- WHERE del_flag = '2'
- <if test="stationCode != null and stationCode != ''">
- AND station_code LIKE CONCAT('%', #{stationCode}, '%')
- </if>
- <if test="stationName != null and stationName != ''">
- AND station_name LIKE CONCAT('%', #{stationName}, '%')
- </if>
- <if test="status != null and status != ''">
- AND status = #{status}
- </if>
- <if test="startTime != null">
- AND update_time >= #{startTime}
- </if>
- <if test="endTime != null">
- AND update_time <= #{endTime}
- </if>
- ORDER BY update_time DESC
- </select>
- <update id="restoreByIds">
- UPDATE water_pump_station
- SET del_flag = '0',
- update_by = #{updateBy},
- update_time = CURRENT_TIMESTAMP
- WHERE id IN
- <foreach collection="ids" item="id" open="(" separator="," close=")">
- #{id}
- </foreach>
- </update>
- <delete id="deleteByIdsPhysically">
- DELETE FROM water_pump_station WHERE id IN
- <foreach collection="ids" item="id" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- </mapper>
|