1.添加手机号和身份证的安全性和保密性
2.添加对应的定时任务
This commit is contained in:
@@ -152,4 +152,88 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
order by b.create_time desc
|
||||
</select>
|
||||
|
||||
<update id="batchUpdateIdCardAndPhone">
|
||||
UPDATE app_user
|
||||
SET id_card = CASE
|
||||
<foreach collection="list" item="item" separator="">
|
||||
WHEN user_id = #{item.userId} THEN #{item.idCard}
|
||||
</foreach>
|
||||
END,
|
||||
id_card_cipher = CASE
|
||||
<foreach collection="list" item="item" separator="">
|
||||
WHEN user_id = #{item.userId} THEN #{item.idCardCipher}
|
||||
</foreach>
|
||||
END,
|
||||
id_card_encrypt = CASE
|
||||
<foreach collection="list" item="item" separator="">
|
||||
WHEN user_id = #{item.userId} THEN #{item.idCardEncrypt}
|
||||
</foreach>
|
||||
END,
|
||||
phone = CASE
|
||||
<foreach collection="list" item="item" separator="">
|
||||
WHEN user_id = #{item.userId} THEN #{item.phone}
|
||||
</foreach>
|
||||
END,
|
||||
phone_cipher = CASE
|
||||
<foreach collection="list" item="item" separator="">
|
||||
WHEN user_id = #{item.userId} THEN #{item.phoneCipher}
|
||||
</foreach>
|
||||
END,
|
||||
phone_encrypt = CASE
|
||||
<foreach collection="list" item="item" separator="">
|
||||
WHEN user_id = #{item.userId} THEN #{item.phoneEncrypt}
|
||||
</foreach>
|
||||
END
|
||||
WHERE user_id IN
|
||||
<foreach collection="list" item="item" open="(" separator="," close=")">
|
||||
#{item.userId}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<update id="batchUpdateSysUserEncrypt">
|
||||
UPDATE sys_user
|
||||
SET id_card = CASE
|
||||
<foreach collection="list" item="item" separator="">
|
||||
WHEN user_id = #{item.userId} THEN #{item.idCard}
|
||||
</foreach>
|
||||
END,
|
||||
id_card_cipher = CASE
|
||||
<foreach collection="list" item="item" separator="">
|
||||
WHEN user_id = #{item.userId} THEN #{item.idCardCipher}
|
||||
</foreach>
|
||||
END,
|
||||
id_card_encrypt = CASE
|
||||
<foreach collection="list" item="item" separator="">
|
||||
WHEN user_id = #{item.userId} THEN #{item.idCardEncrypt}
|
||||
</foreach>
|
||||
END,
|
||||
phonenumber = CASE
|
||||
<foreach collection="list" item="item" separator="">
|
||||
WHEN user_id = #{item.userId} THEN #{item.phonenumber}
|
||||
</foreach>
|
||||
END,
|
||||
phonenumber_cipher = CASE
|
||||
<foreach collection="list" item="item" separator="">
|
||||
WHEN user_id = #{item.userId} THEN #{item.phonenumberCipher}
|
||||
</foreach>
|
||||
END,
|
||||
phonenumber_encrypt = CASE
|
||||
<foreach collection="list" item="item" separator="">
|
||||
WHEN user_id = #{item.userId} THEN #{item.phonenumberEncrypt}
|
||||
</foreach>
|
||||
END
|
||||
WHERE user_id IN
|
||||
<foreach collection="list" item="item" open="(" separator="," close=")">
|
||||
#{item.userId}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<select id="getSysUserListEncrypt" resultType="com.ruoyi.common.core.domain.entity.SysUser">
|
||||
select a.user_id,a.phonenumber,a.id_card, b.roleIdsStr
|
||||
from sys_user a
|
||||
inner join (SELECT user_id, STRING_AGG(CAST(role_id AS TEXT), ',') AS roleIdsStr
|
||||
FROM sys_user_role GROUP BY user_id) b
|
||||
on a.user_id = b.user_id and (phonenumber is not null or id_card is not null)
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -18,7 +18,7 @@
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectCompanyContactVo">
|
||||
select id, company_id, contact_person, contact_person_phone, del_flag, create_by, create_time, update_by, update_time, remark from company_contact
|
||||
select id, company_id, contact_person, contact_person_phone, del_flag, create_by, create_time, update_by, update_time, remark,contact_person_phone_cipher,contact_person_phone_encrypt from company_contact
|
||||
</sql>
|
||||
|
||||
<select id="getSelectList" resultMap="CompanyContactResult" parameterType="CompanyContact">
|
||||
@@ -39,12 +39,14 @@
|
||||
<insert id="batchInsert" parameterType="java.util.List">
|
||||
INSERT INTO company_contact (
|
||||
company_id, contact_person, contact_person_phone,
|
||||
create_by, create_time, del_flag,remark
|
||||
create_by, create_time, del_flag,remark,contact_person_phone_cipher,
|
||||
contact_person_phone_encrypt
|
||||
) VALUES
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(
|
||||
#{item.companyId}, #{item.contactPerson}, #{item.contactPersonPhone},
|
||||
#{item.createBy}, #{item.createTime}, #{item.delFlag},#{item.remark}
|
||||
#{item.createBy}, #{item.createTime}, #{item.delFlag},#{item.remark},
|
||||
#{item.contactPersonPhoneCipher},#{item.contactPersonPhoneEncrypt}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
@@ -76,6 +78,18 @@
|
||||
</foreach>
|
||||
ELSE update_time
|
||||
END,
|
||||
contact_person_phone_cipher = CASE
|
||||
<foreach collection="list" item="item" separator="">
|
||||
WHEN id = #{item.id} THEN #{item.contactPersonPhoneCipher}
|
||||
</foreach>
|
||||
ELSE contact_person_phone_cipher
|
||||
END,
|
||||
contact_person_phone_encrypt = CASE
|
||||
<foreach collection="list" item="item" separator="">
|
||||
WHEN id = #{item.id} THEN #{item.contactPersonPhoneEncrypt}
|
||||
</foreach>
|
||||
ELSE contact_person_phone_encrypt
|
||||
END,
|
||||
remark = CASE
|
||||
<foreach collection="list" item="item" separator="">
|
||||
WHEN id = #{item.id} THEN #{item.remark}
|
||||
|
||||
@@ -137,4 +137,57 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<update id="batchUpdateEncrypt">
|
||||
UPDATE company
|
||||
SET legal_id_card = CASE
|
||||
<foreach collection="list" item="item" separator="">
|
||||
WHEN company_id = #{item.companyId} THEN #{item.legalIdCard}
|
||||
</foreach>
|
||||
END,
|
||||
legal_id_card_cipher = CASE
|
||||
<foreach collection="list" item="item" separator="">
|
||||
WHEN company_id = #{item.companyId} THEN #{item.legalIdCardCipher}
|
||||
</foreach>
|
||||
END,
|
||||
legal_id_card_encrypt = CASE
|
||||
<foreach collection="list" item="item" separator="">
|
||||
WHEN company_id = #{item.companyId} THEN #{item.legalIdCardEncrypt}
|
||||
</foreach>
|
||||
END,
|
||||
legal_phone = CASE
|
||||
<foreach collection="list" item="item" separator="">
|
||||
WHEN company_id = #{item.companyId} THEN #{item.legalPhone}
|
||||
</foreach>
|
||||
END,
|
||||
legal_phone_cipher = CASE
|
||||
<foreach collection="list" item="item" separator="">
|
||||
WHEN company_id = #{item.companyId} THEN #{item.legalPhoneCipher}
|
||||
</foreach>
|
||||
END,
|
||||
legal_phone_encrypt = CASE
|
||||
<foreach collection="list" item="item" separator="">
|
||||
WHEN company_id = #{item.companyId} THEN #{item.legalPhoneEncrypt}
|
||||
</foreach>
|
||||
END
|
||||
WHERE company_id IN
|
||||
<foreach collection="list" item="item" open="(" separator="," close=")">
|
||||
#{item.companyId}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<select id="selectCompanyEncryptList" parameterType="Company" resultMap="CompanyResult">
|
||||
<include refid="selectCompanyVo"/>
|
||||
<where> del_flag = '0' and (legal_id_card is not null or legal_phone is not null)
|
||||
<if test="name != null and name != ''"> and name like concat('%', cast(#{name, jdbcType=VARCHAR} as varchar), '%')</if>
|
||||
<if test="location != null and location != ''"> and location like concat('%', cast(#{location, jdbcType=VARCHAR} as varchar), '%')</if>
|
||||
<if test="industry != null and industry != ''"> and industry = #{industry}</if>
|
||||
<if test="scale != null and scale != ''"> and scale = #{scale}</if>
|
||||
<if test="nature != null and nature != ''"> and nature = #{nature}</if>
|
||||
<if test="code != null and code != ''"> and code = #{code}</if>
|
||||
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||
<if test="companyId != null and companyId != ''"> and company_id = #{companyId}</if>
|
||||
<if test="regionCode != null and regionCode != ''"> and region_code = #{regionCode}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -35,4 +35,42 @@
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<update id="updatePhoneEncrypt">
|
||||
UPDATE employee_confirm
|
||||
SET id_card = CASE
|
||||
<foreach collection="list" item="item" separator="">
|
||||
WHEN id = #{item.id} THEN #{item.idCard}
|
||||
</foreach>
|
||||
END,
|
||||
id_card_cipher = CASE
|
||||
<foreach collection="list" item="item" separator="">
|
||||
WHEN id = #{item.id} THEN #{item.idCardCipher}
|
||||
</foreach>
|
||||
END,
|
||||
id_card_encrypt = CASE
|
||||
<foreach collection="list" item="item" separator="">
|
||||
WHEN id = #{item.id} THEN #{item.idCardEncrypt}
|
||||
</foreach>
|
||||
END,
|
||||
contact_person_phone = CASE
|
||||
<foreach collection="list" item="item" separator="">
|
||||
WHEN id = #{item.id} THEN #{item.contactPersonPhone}
|
||||
</foreach>
|
||||
END,
|
||||
contact_person_phone_cipher = CASE
|
||||
<foreach collection="list" item="item" separator="">
|
||||
WHEN id = #{item.id} THEN #{item.contactPersonPhoneCipher}
|
||||
</foreach>
|
||||
END,
|
||||
contact_person_phone_encrypt = CASE
|
||||
<foreach collection="list" item="item" separator="">
|
||||
WHEN id = #{item.id} THEN #{item.contactPersonPhoneEncrypt}
|
||||
</foreach>
|
||||
END
|
||||
WHERE id IN
|
||||
<foreach collection="list" item="item" open="(" separator="," close=")">
|
||||
#{item.id}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -16,11 +16,13 @@
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="remark" column="remark"/>
|
||||
<result property="contactPersonPhoneCipher" column="contact_person_phone_cipher"/>
|
||||
<result property="contactPersonPhoneEncrypt" column="contact_person_phone_encrypt"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
<sql id="JobContactVo">
|
||||
select id, job_id, contact_person, contact_person_phone, position, del_flag, create_by, create_time, update_by, update_time, remark from job_contact
|
||||
select id, job_id, contact_person, contact_person_phone, position, del_flag, create_by, create_time, update_by, update_time, remark,contact_person_phone_cipher,contact_person_phone_encrypt from job_contact
|
||||
</sql>
|
||||
|
||||
|
||||
@@ -45,12 +47,14 @@
|
||||
<insert id="batchInsert" parameterType="java.util.List">
|
||||
INSERT INTO job_contact (
|
||||
job_id, contact_person, contact_person_phone,position,
|
||||
create_by, create_time, del_flag,remark
|
||||
create_by, create_time, del_flag,remark,contact_person_phone_cipher,
|
||||
contact_person_phone_encrypt
|
||||
) VALUES
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(
|
||||
#{item.jobId}, #{item.contactPerson}, #{item.contactPersonPhone},#{item.position},
|
||||
#{item.createBy}, #{item.createTime}, #{item.delFlag},#{item.remark}
|
||||
#{item.createBy}, #{item.createTime}, #{item.delFlag},#{item.remark},#{item.contactPersonPhoneCipher},
|
||||
#{item.contactPersonPhoneEncrypt}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
@@ -73,4 +77,27 @@
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<update id="batchUpdateEncrypt">
|
||||
UPDATE job_contact
|
||||
SET contact_person_phone = CASE
|
||||
<foreach collection="list" item="item" separator="">
|
||||
WHEN id = #{item.id} THEN #{item.contactPersonPhone}
|
||||
</foreach>
|
||||
END,
|
||||
contact_person_phone_cipher = CASE
|
||||
<foreach collection="list" item="item" separator="">
|
||||
WHEN id = #{item.id} THEN #{item.contactPersonPhoneCipher}
|
||||
</foreach>
|
||||
END,
|
||||
contact_person_phone_encrypt = CASE
|
||||
<foreach collection="list" item="item" separator="">
|
||||
WHEN id = #{item.id} THEN #{item.contactPersonPhoneEncrypt}
|
||||
</foreach>
|
||||
END
|
||||
WHERE id IN
|
||||
<foreach collection="list" item="item" open="(" separator="," close=")">
|
||||
#{item.id}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<mapper namespace="com.ruoyi.cms.mapper.WechatGroupMapper">
|
||||
|
||||
<select id="selectWechatGroupList" resultType="com.ruoyi.cms.domain.vo.WechatGroupVo">
|
||||
select g.create_time, g.id, g.name, g.is_push, u.wechat_name, u.phone_number, u.id communityId
|
||||
select g.create_time, g.id, g.name, g.is_push, u.wechat_name, u.phone_number, u.id communityId,u.phone_number_cipher,u.phone_number_encrypt
|
||||
from wechat_group g join community_user u on g.community_id = u.id
|
||||
where g.del_flag = 0 and u.del_flag = 0
|
||||
<if test="p.name != null and p.name != ''">
|
||||
|
||||
Reference in New Issue
Block a user