1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- <?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.bizmatics.persistence.mapper.SysTenantMapper">
- <!-- 通用查询映射结果 -->
- <resultMap id="BaseResultMap" type="com.bizmatics.model.SysTenant">
- <id column="id" property="id" />
- <result column="tenant_code" property="tenantCode" />
- <result column="tenant_name" property="tenantName" />
- <result column="tenant_manager" property="tenantManager" />
- <result column="tenant_type" property="tenantType" />
- <result column="domain" property="domain" />
- <result column="email" property="email" />
- <result column="phone_number" property="phoneNumber" />
- <result column="address" property="address" />
- <result column="geo_position" property="geoPosition" />
- <result column="tenant_term" property="tenantTerm" />
- <result column="remark" property="remark" />
- <result column="status" property="status" />
- <result column="create_by" property="createBy" />
- <result column="create_time" property="createTime" />
- <result column="update_by" property="updateBy" />
- <result column="update_time" property="updateTime" />
- <result column="system_name" property="systemName" />
- </resultMap>
- <select id="getUserData" resultType="com.bizmatics.model.vo.SysTenantVo">
- SELECT
- a.*,b.id,b.tenant_code,b.tenant_name,b.tenant_manager,b.tenant_type,b.domain,b.tenant_term,b.system_name
- FROM
- sys_user AS a
- LEFT JOIN sys_tenant AS b ON a.tenant_id = b.id
- <where>
- a.user_id = #{userId}
- </where>
- </select>
- <select id="getTenantData" resultType="com.bizmatics.model.SysTenant">
- SELECT
- *
- FROM
- sys_tenant
- <where>
- <if test="tenantName != null and tenantName != ''">
- and tenant_name LIKE CONCAT(CONCAT('%', #{tenantName}), '%')
- </if>
- <if test="tenantManager != null and tenantManager != ''">
- and tenant_manager LIKE CONCAT(CONCAT('%', #{tenantManager}), '%')
- </if>
- <if test="tenantType != null and tenantType != ''">
- and tenant_type = #{tenantType}
- </if>
- <if test="status != null and status != ''">
- and status = #{status}
- </if>
- <if test="endTime != null and startTime != null and endTime != '' and startTime != ''">
- and tenant_term BETWEEN #{startTime} and #{endTime}
- </if>
- </where>
- <if test="current != null and size != null and size != 0">
- limit #{current},#{size}
- </if>
- </select>
- </mapper>
|