|
@@ -0,0 +1,160 @@
|
|
|
+<?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.slibra.business.mapper.TUserInfoMapper">
|
|
|
+
|
|
|
+ <resultMap type="TUserInfo" id="TUserInfoResult">
|
|
|
+ <result property="id" column="id" />
|
|
|
+ <result property="cardNo" column="card_no" />
|
|
|
+ <result property="userNo" column="user_no" />
|
|
|
+ <result property="name" column="name" />
|
|
|
+ <result property="phone" column="phone" />
|
|
|
+ <result property="province" column="province" />
|
|
|
+ <result property="city" column="city" />
|
|
|
+ <result property="country" column="country" />
|
|
|
+ <result property="street" column="street" />
|
|
|
+ <result property="address" column="address" />
|
|
|
+ <result property="buildingNo" column="building_no" />
|
|
|
+ <result property="doorNo" column="door_no" />
|
|
|
+ <result property="ammeterNo" column="ammeter_no" />
|
|
|
+ <result property="pumpingStation" column="pumping_station" />
|
|
|
+ <result property="meterReader" column="meter_reader" />
|
|
|
+ <result property="meterReaderPhone" column="meter_reader_phone" />
|
|
|
+ <result property="delFlag" column="del_flag" />
|
|
|
+ <result property="revision" column="revision" />
|
|
|
+ <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="remark" column="remark" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectTUserInfoVo">
|
|
|
+ select id, card_no, user_no, name, phone, province, city, country, street, address, building_no, door_no, ammeter_no, pumping_station, meter_reader, meter_reader_phone, del_flag, revision, create_by, create_time, update_by, update_time, remark from t_user_info
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectTUserInfoList" parameterType="TUserInfo" resultMap="TUserInfoResult">
|
|
|
+ <include refid="selectTUserInfoVo"/>
|
|
|
+ <where>
|
|
|
+ 1 = 1
|
|
|
+ <if test="cardNo != null and cardNo != ''"> and card_no = #{cardNo}</if>
|
|
|
+ <if test="userNo != null and userNo != ''"> and user_no = #{userNo}</if>
|
|
|
+ <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
|
|
+ <if test="phone != null and phone != ''"> and phone = #{phone}</if>
|
|
|
+ <if test="province != null and province != ''"> and province = #{province}</if>
|
|
|
+ <if test="city != null and city != ''"> and city = #{city}</if>
|
|
|
+ <if test="country != null and country != ''"> and country = #{country}</if>
|
|
|
+ <if test="street != null and street != ''"> and street = #{street}</if>
|
|
|
+ <if test="address != null and address != ''"> and address = #{address}</if>
|
|
|
+ <if test="buildingNo != null and buildingNo != ''"> and building_no = #{buildingNo}</if>
|
|
|
+ <if test="doorNo != null and doorNo != ''"> and door_no = #{doorNo}</if>
|
|
|
+ <if test="ammeterNo != null and ammeterNo != ''"> and ammeter_no = #{ammeterNo}</if>
|
|
|
+ <if test="pumpingStation != null and pumpingStation != ''"> and pumping_station = #{pumpingStation}</if>
|
|
|
+ <if test="meterReader != null and meterReader != ''"> and meter_reader = #{meterReader}</if>
|
|
|
+ <if test="meterReaderPhone != null and meterReaderPhone != ''"> and meter_reader_phone = #{meterReaderPhone}</if>
|
|
|
+ <if test="revision != null "> and revision = #{revision}</if>
|
|
|
+ </where>
|
|
|
+ and del_flag = 0 order by id desc
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectTUserInfoById" parameterType="Long" resultMap="TUserInfoResult">
|
|
|
+ <include refid="selectTUserInfoVo"/>
|
|
|
+ where id = #{id} and del_flag = 0
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertTUserInfo" parameterType="TUserInfo" useGeneratedKeys="true" keyProperty="id">
|
|
|
+ insert into t_user_info
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="cardNo != null">card_no,</if>
|
|
|
+ <if test="userNo != null">user_no,</if>
|
|
|
+ <if test="name != null">name,</if>
|
|
|
+ <if test="phone != null">phone,</if>
|
|
|
+ <if test="province != null">province,</if>
|
|
|
+ <if test="city != null">city,</if>
|
|
|
+ <if test="country != null">country,</if>
|
|
|
+ <if test="street != null">street,</if>
|
|
|
+ <if test="address != null">address,</if>
|
|
|
+ <if test="buildingNo != null">building_no,</if>
|
|
|
+ <if test="doorNo != null">door_no,</if>
|
|
|
+ <if test="ammeterNo != null">ammeter_no,</if>
|
|
|
+ <if test="pumpingStation != null">pumping_station,</if>
|
|
|
+ <if test="meterReader != null">meter_reader,</if>
|
|
|
+ <if test="meterReaderPhone != null">meter_reader_phone,</if>
|
|
|
+ <if test="delFlag != null">del_flag,</if>
|
|
|
+ <if test="revision != null">revision,</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="remark != null">remark,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="cardNo != null">#{cardNo},</if>
|
|
|
+ <if test="userNo != null">#{userNo},</if>
|
|
|
+ <if test="name != null">#{name},</if>
|
|
|
+ <if test="phone != null">#{phone},</if>
|
|
|
+ <if test="province != null">#{province},</if>
|
|
|
+ <if test="city != null">#{city},</if>
|
|
|
+ <if test="country != null">#{country},</if>
|
|
|
+ <if test="street != null">#{street},</if>
|
|
|
+ <if test="address != null">#{address},</if>
|
|
|
+ <if test="buildingNo != null">#{buildingNo},</if>
|
|
|
+ <if test="doorNo != null">#{doorNo},</if>
|
|
|
+ <if test="ammeterNo != null">#{ammeterNo},</if>
|
|
|
+ <if test="pumpingStation != null">#{pumpingStation},</if>
|
|
|
+ <if test="meterReader != null">#{meterReader},</if>
|
|
|
+ <if test="meterReaderPhone != null">#{meterReaderPhone},</if>
|
|
|
+ <if test="delFlag != null">#{delFlag},</if>
|
|
|
+ <if test="revision != null">#{revision},</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="remark != null">#{remark},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateTUserInfo" parameterType="TUserInfo">
|
|
|
+ update t_user_info
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="cardNo != null">card_no = #{cardNo},</if>
|
|
|
+ <if test="userNo != null">user_no = #{userNo},</if>
|
|
|
+ <if test="name != null">name = #{name},</if>
|
|
|
+ <if test="phone != null">phone = #{phone},</if>
|
|
|
+ <if test="province != null">province = #{province},</if>
|
|
|
+ <if test="city != null">city = #{city},</if>
|
|
|
+ <if test="country != null">country = #{country},</if>
|
|
|
+ <if test="street != null">street = #{street},</if>
|
|
|
+ <if test="address != null">address = #{address},</if>
|
|
|
+ <if test="buildingNo != null">building_no = #{buildingNo},</if>
|
|
|
+ <if test="doorNo != null">door_no = #{doorNo},</if>
|
|
|
+ <if test="ammeterNo != null">ammeter_no = #{ammeterNo},</if>
|
|
|
+ <if test="pumpingStation != null">pumping_station = #{pumpingStation},</if>
|
|
|
+ <if test="meterReader != null">meter_reader = #{meterReader},</if>
|
|
|
+ <if test="meterReaderPhone != null">meter_reader_phone = #{meterReaderPhone},</if>
|
|
|
+ <if test="delFlag != null">del_flag = #{delFlag},</if>
|
|
|
+ <if test="revision != null">revision = #{revision},</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="remark != null">remark = #{remark},</if>
|
|
|
+ </trim>
|
|
|
+ ,revision = revision + 1
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ <delete id="deleteTUserInfoById" parameterType="Long">
|
|
|
+ update t_user_info set del_flag = 2,revision = revision + 1 where del_flag = 0 and id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteTUserInfoByIds" parameterType="String">
|
|
|
+ update t_user_info set del_flag = 2,revision = revision + 1 where del_flag = 0 and id in
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+</mapper>
|