You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
108 lines
3.6 KiB
108 lines
3.6 KiB
<?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="cn.jyjz.xiaoyao.admin.dataDao.UserTenantMybatisDao">
|
|
<resultMap id="BaseResultMap" type="cn.jyjz.xiaoyao.admin.dataobject.UserTenant">
|
|
<id column="ID" property="id" jdbcType="BIGINT"/>
|
|
<result column="USERID" property="userid" jdbcType="BIGINT"/>
|
|
<result column="TENANTID" property="tenantid" jdbcType="BIGINT"/>
|
|
<result column="STATUS" property="status" jdbcType="INTEGER"/>
|
|
<result column="CREATEUSER" property="createuser" jdbcType="VARCHAR"/>
|
|
<result column="CREATEDATE" property="createdate" jdbcType="BIGINT"/>
|
|
<result column="UPDATEUSER" property="updateuser" jdbcType="VARCHAR"/>
|
|
<result column="UPDATETIME" property="updatetime" jdbcType="BIGINT"/>
|
|
</resultMap>
|
|
<sql id="Base_Column_List">
|
|
ID AS id,
|
|
USERID AS userid,
|
|
TENANTID AS tenantid,
|
|
STATUS AS status,
|
|
CREATEUSER AS createuser,
|
|
CREATEDATE AS createdate,
|
|
UPDATEUSER AS updateuser,
|
|
UPDATETIME AS updatetime
|
|
</sql>
|
|
|
|
<sql id="Base_Where">
|
|
<where>
|
|
<trim prefixOverrides="and|or">
|
|
<if test="id != null"> and ID ${id.dataOp} ${id.likestar}#{id.value}${id.likeend}</if>
|
|
<if test="tenantid != null"> and TENANTID ${tenantid.dataOp} ${tenantid.likestar}#{tenantid.value}${tenantid.likeend}</if>
|
|
<if test="status != null"> and STATUS ${status.dataOp} ${status.likestar}#{status.value}${status.likeend}</if>
|
|
<if test="createuser != null"> and CREATEUSER ${createuser.dataOp} ${createuser.likestar}#{createuser.value}${createuser.likeend}</if>
|
|
<if test="createdate != null"> and CREATEDATE ${createdate.dataOp} ${createdate.likestar}#{createdate.value}${createdate.likeend}</if>
|
|
<if test="updateuser != null"> and UPDATEUSER ${updateuser.dataOp} ${updateuser.likestar}#{updateuser.value}${updateuser.likeend}</if>
|
|
<if test="updatetime != null"> and UPDATETIME ${updatetime.dataOp} ${updatetime.likestar}#{updatetime.value}${updatetime.likeend}</if>
|
|
<if test="userid != null"> and USERID ${userid.dataOp} ${userid.likestar}#{userid.value}${userid.likeend}</if>
|
|
<if test="listdept != null">
|
|
and DEPARTID in
|
|
<foreach collection="listdept.value" item="item" index="index" open="(" separator="," close=")" >
|
|
#{item}
|
|
</foreach>
|
|
</if>
|
|
</trim>
|
|
</where>
|
|
<if test="page != null">
|
|
<if test="page.sortname != null"> order by ${page.sortname} ${page.sortorder}</if>
|
|
limit ${page.start}, ${page.Pagesize}
|
|
</if>
|
|
</sql>
|
|
|
|
<select id="listCount" resultType="java.lang.Long" parameterType="java.util.Map">
|
|
select
|
|
count(ten.ID)
|
|
from
|
|
S_TENANT_T ten
|
|
where
|
|
ten.OTHERNO = #{otherno}
|
|
and
|
|
ten.ID in (
|
|
select ue.TENANTID from
|
|
S_USER_T us,
|
|
S_USER_TENANT_T ue where us.LOGINNAME = #{loginname}
|
|
)
|
|
|
|
</select>
|
|
|
|
<select id="listOthernoCount" resultType="java.lang.Long" parameterType="java.util.Map">
|
|
select
|
|
count(ten.ID)
|
|
from
|
|
S_TENANT_T ten
|
|
where
|
|
ten.OTHERNO = #{otherno}
|
|
</select>
|
|
|
|
<select id="listLoginNameCount" resultType="java.lang.Long" parameterType="java.util.Map">
|
|
select
|
|
count(ten.ID)
|
|
from
|
|
S_TENANT_T ten
|
|
where
|
|
ten.OTHERNO = #{otherno}
|
|
and
|
|
ten.ID in (
|
|
select ue.TENANTID from
|
|
S_USER_T us,
|
|
S_USER_TENANT_T ue where us.LOGINNAME = #{loginname}
|
|
)
|
|
|
|
</select>
|
|
|
|
|
|
<select id="listMobileCount" resultType="java.lang.Long" parameterType="java.util.Map">
|
|
select
|
|
count(ten.ID)
|
|
from
|
|
S_TENANT_T ten
|
|
where
|
|
ten.OTHERNO = #{otherno}
|
|
and
|
|
ten.ID in (
|
|
select ue.TENANTID from
|
|
S_USER_T us,
|
|
S_USER_TENANT_T ue where us.MOBILE = #{mobile}
|
|
)
|
|
|
|
</select>
|
|
</mapper>
|