From 5eb29a5eab52a99c22e8fee4c4df34ddb55b044c Mon Sep 17 00:00:00 2001
From: kongzy <kongzy>
Date: 星期三, 16 十月 2024 13:57:01 +0800
Subject: [PATCH] 增加题库搜索

---
 exam-system/src/main/resources/mapper/noncoalmine/ViolationRegistrationMapper.xml |   37 +++++++++++++++++++++++++++++++++++++
 1 files changed, 37 insertions(+), 0 deletions(-)

diff --git a/exam-system/src/main/resources/mapper/noncoalmine/ViolationRegistrationMapper.xml b/exam-system/src/main/resources/mapper/noncoalmine/ViolationRegistrationMapper.xml
index 23f40e9..61d86a2 100644
--- a/exam-system/src/main/resources/mapper/noncoalmine/ViolationRegistrationMapper.xml
+++ b/exam-system/src/main/resources/mapper/noncoalmine/ViolationRegistrationMapper.xml
@@ -3,5 +3,42 @@
         PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.gkhy.exam.noncoalmine.mapper.ViolationRegistrationMapper">
+    <select id="listByPage" resultType="com.gkhy.exam.noncoalmine.entity.ViolationRegistration">
+        select
+        violation_id,
+        name,
+        id_card,
+        elect_num,
+        ic_num,
+        violation_time,
+        dept,
+        operate_type_id,
+        is_cm,
+        violation_path,
+        remark,
+        del_flag,
+        create_by,
+        create_time,
+        update_by,
+        update_time
+        from violation_registration
+        where del_flag = 0
+        <if test="query.dept != null and query.dept != ''">
+            and dept like concat('%', #{query.dept}, '%')
+        </if>
+        <if test="query.name != null and query.name != ''">
+            and name like concat('%', #{query.name}, '%')
+        </if>
+        <if test="query.idCard != null and query.idCard != ''">
+            and id_card like concat('%', #{query.idCard}, '%')
+        </if>
+        <if test="query.operateTypeId != null">
+            and (operate_type_id = #{query.operateTypeId} OR operate_type_id IN ( SELECT t.id FROM sys_operate_type t WHERE find_in_set(#{query.operateTypeId}, ancestors)))
+        </if>
+        <if test="query.isCm != null">
+            and is_cm = #{query.isCm}
+        </if>
+        order by create_time desc
 
+    </select>
 </mapper>
\ No newline at end of file

--
Gitblit v1.9.2