<?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.vci.ubcs.system.mapper.StrategyMapper">
|
|
<resultMap type="com.vci.ubcs.system.entity.Strategy" id="StrategyMap">
|
<result property="id" column="ID" jdbcType="VARCHAR"/>
|
<result property="strategyName" column="STRATEGY_NAME" jdbcType="VARCHAR"/>
|
<result property="minPwdLen" column="MIN_PWD_LEN" jdbcType="VARCHAR"/>
|
<result property="maxPwdLen" column="MAX_PWD_LEN" jdbcType="VARCHAR"/>
|
<result property="combinationIds" column="COMBINATION_IDS" jdbcType="VARCHAR"/>
|
<result property="requiredType" column="REQUIRED_TYPE" jdbcType="VARCHAR"/>
|
<result property="expirationTime" column="EXPIRATION_TIME" jdbcType="TIMESTAMP"/>
|
<result property="reminderTime" column="REMINDER_TIME" jdbcType="TIMESTAMP"/>
|
<result property="lockingNum" column="LOCKING_NUM" jdbcType="VARCHAR"/>
|
<result property="lockingTime" column="LOCKING_TIME" jdbcType="TIMESTAMP"/>
|
<result property="desc" column="DESC" jdbcType="VARCHAR"/>
|
<result property="isDefault" column="IS_DEFAULT" jdbcType="VARCHAR"/>
|
<result property="createTime" column="CREATE_TIME" jdbcType="TIMESTAMP"/>
|
<result property="createUser" column="CREATE_USER" jdbcType="TIMESTAMP"/>
|
<result property="updateTime" column="UPDATE_TIME" jdbcType="TIMESTAMP"/>
|
<result property="updateUser" column="UPDATE_USER" jdbcType="TIMESTAMP"/>
|
<result property="combinationNames" column="COMBINATIONNAMES"/>
|
</resultMap>
|
|
<!--查询指定行数据-->
|
<select id="queryAllByPage" resultMap="StrategyMap">
|
select pss.*,
|
(SELECT listagg(psc.NAME,',') within GROUP(ORDER BY psc.NAME asc)
|
from PL_SYS_COMBINATION psc
|
where instr(pss.COMBINATION_IDS,psc.ID) > 0) COMBINATIONNAMES
|
from PL_SYS_PWDSTRATEGY pss
|
<where>
|
<if test="tenantId != null and tenantId != ''">
|
TENANT_ID = #{tenantId}
|
</if>
|
</where>
|
</select>
|
|
<!--统计总行数-->
|
<select id="count" resultType="java.lang.Long">
|
select count(1)
|
from PL_SYS_PWDSTRATEGY
|
<where>
|
<if test="id != null and id != ''">
|
and ID = #{id}
|
</if>
|
<if test="strategyName != null and strategyName != ''">
|
and STRATEGY_NAME = #{strategyName}
|
</if>
|
<if test="minPwdLen != null and minPwdLen != ''">
|
and MIN_PWD_LEN = #{minPwdLen}
|
</if>
|
<if test="maxPwdLen != null and maxPwdLen != ''">
|
and MAX_PWD_LEN = #{maxPwdLen}
|
</if>
|
<if test="combination != null and combination != ''">
|
and COMBINATION = #{combination }
|
</if>
|
<if test="requiredType != null and requiredType != ''">
|
and REQUIRED_TYPE = #{requiredType}
|
</if>
|
<if test="expirationTime != null">
|
and EXPIRATION_TIME = #{expirationTime}
|
</if>
|
<if test="reminderTime != null">
|
and REMINDER_TIME = #{reminderTime}
|
</if>
|
<if test="lockingNum != null and lockingNum != ''">
|
and LOCKING_NUM = #{lockingNum}
|
</if>
|
<if test="lockingTime != null">
|
and LOCKING_TIME = #{lockingTime}
|
</if>
|
<if test="desc != null and desc != ''">
|
and DESC = #{desc}
|
</if>
|
<if test="isDefault != null and isDefault != ''">
|
and IS_DEFAULT = #{isDefault}
|
</if>
|
<if test="createDate != null">
|
and CREATE_DATE = #{createDate}
|
</if>
|
<if test="createUser != null">
|
and CREATE_USER = #{createUser}
|
</if>
|
<if test="updateDate != null">
|
and UPDATE_DATE = #{updateDate}
|
</if>
|
<if test="updateUser != null">
|
and UPDATE_USER = #{updateUser}
|
</if>
|
</where>
|
</select>
|
|
<select id="queryByNameAndTenantId" resultMap="StrategyMap">
|
SELECT PSS.*,(SELECT listagg(psc.NAME,',') within GROUP(ORDER BY psc.NAME asc)
|
from PL_SYS_COMBINATION psc
|
where instr(pss.COMBINATION_IDS,psc.ID) > 0) COMBINATIONNAMES
|
FROM PL_SYS_PWDSTRATEGY PSS
|
LEFT JOIN PL_SYS_USER_PWDSTRATEGY PSUP ON PSS.ID=PSUP.PWDSTRATEGY_ID
|
LEFT JOIN PL_ORG_USER POU ON POU.ID=PSUP.USER_ID
|
WHERE POU.TENANT_ID = #{tenantId} AND POU.ACCOUNT=#{name} AND POU.IS_DELETED = 0;
|
</select>
|
|
<select id="queryByUserId" resultMap="StrategyMap">
|
SELECT PSS.*,(SELECT listagg(psc.NAME,',') within GROUP(ORDER BY psc.NAME asc)
|
from PL_SYS_COMBINATION psc
|
where instr(pss.COMBINATION_IDS,psc.ID) > 0) COMBINATIONNAMES
|
FROM PL_SYS_PWDSTRATEGY PSS LEFT JOIN PL_SYS_USER_PWDSTRATEGY PSUP ON PSS.ID=psup.PWDSTRATEGY_ID
|
WHERE PSUP.USER_ID = #{userId}
|
</select>
|
|
<select id="queryByIsDefault" resultType="com.vci.ubcs.system.entity.Strategy">
|
SELECT PSS.*,(SELECT listagg(psc.NAME,',') within GROUP(ORDER BY psc.NAME asc)
|
FROM PL_SYS_COMBINATION psc
|
WHERE instr(pss.COMBINATION_IDS, psc.ID) > 0) COMBINATIONNAMES
|
FROM PL_SYS_PWDSTRATEGY PSS
|
WHERE is_default = 1
|
<if test="tenantId != null and tenantId != ''">
|
and TENANT_ID = #{tenantId}
|
</if>
|
</select>
|
|
</mapper>
|