From cc057177b2fb17aee9a173a6adbabdc578fd74c7 Mon Sep 17 00:00:00 2001
From: tangzy <tangzy123456>
Date: Mon, 06 Dec 2021 10:30:44 +0800
Subject: [PATCH] 1.许可

---
 src/main/java/org/springblade/modules/zc/mapper/ZcMapper.xml |   37 ++++++++++++++++++++++++++++++-------
 1 files changed, 30 insertions(+), 7 deletions(-)

diff --git a/src/main/java/org/springblade/modules/zc/mapper/ZcMapper.xml b/src/main/java/org/springblade/modules/zc/mapper/ZcMapper.xml
index ee58312..920efed 100644
--- a/src/main/java/org/springblade/modules/zc/mapper/ZcMapper.xml
+++ b/src/main/java/org/springblade/modules/zc/mapper/ZcMapper.xml
@@ -3,13 +3,13 @@
 <mapper namespace="org.springblade.modules.zc.mapper.ZcMapper">
 
     <!-- 通用查询映射结果 -->
-    <resultMap id="zcResultMap" type="org.springblade.modules.zc.entity.Zc">
+    <resultMap id="zcResultMap" type="org.springblade.modules.zc.vo.ZcVO">
         <id column="id" property="id"/>
         <result column="username" property="username"/>
         <result column="password" property="password"/>
         <result column="sname" property="sname"/>
         <result column="sex" property="sex"/>
-        <result column="phone" property="phone"/>
+        <result column="cardid" property="cardid"/>
         <result column="zctime" property="zctime"/>
         <result column="type" property="type"/>
         <result column="deptid" property="deptid"/>
@@ -18,17 +18,40 @@
 
 
     <select id="selectZcPage" resultMap="zcResultMap">
-        select * from act_zc where is_deleted = 0
+        SELECT
+        z.id,
+        z.username,
+        z.sname,
+        z.cardid,
+        z.type,
+        z.deptid
+        FROM
+        act_zc z where 1=1
+        <if test="zc.type!=null and zc.type!=''">
+            and z.type=#{zc.type}
+        </if>
+        <if test="zc.sname!=null and zc.sname!=''">
+            and z.sname like concat(concat('%', #{zc.sname}),'%')
+        </if>
+        <if test="zc.username!=null and zc.username!=''">
+            and z.username like concat(concat('%', #{zc.username}),'%')
+        </if>
+        <if test="zc.cardid!=null and zc.cardid!=''">
+            and z.cardid like concat(concat('%', #{zc.cardid}),'%')
+        </if>
     </select>
 
 
     <!--注册新增-->
-   <insert id="inster">
-       insert  into act_zc(username,password,sname,sex,phone,zctime,deptid) values(#{username},#{password},#{sname},#{sex},#{phone},#{zctime},#{deptid})
-   </insert>
+    <insert id="inster">
+        insert into act_zc(username, password, sname, cardid, zctime, deptid)
+        values (#{username}, #{password}, #{sname}, #{cardid}, #{zctime}, #{deptid})
+    </insert>
 
     <select id="selectType" resultType="String">
-        select type from act_zc where username=#{param1}
+        select type
+        from act_zc
+        where username = #{param1}
     </select>
 
 </mapper>

--
Gitblit v1.9.3