|
@@ -0,0 +1,141 @@
|
|
|
+<?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.huaxu.dao.TenantMapper">
|
|
|
+
|
|
|
+ <resultMap id="TenantMap" type="com.huaxu.entity.TenantEntity" >
|
|
|
+ <result property="id" column="ID" jdbcType="INTEGER"/>
|
|
|
+ <result property="tenantName" column="TENANT_NAME" jdbcType="VARCHAR"/>
|
|
|
+ <result property="code" column="CODE" jdbcType="VARCHAR"/>
|
|
|
+ <result property="logo" column="LOGO" jdbcType="VARCHAR"/>
|
|
|
+ <result property="webUrl" column="WEB_URL" jdbcType="VARCHAR"/>
|
|
|
+ <result property="startDate" column="START_DATE" jdbcType="TIMESTAMP"/>
|
|
|
+ <result property="endDate" column="END_DATE" jdbcType="TIMESTAMP"/>
|
|
|
+ <result property="tenantState" column="TENANT_STATE" jdbcType="INTEGER"/>
|
|
|
+ <result property="remark" column="REMARK" jdbcType="VARCHAR"/>
|
|
|
+ <result property="status" column="STATUS" jdbcType="INTEGER"/>
|
|
|
+ <result property="dateCreate" column="DATE_CREATE" jdbcType="TIMESTAMP"/>
|
|
|
+ <result property="createBy" column="CREATE_BY" jdbcType="VARCHAR"/>
|
|
|
+ <result property="dateUpdate" column="DATE_UPDATE" jdbcType="TIMESTAMP"/>
|
|
|
+ <result property="updateBy" column="UPDATE_BY" jdbcType="VARCHAR"/>
|
|
|
+ </resultMap>
|
|
|
+ <sql id="Base_Column_List">
|
|
|
+ ID ,TENANT_NAME ,CODE ,LOGO ,WEB_URL ,START_DATE ,END_DATE ,TENANT_STATE ,REMARK ,STATUS ,DATE_CREATE ,CREATE_BY ,DATE_UPDATE ,UPDATE_BY
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectById" resultMap="TenantMap">
|
|
|
+ select
|
|
|
+ <include refid="Base_Column_List"/>
|
|
|
+ from uims_tenant
|
|
|
+ where ID = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 查询全部 -->
|
|
|
+ <select id="selectAll" resultMap="TenantMap">
|
|
|
+ select
|
|
|
+ <include refid="Base_Column_List"/>
|
|
|
+ from uims_tenant
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!--通过实体作为筛选条件查询-->
|
|
|
+ <select id="selectList" resultMap="TenantMap">
|
|
|
+ select
|
|
|
+ <include refid="Base_Column_List"/>
|
|
|
+ from uims_tenant
|
|
|
+ <where>
|
|
|
+ <if test="id != null">
|
|
|
+ and ID = #{id}
|
|
|
+ </if>
|
|
|
+ <if test="tenantName != null and tenantName != ''">
|
|
|
+ and TENANT_NAME like concat('%',#{tenantName},'%')
|
|
|
+ </if>
|
|
|
+ <if test="code != null and code != ''">
|
|
|
+ and CODE = #{code}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 新增所有列 -->
|
|
|
+ <insert id="insert" keyProperty="id" useGeneratedKeys="true">
|
|
|
+ insert into uims_tenant(ID ,TENANT_NAME ,CODE ,LOGO ,WEB_URL ,START_DATE ,END_DATE ,TENANT_STATE ,REMARK ,STATUS ,DATE_CREATE ,CREATE_BY ,DATE_UPDATE ,UPDATE_BY)
|
|
|
+ values ( #{id}, #{tenantName}, #{code}, #{logo}, #{webUrl}, #{startDate}, #{endDate}, #{tenantState}, #{remark}, #{status},#{dateCreate},#{createBy},#{dateUpdate},#{updateBy})
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <!-- 批量新增 -->
|
|
|
+ <insert id="batchInsert">
|
|
|
+ insert into uims_tenant(ID ,TENANT_NAME ,CODE ,LOGO ,WEB_URL ,START_DATE ,END_DATE ,TENANT_STATE ,REMARK ,STATUS ,DATE_CREATE ,CREATE_BY ,DATE_UPDATE ,UPDATE_BY)
|
|
|
+ values
|
|
|
+ <foreach collection="tenants" item="item" index="index" separator=",">
|
|
|
+ (
|
|
|
+ #{item.id}, #{item.tenantName}, #{item.code}, #{item.logo}, #{item.webUrl}, #{item.startDate},#{item.endDate},
|
|
|
+ #{item.tenantState}, #{item.remark}, #{item.status}, #{item.dateCreate}, #{item.createBy}, #{item.dateUpdate}, #{item.updateBy} )
|
|
|
+ </foreach>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <!-- 通过主键修改数据 -->
|
|
|
+ <update id="update">
|
|
|
+ update uims.uims_tenant
|
|
|
+ <set>
|
|
|
+ <if test="tenantName != null and tenantName != ''">
|
|
|
+ TENANT_NAME = #{tenantName},
|
|
|
+ </if>
|
|
|
+ <if test="code != null and code != ''">
|
|
|
+ CODE = #{code},
|
|
|
+ </if>
|
|
|
+ <if test="logo != null and logo != ''">
|
|
|
+ LOGO = #{logo},
|
|
|
+ </if>
|
|
|
+ <if test="webUrl != null and webUrl != ''">
|
|
|
+ WEB_URL = #{webUrl},
|
|
|
+ </if>
|
|
|
+ <if test="startDate != null">
|
|
|
+ START_DATE = #{startDate},
|
|
|
+ </if>
|
|
|
+ <if test="endDate != null ">
|
|
|
+ END_DATE = #{tenantState},
|
|
|
+ </if>
|
|
|
+ <if test="tenantState != null">
|
|
|
+ TENANT_STATE = #{tenantState},
|
|
|
+ </if>
|
|
|
+ <if test="remark != null and remark != ''">
|
|
|
+ REMARK = #{remark},
|
|
|
+ </if>
|
|
|
+ <if test="status != null">
|
|
|
+ STATUS = #{status},
|
|
|
+ </if>
|
|
|
+ <if test="dateUpdate != null">
|
|
|
+ DATE_UPDATE = #{dateUpdate},
|
|
|
+ </if>
|
|
|
+ <if test="updateBy != null and remark != ''">
|
|
|
+ UPDATE_BY = #{updateBy},
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ where ID = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <!--通过主键删除-->
|
|
|
+ <delete id="deleteById">
|
|
|
+ delete from uims_tenant where ID = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <!-- 总数 -->
|
|
|
+ <select id="count" resultType="int">
|
|
|
+ select count(*) from uims_tenant
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectPage" resultMap="TenantMap">
|
|
|
+ select
|
|
|
+ <include refid="Base_Column_List"/>
|
|
|
+ from uims_tenant
|
|
|
+ <where>
|
|
|
+ <if test="id != null">
|
|
|
+ and ID = #{app.id}
|
|
|
+ </if>
|
|
|
+ <if test="tenantName != null and tenantName != ''">
|
|
|
+ and TENANT_NAME like concat('%',#{app.tenantName},'%')
|
|
|
+ </if>
|
|
|
+ <if test="code != null and code != ''">
|
|
|
+ and CODE = #{app.code}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+</mapper>
|