|
@@ -0,0 +1,136 @@
|
|
|
+<?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.business.slfh.manager.waterintake.mapper.TResWaterintakeMapper">
|
|
|
+
|
|
|
+ <resultMap type="TResWaterintake" id="TResWaterintakeResult">
|
|
|
+ <result property="id" column="id" />
|
|
|
+ <result property="status" column="status" />
|
|
|
+ <result property="remark" column="remark" />
|
|
|
+ <result property="delFlag" column="del_flag" />
|
|
|
+ <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="name" column="name" />
|
|
|
+ <result property="longitude" column="longitude" />
|
|
|
+ <result property="latitude" column="latitude" />
|
|
|
+ <result property="address" column="address" />
|
|
|
+ <result property="contactUser" column="contact_user" />
|
|
|
+ <result property="contactPhone" column="contact_phone" />
|
|
|
+ <result property="deptId" column="dept_id" />
|
|
|
+ <result property="createUserId" column="create_user_id" />
|
|
|
+ <result property="filename" column="filename" />
|
|
|
+ <result property="deptName" column="dept_name" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectTResWaterintakeVo">
|
|
|
+ select t.dept_id,
|
|
|
+ (select dept_name from sys_dept where dept_id=t.dept_id) dept_name,
|
|
|
+ t.create_user_id,
|
|
|
+ t.id, t.status, t.remark, t.del_flag, t.create_by, t.create_time, t.update_by, t.update_time, t.name, t.longitude, t.latitude, t.address, t.contact_user, t.contact_phone from t_res_waterintake t
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectTResWaterintakeList" parameterType="TResWaterintake" resultMap="TResWaterintakeResult">
|
|
|
+ <include refid="selectTResWaterintakeVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="status != null and status != ''"> and status = #{status}</if>
|
|
|
+ <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
|
|
+ <if test="longitude != null and longitude != ''"> and longitude = #{longitude}</if>
|
|
|
+ <if test="latitude != null and latitude != ''"> and latitude = #{latitude}</if>
|
|
|
+ <if test="address != null and address != ''"> and address = #{address}</if>
|
|
|
+ <if test="contactUser != null and contactUser != ''"> and contact_user = #{contactUser}</if>
|
|
|
+ <if test="contactPhone != null and contactPhone != ''"> and contact_phone = #{contactPhone}</if>
|
|
|
+ <if test="deptId != null "> and dept_id = #{deptId}</if>
|
|
|
+ <if test="createUserId != null "> and create_user_id = #{createUserId}</if>
|
|
|
+ <if test="filename != null and filename != ''"> and filename like concat('%', #{filename}, '%')</if>
|
|
|
+ <if test="deptName != null and deptName != ''"> and dept_name like concat('%', #{deptName}, '%')</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectTResWaterintakeById" parameterType="String" resultMap="TResWaterintakeResult">
|
|
|
+ <include refid="selectTResWaterintakeVo"/>
|
|
|
+ where id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertTResWaterintake" parameterType="TResWaterintake">
|
|
|
+ insert into t_res_waterintake
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="id != null and id != ''">id,</if>
|
|
|
+ <if test="status != null">status,</if>
|
|
|
+ <if test="remark != null">remark,</if>
|
|
|
+ <if test="delFlag != null">del_flag,</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="name != null">name,</if>
|
|
|
+ <if test="longitude != null">longitude,</if>
|
|
|
+ <if test="latitude != null">latitude,</if>
|
|
|
+ <if test="address != null">address,</if>
|
|
|
+ <if test="contactUser != null">contact_user,</if>
|
|
|
+ <if test="contactPhone != null">contact_phone,</if>
|
|
|
+ <if test="deptId != null">dept_id,</if>
|
|
|
+ <if test="createUserId != null">create_user_id,</if>
|
|
|
+ <if test="filename != null">filename,</if>
|
|
|
+ <if test="deptName != null">dept_name,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="id != null and id != ''">#{id},</if>
|
|
|
+ <if test="status != null">#{status},</if>
|
|
|
+ <if test="remark != null">#{remark},</if>
|
|
|
+ <if test="delFlag != null">#{delFlag},</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="name != null">#{name},</if>
|
|
|
+ <if test="longitude != null">#{longitude},</if>
|
|
|
+ <if test="latitude != null">#{latitude},</if>
|
|
|
+ <if test="address != null">#{address},</if>
|
|
|
+ <if test="contactUser != null">#{contactUser},</if>
|
|
|
+ <if test="contactPhone != null">#{contactPhone},</if>
|
|
|
+ <if test="deptId != null">#{deptId},</if>
|
|
|
+ <if test="createUserId != null">#{createUserId},</if>
|
|
|
+ <if test="filename != null">#{filename},</if>
|
|
|
+ <if test="deptName != null">#{deptName},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateTResWaterintake" parameterType="TResWaterintake">
|
|
|
+ update t_res_waterintake
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="status != null">status = #{status},</if>
|
|
|
+ <if test="remark != null">remark = #{remark},</if>
|
|
|
+ <if test="delFlag != null">del_flag = #{delFlag},</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="name != null">name = #{name},</if>
|
|
|
+ <if test="longitude != null">longitude = #{longitude},</if>
|
|
|
+ <if test="latitude != null">latitude = #{latitude},</if>
|
|
|
+ <if test="address != null">address = #{address},</if>
|
|
|
+ <if test="contactUser != null">contact_user = #{contactUser},</if>
|
|
|
+ <if test="contactPhone != null">contact_phone = #{contactPhone},</if>
|
|
|
+ <if test="deptId != null">dept_id = #{deptId},</if>
|
|
|
+ <if test="createUserId != null">create_user_id = #{createUserId},</if>
|
|
|
+ <if test="filename != null">filename = #{filename},</if>
|
|
|
+ <if test="deptName != null">dept_name = #{deptName},</if>
|
|
|
+ </trim>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteTResWaterintakeById" parameterType="String">
|
|
|
+ delete from t_res_waterintake where id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteTResWaterintakeByIds" parameterType="String">
|
|
|
+ delete from t_res_waterintake where id in
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+
|
|
|
+</mapper>
|