|
|
@@ -0,0 +1,394 @@
|
|
|
+<?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.izouma.awesomeadmin.dao.HousingTrustMapper" >
|
|
|
+ <resultMap id="BaseResultMap" type="com.izouma.awesomeadmin.model.HousingTrust" >
|
|
|
+ <id column="id" property="id" jdbcType="INTEGER" />
|
|
|
+ <result column="del_flag" property="delFlag" jdbcType="CHAR" />
|
|
|
+ <result column="user_id" property="userId" jdbcType="VARCHAR" />
|
|
|
+ <result column="user_name" property="userName" jdbcType="VARCHAR" />
|
|
|
+ <result column="real_name" property="realName" jdbcType="VARCHAR" />
|
|
|
+ <result column="telephone" property="telephone" jdbcType="VARCHAR" />
|
|
|
+ <result column="address" property="address" jdbcType="VARCHAR" />
|
|
|
+ <result column="address_detail" property="addressDetail" jdbcType="VARCHAR" />
|
|
|
+ <result column="remark" property="remark" jdbcType="VARCHAR" />
|
|
|
+ <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
|
|
|
+ <result column="status_flag" property="statusFlag" jdbcType="INTEGER" />
|
|
|
+ </resultMap>
|
|
|
+ <sql id="Base_Column_List" >
|
|
|
+ <trim suffixOverrides="," >
|
|
|
+ id,
|
|
|
+
|
|
|
+ del_flag,
|
|
|
+
|
|
|
+ user_id,
|
|
|
+
|
|
|
+ user_name,
|
|
|
+
|
|
|
+ real_name,
|
|
|
+
|
|
|
+ telephone,
|
|
|
+
|
|
|
+ address,
|
|
|
+
|
|
|
+ address_detail,
|
|
|
+
|
|
|
+ remark,
|
|
|
+
|
|
|
+ create_time,
|
|
|
+
|
|
|
+ status_flag,
|
|
|
+
|
|
|
+ </trim>
|
|
|
+ </sql>
|
|
|
+ <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
|
|
|
+ select
|
|
|
+ <include refid="Base_Column_List" />
|
|
|
+ from housing_trust
|
|
|
+ where id = #{id,jdbcType=INTEGER}
|
|
|
+ </select>
|
|
|
+ <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
|
|
|
+ delete from housing_trust
|
|
|
+ where id = #{id,jdbcType=INTEGER}
|
|
|
+ </delete>
|
|
|
+ <insert id="insertSelective" parameterType="com.izouma.awesomeadmin.model.HousingTrust" useGeneratedKeys="true" keyProperty="id">
|
|
|
+ insert into housing_trust
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides="," >
|
|
|
+ <if test="id!= null" >
|
|
|
+ id,
|
|
|
+ </if>
|
|
|
+ <if test="delFlag!= null" >
|
|
|
+ del_flag,
|
|
|
+ </if>
|
|
|
+ <if test="userId!= null" >
|
|
|
+ user_id,
|
|
|
+ </if>
|
|
|
+ <if test="userName!= null" >
|
|
|
+ user_name,
|
|
|
+ </if>
|
|
|
+ <if test="realName!= null" >
|
|
|
+ real_name,
|
|
|
+ </if>
|
|
|
+ <if test="telephone!= null" >
|
|
|
+ telephone,
|
|
|
+ </if>
|
|
|
+ <if test="address!= null" >
|
|
|
+ address,
|
|
|
+ </if>
|
|
|
+ <if test="addressDetail!= null" >
|
|
|
+ address_detail,
|
|
|
+ </if>
|
|
|
+ <if test="remark!= null" >
|
|
|
+ remark,
|
|
|
+ </if>
|
|
|
+ <if test="createTime!= null" >
|
|
|
+ create_time,
|
|
|
+ </if>
|
|
|
+ <if test="statusFlag!= null" >
|
|
|
+ status_flag,
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides="," >
|
|
|
+ <if test="id != null" >
|
|
|
+ #{id,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="delFlag != null" >
|
|
|
+ #{delFlag,jdbcType=CHAR},
|
|
|
+ </if>
|
|
|
+ <if test="userId != null" >
|
|
|
+ #{userId,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="userName != null" >
|
|
|
+ #{userName,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="realName != null" >
|
|
|
+ #{realName,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="telephone != null" >
|
|
|
+ #{telephone,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="address != null" >
|
|
|
+ #{address,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="addressDetail != null" >
|
|
|
+ #{addressDetail,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="remark != null" >
|
|
|
+ #{remark,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null" >
|
|
|
+ #{createTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="statusFlag != null" >
|
|
|
+ #{statusFlag,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+ <update id="updateByPrimaryKeySelective" parameterType="com.izouma.awesomeadmin.model.HousingTrust" >
|
|
|
+ update housing_trust
|
|
|
+ <set >
|
|
|
+ <if test="id != null" >
|
|
|
+ id= #{id,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="delFlag != null" >
|
|
|
+ del_flag= #{delFlag,jdbcType=CHAR},
|
|
|
+ </if>
|
|
|
+ <if test="userId != null" >
|
|
|
+ user_id= #{userId,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="userName != null" >
|
|
|
+ user_name= #{userName,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="realName != null" >
|
|
|
+ real_name= #{realName,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="telephone != null" >
|
|
|
+ telephone= #{telephone,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="address != null" >
|
|
|
+ address= #{address,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="addressDetail != null" >
|
|
|
+ address_detail= #{addressDetail,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="remark != null" >
|
|
|
+ remark= #{remark,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null" >
|
|
|
+ create_time= #{createTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="statusFlag != null" >
|
|
|
+ status_flag= #{statusFlag,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ where id = #{id,jdbcType=INTEGER}
|
|
|
+ </update>
|
|
|
+ <select id="queryHousingTrustByPage" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.HousingTrust">
|
|
|
+ select <include refid="Base_Column_List"/> from housing_trust
|
|
|
+ <where>
|
|
|
+ and del_flag = 'N'
|
|
|
+ <if test="record.id != null and !"".equals(record.id)">
|
|
|
+ and id = #{record.id}
|
|
|
+ </if>
|
|
|
+ <if test="record.delFlag != null and !"".equals(record.delFlag)">
|
|
|
+ and del_flag = #{record.delFlag}
|
|
|
+ </if>
|
|
|
+ <if test="record.userId != null and !"".equals(record.userId)">
|
|
|
+ and user_id = #{record.userId}
|
|
|
+ </if>
|
|
|
+ <if test="record.userName != null and !"".equals(record.userName)">
|
|
|
+ and user_name = #{record.userName}
|
|
|
+ </if>
|
|
|
+ <if test="record.realName != null and !"".equals(record.realName)">
|
|
|
+ and real_name = #{record.realName}
|
|
|
+ </if>
|
|
|
+ <if test="record.telephone != null and !"".equals(record.telephone)">
|
|
|
+ and telephone = #{record.telephone}
|
|
|
+ </if>
|
|
|
+ <if test="record.address != null and !"".equals(record.address)">
|
|
|
+ and address = #{record.address}
|
|
|
+ </if>
|
|
|
+ <if test="record.addressDetail != null and !"".equals(record.addressDetail)">
|
|
|
+ and address_detail = #{record.addressDetail}
|
|
|
+ </if>
|
|
|
+ <if test="record.remark != null and !"".equals(record.remark)">
|
|
|
+ and remark = #{record.remark}
|
|
|
+ </if>
|
|
|
+ <if test="record.createTime != null and !"".equals(record.createTime)">
|
|
|
+ and create_time = #{record.createTime}
|
|
|
+ </if>
|
|
|
+ <if test="record.statusFlag != null and !"".equals(record.statusFlag)">
|
|
|
+ and status_flag = #{record.statusFlag}
|
|
|
+ </if>
|
|
|
+ <if test="record.searchKey != null and !"".equals(record.searchKey)">
|
|
|
+ <trim prefix="and (" suffix=")" prefixOverrides="OR" >
|
|
|
+ OR user_id LIKE concat('%',#{record.searchKey},'%')
|
|
|
+ OR user_name LIKE concat('%',#{record.searchKey},'%')
|
|
|
+ OR real_name LIKE concat('%',#{record.searchKey},'%')
|
|
|
+ OR telephone LIKE concat('%',#{record.searchKey},'%')
|
|
|
+ OR address LIKE concat('%',#{record.searchKey},'%')
|
|
|
+ OR address_detail LIKE concat('%',#{record.searchKey},'%')
|
|
|
+ OR remark LIKE concat('%',#{record.searchKey},'%')
|
|
|
+ OR status_flag LIKE concat('%',#{record.searchKey},'%')
|
|
|
+ </trim>
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="record.advancedQuery != null and !"".equals(record.advancedQuery)">
|
|
|
+ <foreach item="item" index="index" collection="record.advancedQuery.split('_;')">
|
|
|
+ <choose>
|
|
|
+ <when test="item.indexOf('like') != -1">
|
|
|
+ <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
|
|
|
+ <if test="detailIndex == 3">
|
|
|
+ concat('%',#{itemDetail},'%')
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="detailIndex < 3">
|
|
|
+ ${itemDetail}
|
|
|
+ </if>
|
|
|
+
|
|
|
+ </foreach>
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
|
|
|
+ <if test="detailIndex == 3">
|
|
|
+ #{itemDetail}
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="detailIndex < 3">
|
|
|
+ ${itemDetail}
|
|
|
+ </if>
|
|
|
+
|
|
|
+ </foreach>
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
+
|
|
|
+
|
|
|
+ </foreach>
|
|
|
+
|
|
|
+
|
|
|
+ </if>
|
|
|
+
|
|
|
+ </where>
|
|
|
+ order by id desc
|
|
|
+ </select>
|
|
|
+ <select id="queryAllHousingTrust" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.HousingTrust">
|
|
|
+ select <include refid="Base_Column_List"/> from housing_trust
|
|
|
+ <where>
|
|
|
+ and del_flag = 'N'
|
|
|
+ <if test="id != null and !"".equals(id)">
|
|
|
+ and id = #{id}
|
|
|
+ </if>
|
|
|
+ <if test="delFlag != null and !"".equals(delFlag)">
|
|
|
+ and del_flag = #{delFlag}
|
|
|
+ </if>
|
|
|
+ <if test="userId != null and !"".equals(userId)">
|
|
|
+ and user_id = #{userId}
|
|
|
+ </if>
|
|
|
+ <if test="userName != null and !"".equals(userName)">
|
|
|
+ and user_name = #{userName}
|
|
|
+ </if>
|
|
|
+ <if test="realName != null and !"".equals(realName)">
|
|
|
+ and real_name = #{realName}
|
|
|
+ </if>
|
|
|
+ <if test="telephone != null and !"".equals(telephone)">
|
|
|
+ and telephone = #{telephone}
|
|
|
+ </if>
|
|
|
+ <if test="address != null and !"".equals(address)">
|
|
|
+ and address = #{address}
|
|
|
+ </if>
|
|
|
+ <if test="addressDetail != null and !"".equals(addressDetail)">
|
|
|
+ and address_detail = #{addressDetail}
|
|
|
+ </if>
|
|
|
+ <if test="remark != null and !"".equals(remark)">
|
|
|
+ and remark = #{remark}
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null and !"".equals(createTime)">
|
|
|
+ and create_time = #{createTime}
|
|
|
+ </if>
|
|
|
+ <if test="statusFlag != null and !"".equals(statusFlag)">
|
|
|
+ and status_flag = #{statusFlag}
|
|
|
+ </if>
|
|
|
+ <if test="searchKey != null and !"".equals(searchKey)">
|
|
|
+ <trim prefix="and (" suffix=")" prefixOverrides="OR" >
|
|
|
+ OR user_id LIKE concat('%',#{searchKey},'%')
|
|
|
+ OR user_name LIKE concat('%',#{searchKey},'%')
|
|
|
+ OR real_name LIKE concat('%',#{searchKey},'%')
|
|
|
+ OR telephone LIKE concat('%',#{searchKey},'%')
|
|
|
+ OR address LIKE concat('%',#{searchKey},'%')
|
|
|
+ OR address_detail LIKE concat('%',#{searchKey},'%')
|
|
|
+ OR remark LIKE concat('%',#{searchKey},'%')
|
|
|
+ OR status_flag LIKE concat('%',#{searchKey},'%')
|
|
|
+ </trim>
|
|
|
+ </if>
|
|
|
+<if test="advancedQuery != null and !"".equals(advancedQuery)">
|
|
|
+ <foreach item="item" index="index" collection="advancedQuery.split('_;')">
|
|
|
+ <choose>
|
|
|
+ <when test="item.indexOf('like') != -1">
|
|
|
+ <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
|
|
|
+ <if test="detailIndex == 3">
|
|
|
+ concat('%',#{itemDetail},'%')
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="detailIndex < 3">
|
|
|
+ ${itemDetail}
|
|
|
+ </if>
|
|
|
+
|
|
|
+ </foreach>
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
|
|
|
+ <if test="detailIndex == 3">
|
|
|
+ #{itemDetail}
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="detailIndex < 3">
|
|
|
+ ${itemDetail}
|
|
|
+ </if>
|
|
|
+
|
|
|
+ </foreach>
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
+
|
|
|
+
|
|
|
+ </foreach>
|
|
|
+
|
|
|
+
|
|
|
+</if>
|
|
|
+ </where>
|
|
|
+ order by id desc
|
|
|
+ </select>
|
|
|
+ <select id="queryHousingTrust" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.HousingTrust">
|
|
|
+ select <include refid="Base_Column_List"/> from housing_trust
|
|
|
+ <where>
|
|
|
+ and del_flag = 'N'
|
|
|
+ <if test="id != null and !"".equals(id)">
|
|
|
+ and id = #{id}
|
|
|
+ </if>
|
|
|
+ <if test="delFlag != null and !"".equals(delFlag)">
|
|
|
+ and del_flag = #{delFlag}
|
|
|
+ </if>
|
|
|
+ <if test="userId != null and !"".equals(userId)">
|
|
|
+ and user_id = #{userId}
|
|
|
+ </if>
|
|
|
+ <if test="userName != null and !"".equals(userName)">
|
|
|
+ and user_name = #{userName}
|
|
|
+ </if>
|
|
|
+ <if test="realName != null and !"".equals(realName)">
|
|
|
+ and real_name = #{realName}
|
|
|
+ </if>
|
|
|
+ <if test="telephone != null and !"".equals(telephone)">
|
|
|
+ and telephone = #{telephone}
|
|
|
+ </if>
|
|
|
+ <if test="address != null and !"".equals(address)">
|
|
|
+ and address = #{address}
|
|
|
+ </if>
|
|
|
+ <if test="addressDetail != null and !"".equals(addressDetail)">
|
|
|
+ and address_detail = #{addressDetail}
|
|
|
+ </if>
|
|
|
+ <if test="remark != null and !"".equals(remark)">
|
|
|
+ and remark = #{remark}
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null and !"".equals(createTime)">
|
|
|
+ and create_time = #{createTime}
|
|
|
+ </if>
|
|
|
+ <if test="statusFlag != null and !"".equals(statusFlag)">
|
|
|
+ and status_flag = #{statusFlag}
|
|
|
+ </if>
|
|
|
+
|
|
|
+ </where>
|
|
|
+ LIMIT 1
|
|
|
+ </select>
|
|
|
+ <update id="delete">
|
|
|
+ UPDATE housing_trust SET del_flag = 'Y'
|
|
|
+ <where>
|
|
|
+ AND id = #{id}
|
|
|
+ </where>
|
|
|
+ </update>
|
|
|
+ <select id="query" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.HousingTrust">
|
|
|
+ select <include refid="Base_Column_List"/> from housing_trust
|
|
|
+ <where>
|
|
|
+ and del_flag = 'N'
|
|
|
+ </where>
|
|
|
+ order by id desc
|
|
|
+ </select>
|
|
|
+</mapper>
|
|
|
+
|