From 0baeb5d2b147bf29add1e5373652ae70dd749b69 Mon Sep 17 00:00:00 2001
From: ludc
Date: 星期五, 24 三月 2023 21:08:55 +0800
Subject: [PATCH] 更新密码策略功能

---
 Source/BladeX/blade-service/blade-system/src/main/java/org/springblade/system/mapper/StrategyMapper.xml |   70 ++++++----------------------------
 1 files changed, 13 insertions(+), 57 deletions(-)

diff --git a/Source/BladeX/blade-service/blade-system/src/main/java/org/springblade/system/mapper/StrategyMapper.xml b/Source/BladeX/blade-service/blade-system/src/main/java/org/springblade/system/mapper/StrategyMapper.xml
index fdd77f4..5b3e32f 100644
--- a/Source/BladeX/blade-service/blade-system/src/main/java/org/springblade/system/mapper/StrategyMapper.xml
+++ b/Source/BladeX/blade-service/blade-system/src/main/java/org/springblade/system/mapper/StrategyMapper.xml
@@ -7,7 +7,7 @@
         <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 " 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"/>
@@ -20,6 +20,7 @@
         <result property="updateTime" column="UPDATE_TIME" jdbcType="TIMESTAMP"/>
         <result property="updateUser" column="UPDATE_USER" jdbcType="TIMESTAMP"/>
         <result property="combinationNames" column="COMBINATIONNAMES"/>
+        <result property="regex" column="REGEX"/>
     </resultMap>
 
     <!--鏌ヨ鎸囧畾琛屾暟鎹�-->
@@ -87,63 +88,18 @@
         </where>
     </select>
 
-    <!--閫氳繃涓婚敭淇敼鏁版嵁-->
-    <!--<update id="update">
-        update PL_SYS_STRATEGY
-        <set>
-            <if test="strategyName != null and strategyName != ''">
-                STRATEGY_NAME = #{strategyName},
-            </if>
-            <if test="minPwdLen != null and minPwdLen != ''">
-                MIN_PWD_LEN = #{minPwdLen},
-            </if>
-            <if test="maxPwdLen != null and maxPwdLen != ''">
-                MAX_PWD_LEN = #{maxPwdLen},
-            </if>
-            <if test="combination  != null and combination  != ''">
-                COMBINATION  = #{combination },
-            </if>
-            <if test="requiredType != null and requiredType != ''">
-                REQUIRED_TYPE = #{requiredType},
-            </if>
-            <if test="expirationTime != null">
-                EXPIRATION_TIME = #{expirationTime},
-            </if>
-            <if test="reminderTime != null">
-                REMINDER_TIME = #{reminderTime},
-            </if>
-            <if test="lockingNum != null and lockingNum != ''">
-                LOCKING_NUM = #{lockingNum},
-            </if>
-            <if test="lockingTime != null">
-                LOCKING_TIME = #{lockingTime},
-            </if>
-            <if test="desc != null and desc != ''">
-                DESC = #{desc},
-            </if>
-            <if test="isDefault != null and isDefault != ''">
-                IS_DEFAULT = #{isDefault},
-            </if>
-            <if test="createDate != null">
-                CREATE_DATE = #{createDate},
-            </if>
-            <if test="createUser != null">
-                CREATE_USER = #{createUser},
-            </if>
-            <if test="updateDate != null">
-                UPDATE_DATE = #{updateDate},
-            </if>
-            <if test="updateUser != null">
-                UPDATE_USER = #{updateUser},
-            </if>
-        </set>
-        where ID = #{id}
-    </update>
 
-    &lt;!&ndash;閫氳繃涓婚敭鍒犻櫎&ndash;&gt;
-    <delete id="deleteById">
-        delete from PL_SYS_STRATEGY where ID = #{id}
-    </delete>-->
+    <select id="queryByNameAndTenantId" resultMap="StrategyMap">
+        SELECT PSS.* FROM PL_SYS_STRATEGY 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.NAME=#{name};
+    </select>
+
+    <select id="queryByUserId" resultMap="StrategyMap">
+        SELECT PSS.* FROM PL_SYS_STRATEGY PSS LEFT JOIN PL_SYS_USER_PWDSTRATEGY PSUP ON PSS.ID=psup.PWDSTRATEGY_ID
+        WHERE PSUP.USER_ID = #{userId}
+    </select>
 
 </mapper>
 

--
Gitblit v1.9.3