From 9606980aa32de18b4fc1cb7e3450b90c636cbf84 Mon Sep 17 00:00:00 2001
From: xiangpei <xiangpei@timesnew.cn>
Date: 星期四, 10 十月 2024 18:14:10 +0800
Subject: [PATCH] 取图片依赖注释
---
ycl-server/src/main/resources/mapper/zgyw/ImageResourceSecurityMapper.xml | 69 +++++++++++++++++++++++-----------
1 files changed, 47 insertions(+), 22 deletions(-)
diff --git a/ycl-server/src/main/resources/mapper/zgyw/ImageResourceSecurityMapper.xml b/ycl-server/src/main/resources/mapper/zgyw/ImageResourceSecurityMapper.xml
index 74b5a0e..10404c6 100644
--- a/ycl-server/src/main/resources/mapper/zgyw/ImageResourceSecurityMapper.xml
+++ b/ycl-server/src/main/resources/mapper/zgyw/ImageResourceSecurityMapper.xml
@@ -1,34 +1,44 @@
<?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">
+ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+ "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ycl.platform.mapper.ImageResourceSecurityMapper">
<resultMap type="com.ycl.platform.domain.entity.ImageResourceSecurity" id="ImageResourceSecurityResult">
- <result property="id" column="id" />
- <result property="deptId" column="dept_id" />
- <result property="platformOnline" column="platform_online" />
- <result property="propertyAccuracy" column="property_accuracy" />
- <result property="weakPassword" column="weak_password" />
- <result property="riskProperty" column="risk_property" />
- <result property="boundaryIntegrity" column="boundary_integrity" />
- <result property="createTime" column="create_time" />
+ <result property="id" column="id"/>
+ <result property="deptId" column="dept_id"/>
+ <result property="platformOnline" column="platform_online"/>
+ <result property="propertyAccuracy" column="property_accuracy"/>
+ <result property="weakPassword" column="weak_password"/>
+ <result property="riskProperty" column="risk_property"/>
+ <result property="boundaryIntegrity" column="boundary_integrity"/>
+ <result property="createTime" column="create_time"/>
</resultMap>
<sql id="selectImageResourceSecurityVo">
- select id, dept_id, platform_online, property_accuracy, weak_password, risk_property, boundary_integrity, create_time from t_image_resource_security
+ SELECT id,
+ dept_id,
+ platform_online,
+ property_accuracy,
+ weak_password,
+ risk_property,
+ boundary_integrity,
+ create_time
+ FROM t_image_resource_security
</sql>
- <select id="selectImageResourceSecurityList" resultMap="ImageResourceSecurityResult">
- <include refid="selectImageResourceSecurityVo"/>
+ <select id="selectImageResourceSecurityList" resultType="com.ycl.platform.domain.entity.ImageResourceSecurity">
+ select id, a.dept_id, area AS deptName, platform_online, property_accuracy, weak_password, risk_property, boundary_integrity from t_image_resource_security a
+ LEFT JOIN sys_dept b ON a.dept_id = b.dept_id AND b.del_flag = 0
<where>
- <if test="deptId != null "> and dept_id = #{deptId}</if>
- <if test="platformOnline != null "> and platform_online = #{platformOnline}</if>
- <if test="propertyAccuracy != null "> and property_accuracy = #{propertyAccuracy}</if>
- <if test="weakPassword != null "> and weak_password = #{weakPassword}</if>
- <if test="riskProperty != null "> and risk_property = #{riskProperty}</if>
- <if test="boundaryIntegrity != null "> and boundary_integrity = #{boundaryIntegrity}</if>
+ <if test="platformOnline != null ">and platform_online = #{platformOnline}</if>
+ <if test="propertyAccuracy != null ">and property_accuracy = #{propertyAccuracy}</if>
+ <if test="weakPassword != null ">and weak_password = #{weakPassword}</if>
+ <if test="riskProperty != null ">and risk_property = #{riskProperty}</if>
+ <if test="boundaryIntegrity != null ">and boundary_integrity = #{boundaryIntegrity}</if>
</where>
+ ORDER BY a.create_time DESC
+ limit 7
</select>
<select id="selectImageResourceSecurityById" resultMap="ImageResourceSecurityResult">
@@ -46,7 +56,7 @@
<if test="riskProperty != null">risk_property,</if>
<if test="boundaryIntegrity != null">boundary_integrity,</if>
<if test="createTime != null">create_time,</if>
- </trim>
+ </trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="deptId != null">#{deptId},</if>
<if test="platformOnline != null">#{platformOnline},</if>
@@ -55,7 +65,14 @@
<if test="riskProperty != null">#{riskProperty},</if>
<if test="boundaryIntegrity != null">#{boundaryIntegrity},</if>
<if test="createTime != null">#{createTime},</if>
- </trim>
+ </trim>
+ </insert>
+
+ <insert id="saveBatch">
+ insert into t_image_resource_security (dept_id, platform_online, property_accuracy, weak_password, risk_property, boundary_integrity, create_time) VALUES
+ <foreach collection="list" item="item" separator=",">
+ (#{item.deptId}, #{item.platformOnline}, #{item.propertyAccuracy}, #{item.weakPassword}, #{item.riskProperty}, #{item.boundaryIntegrity}, #{item.createTime})
+ </foreach>
</insert>
<update id="updateImageResourceSecurity">
@@ -73,7 +90,9 @@
</update>
<delete id="deleteImageResourceSecurityById">
- delete from t_image_resource_security where id = #{id}
+ DELETE
+ FROM t_image_resource_security
+ WHERE id = #{id}
</delete>
<delete id="deleteImageResourceSecurityByIds">
@@ -82,4 +101,10 @@
#{id}
</foreach>
</delete>
+ <select id="getLatest" resultType="com.ycl.platform.domain.entity.ImageResourceSecurity">
+ select * from t_image_resource_security where dept_id = #{deptId}
+ where date_format(create_time,'%Y-%m') = DATE_FORMAT(#{date}, '%Y-%m')
+ order by create_time desc
+ limit 1
+ </select>
</mapper>
--
Gitblit v1.8.0