Просмотр исходного кода

fix-[xmg二期]:xml新增修改判断值是否为空,后台列表分页

seeseele 7 месяцев назад
Родитель
Сommit
75a6c93dd4
20 измененных файлов с 443 добавлено и 323 удалено
  1. 10 0
      src/main/java/com/ruoyi/project/VRdemo/controller/ArchivesUnboundController.java
  2. 10 0
      src/main/java/com/ruoyi/project/VRdemo/controller/ConsultationController.java
  3. 10 0
      src/main/java/com/ruoyi/project/VRdemo/controller/EconomyController.java
  4. 10 0
      src/main/java/com/ruoyi/project/VRdemo/controller/InstitutionController.java
  5. 15 1
      src/main/java/com/ruoyi/project/VRdemo/controller/LiteratureController.java
  6. 2 3
      src/main/java/com/ruoyi/project/VRdemo/controller/PressController.java
  7. 10 0
      src/main/java/com/ruoyi/project/VRdemo/controller/PublicationController.java
  8. 10 0
      src/main/java/com/ruoyi/project/VRdemo/controller/ResearchController.java
  9. 11 0
      src/main/java/com/ruoyi/project/VRdemo/controller/SpecialCollectionController.java
  10. 3 4
      src/main/java/com/ruoyi/project/VRdemo/controller/ThesisController.java
  11. 26 26
      src/main/resources/mybatis/VRdemo/ArchivesUnboundMapper.xml
  12. 34 34
      src/main/resources/mybatis/VRdemo/ConsultationMapper.xml
  13. 34 34
      src/main/resources/mybatis/VRdemo/EconomyMapper.xml
  14. 36 36
      src/main/resources/mybatis/VRdemo/InstitutionMapper.xml
  15. 51 41
      src/main/resources/mybatis/VRdemo/LiteratureMapper.xml
  16. 47 44
      src/main/resources/mybatis/VRdemo/PressMapper.xml
  17. 32 32
      src/main/resources/mybatis/VRdemo/PublicationMapper.xml
  18. 29 17
      src/main/resources/mybatis/VRdemo/ResearchMapper.xml
  19. 25 25
      src/main/resources/mybatis/VRdemo/SpecialCollectionMapper.xml
  20. 38 26
      src/main/resources/mybatis/VRdemo/ThesisMapper.xml

+ 10 - 0
src/main/java/com/ruoyi/project/VRdemo/controller/ArchivesUnboundController.java

@@ -61,6 +61,16 @@ public class ArchivesUnboundController extends BaseController {
     }
 
     /**
+     * 查询分页列表
+     */
+    @GetMapping("/pageList")
+    public TableDataInfo pageList(ArchivesUnbound archivesUnbound) {
+        startPage();
+        List<ArchivesUnbound> list = archivesUnboundService.selectArchivesUnboundList(archivesUnbound);
+        return getDataTable(list);
+    }
+
+    /**
      * 获取博雅集 Archives Unbound(Gale)详细信息
      */
     @PreAuthorize("@ss.hasPermi('VRdemo:ArchivesUnbound:query')")

+ 10 - 0
src/main/java/com/ruoyi/project/VRdemo/controller/ConsultationController.java

@@ -61,6 +61,16 @@ public class ConsultationController extends BaseController {
     }
 
     /**
+     * 查询分页列表
+     */
+    @GetMapping("/pageList")
+    public TableDataInfo pageList(Consultation consultation) {
+        startPage();
+        List<Consultation> list = consultationService.selectConsultationList(consultation);
+        return getDataTable(list);
+    }
+
+    /**
      * 获取博雅集南洋资讯检索详细信息
      */
     @Anonymous

+ 10 - 0
src/main/java/com/ruoyi/project/VRdemo/controller/EconomyController.java

@@ -62,6 +62,16 @@ public class EconomyController extends BaseController {
     }
 
     /**
+     * 查询分页列表
+     */
+    @GetMapping("/pageList")
+    public TableDataInfo pageList(Economy economy) {
+        startPage();
+        List<Economy> list = economyService.selectEconomyList(economy);
+        return getDataTable(list);
+    }
+
+    /**
      * 获取东南亚经济统计详细信息
      */
     @PreAuthorize("@ss.hasPermi('VRdemo:economy:query')")

+ 10 - 0
src/main/java/com/ruoyi/project/VRdemo/controller/InstitutionController.java

@@ -61,6 +61,16 @@ public class InstitutionController extends BaseController {
     }
 
     /**
+     * 查询分页列表
+     */
+    @GetMapping("/pageList")
+    public TableDataInfo pageList(Institution institution) {
+        startPage();
+        List<Institution> list = institutionService.selectInstitutionList(institution);
+        return getDataTable(list);
+    }
+
+    /**
      * 获取博雅集东南亚研究机构详细信息
      */
     @Anonymous

+ 15 - 1
src/main/java/com/ruoyi/project/VRdemo/controller/LiteratureController.java

@@ -50,7 +50,21 @@ public class LiteratureController extends BaseController {
      */
     @Anonymous
     @GetMapping("/list")
-    public TableDataInfo list(Literature literature) {
+    public AjaxResult list(Literature literature) {
+        List<Literature> list = literatureService.selectLiteratureList(literature);
+
+        AjaxResult ajaxResult = new AjaxResult();
+        ajaxResult.put("code", 200);
+        ajaxResult.put("rows", list);
+        ajaxResult.put("total", list.size());
+        return ajaxResult;
+    }
+
+    /**
+     * 查询分页列表
+     */
+    @GetMapping("/pageList")
+    public TableDataInfo pageList(Literature literature) {
         startPage();
         List<Literature> list = literatureService.selectLiteratureList(literature);
         return getDataTable(list);

+ 2 - 3
src/main/java/com/ruoyi/project/VRdemo/controller/PressController.java

@@ -64,9 +64,8 @@ public class PressController extends BaseController {
     /**
      * 查询论文列表
      */
-    @PreAuthorize("@ss.hasPermi('VRdemo:thesis:list')")
-    @GetMapping("/allList")
-    public TableDataInfo allList(Press press) {
+    @GetMapping("/pageList")
+    public TableDataInfo pageList(Press press) {
         startPage();
         List<Press> list = pressService.selectPressList(press);
         return getDataTable(list);

+ 10 - 0
src/main/java/com/ruoyi/project/VRdemo/controller/PublicationController.java

@@ -61,6 +61,16 @@ public class PublicationController extends BaseController {
     }
 
     /**
+     * 查询分页列表
+     */
+    @GetMapping("/pageList")
+    public TableDataInfo pageList(Publication publication) {
+        startPage();
+        List<Publication> list = publicationService.selectPublicationList(publication);
+        return getDataTable(list);
+    }
+
+    /**
      * 获取东南亚连续出版物详细信息
      */
     @PreAuthorize("@ss.hasPermi('VRdemo:publication:query')")

+ 10 - 0
src/main/java/com/ruoyi/project/VRdemo/controller/ResearchController.java

@@ -62,6 +62,16 @@ public class ResearchController extends BaseController {
     }
 
     /**
+     * 查询分页列表
+     */
+    @GetMapping("/pageList")
+    public TableDataInfo pageList(Research research) {
+        startPage();
+        List<Research> list = researchService.selectResearchList(research);
+        return getDataTable(list);
+    }
+
+    /**
      * 查询论文列表
      */
     @PreAuthorize("@ss.hasPermi('VRdemo:thesis:list')")

+ 11 - 0
src/main/java/com/ruoyi/project/VRdemo/controller/SpecialCollectionController.java

@@ -8,6 +8,7 @@ import javax.servlet.http.HttpServletResponse;
 import com.alibaba.excel.EasyExcel;
 import com.ruoyi.common.utils.excel.ExcelReadUtil;
 import com.ruoyi.framework.aspectj.lang.annotation.Anonymous;
+import com.ruoyi.framework.web.page.TableDataInfo;
 import com.ruoyi.project.VRdemo.domain.SpecialCollection;
 import com.ruoyi.project.VRdemo.domain.imData.SpecialCollectionImData;
 import org.springframework.security.access.prepost.PreAuthorize;
@@ -60,6 +61,16 @@ public class SpecialCollectionController extends BaseController {
     }
 
     /**
+     * 查询分页列表
+     */
+    @GetMapping("/pageList")
+    public TableDataInfo pageList(SpecialCollection specialCollection) {
+        startPage();
+        List<SpecialCollection> list = collectionService.selectCollectionList(specialCollection);
+        return getDataTable(list);
+    }
+
+    /**
      * 获取东南亚大型特藏详细信息
      */
     @PreAuthorize("@ss.hasPermi('VRdemo:collection:query')")

+ 3 - 4
src/main/java/com/ruoyi/project/VRdemo/controller/ThesisController.java

@@ -61,11 +61,10 @@ public class ThesisController extends BaseController {
     }
 
     /**
-     * 查询论文列表
+     * 查询分页列表
      */
-    @PreAuthorize("@ss.hasPermi('VRdemo:thesis:list')")
-    @GetMapping("/allList")
-    public TableDataInfo allList(Thesis thesis) {
+    @GetMapping("/pageList")
+    public TableDataInfo pageList(Thesis thesis) {
         startPage();
         List<Thesis> list = thesisService.selectThesisList(thesis);
         return getDataTable(list);

+ 26 - 26
src/main/resources/mybatis/VRdemo/ArchivesUnboundMapper.xml

@@ -25,8 +25,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <where>  
             <if test="englishName != null  and englishName != ''"> and english_name like concat('%', #{englishName}, '%')</if>
             <if test="chineseName != null  and chineseName != ''"> and chinese_name like concat('%', #{chineseName}, '%')</if>
-            <if test="introduce != null  and introduce != ''"> and introduce = #{introduce}</if>
-            <if test="link != null  and link != ''"> and link = #{link}</if>
+            <if test="introduce != null  and introduce != ''"> and introduce like concat('%', #{introduce}, '%')</if>
+            <if test="link != null  and link != ''"> and link like concat('%', #{link}, '%')</if>
         </where>
     </select>
     
@@ -43,24 +43,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <insert id="insertArchivesUnbound" parameterType="ArchivesUnbound" useGeneratedKeys="true" keyProperty="id">
         insert into vr_archives_unbound
         <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="englishName != null">english_name,</if>
-            <if test="chineseName != null">chinese_name,</if>
-            <if test="introduce != null">introduce,</if>
-            <if test="link != null">link,</if>
-            <if test="createTime != null">create_time,</if>
-            <if test="createBy != null">create_by,</if>
-            <if test="updateTime != null">update_time,</if>
-            <if test="updateBy != null">update_by,</if>
+            <if test="englishName != null and englishName != ''">english_name,</if>
+            <if test="chineseName != null and chineseName != ''">chinese_name,</if>
+            <if test="introduce != null and introduce != ''">introduce,</if>
+            <if test="link != null and link != ''">link,</if>
+            <if test="createBy != null and createBy != ''">create_by,</if>
+            <if test="createTime != null ">create_time,</if>
+            <if test="updateBy != null and updateBy != ''">update_by,</if>
+            <if test="updateTime != null ">update_time,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
-            <if test="englishName != null">#{englishName},</if>
-            <if test="chineseName != null">#{chineseName},</if>
-            <if test="introduce != null">#{introduce},</if>
-            <if test="link != null">#{link},</if>
-            <if test="createTime != null">#{createTime},</if>
-            <if test="createBy != null">#{createBy},</if>
-            <if test="updateTime != null">#{updateTime},</if>
-            <if test="updateBy != null">#{updateBy},</if>
+            <if test="englishName != null and englishName != ''">#{englishName},</if>
+            <if test="chineseName != null and chineseName != ''">#{chineseName},</if>
+            <if test="introduce != null and introduce != ''">#{introduce},</if>
+            <if test="link != null and link != ''">#{link},</if>
+            <if test="createBy != null and createBy != ''">#{createBy},</if>
+            <if test="createTime != null ">#{createTime},</if>
+            <if test="updateBy != null and updateBy != ''">#{updateBy},</if>
+            <if test="updateTime != null ">#{updateTime},</if>
          </trim>
     </insert>
 
@@ -75,14 +75,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <update id="updateArchivesUnbound" parameterType="ArchivesUnbound">
         update vr_archives_unbound
         <trim prefix="SET" suffixOverrides=",">
-            <if test="englishName != null">english_name = #{englishName},</if>
-            <if test="chineseName != null">chinese_name = #{chineseName},</if>
-            <if test="introduce != null">introduce = #{introduce},</if>
-            <if test="link != null">link = #{link},</if>
-            <if test="createTime != null">create_time = #{createTime},</if>
-            <if test="createBy != null">create_by = #{createBy},</if>
-            <if test="updateTime != null">update_time = #{updateTime},</if>
-            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="englishName != null and englishName != ''">english_name = #{englishName},</if>
+            <if test="chineseName != null and chineseName != ''">chinese_name = #{chineseName},</if>
+            <if test="introduce != null and introduce != ''">introduce = #{introduce},</if>
+            <if test="link != null and link != ''">link = #{link},</if>
+            <if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
+            <if test="createTime != null ">create_time = #{createTime},</if>
+            <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
+            <if test="updateTime != null ">update_time = #{updateTime},</if>
         </trim>
         where id = #{id}
     </update>

+ 34 - 34
src/main/resources/mybatis/VRdemo/ConsultationMapper.xml

@@ -25,12 +25,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <select id="selectConsultationList" parameterType="Consultation" resultMap="ConsultationResult">
         <include refid="selectConsultationVo"/>
         <where>
-            <if test="affiliation != null  and affiliation != ''">and affiliation = #{affiliation}</if>
-            <if test="location != null  and location != ''">and location = #{location}</if>
+            <if test="affiliation != null  and affiliation != ''"> and affiliation like concat('%', #{affiliation}, '%')</if>
+            <if test="location != null  and location != ''"> and location like concat('%', #{location}, '%')</if>
             <if test="chineseName != null  and chineseName != ''"> and chinese_name like concat('%', #{chineseName}, '%')</if>
             <if test="englishName != null  and englishName != ''"> and english_name like concat('%', #{englishName}, '%')</if>
-            <if test="link != null  and link != ''"> and link = #{link}</if>
-            <if test="introduce != null  and introduce != ''"> and introduce = #{introduce}</if>
+            <if test="link != null  and link != ''"> and link like concat('%', #{link}, '%')</if>
+            <if test="introduce != null  and introduce != ''"> and introduce like concat('%', #{introduce}, '%')</if>
         </where>
     </select>
     
@@ -47,28 +47,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <insert id="insertConsultation" parameterType="Consultation" useGeneratedKeys="true" keyProperty="id">
         insert into vr_consultation
         <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="affiliation != null">affiliation,</if>
-            <if test="location != null">location,</if>
-            <if test="chineseName != null">chinese_name,</if>
-            <if test="englishName != null">english_name,</if>
-            <if test="link != null">link,</if>
-            <if test="introduce != null">introduce,</if>
-            <if test="createTime != null">create_time,</if>
-            <if test="createBy != null">create_by,</if>
-            <if test="updateTime != null">update_time,</if>
-            <if test="updateBy != null">update_by,</if>
+            <if test="affiliation != null and affiliation != ''">affiliation,</if>
+            <if test="location != null and location != ''">location,</if>
+            <if test="englishName != null and englishName != ''">english_name,</if>
+            <if test="chineseName != null and chineseName != ''">chinese_name,</if>
+            <if test="introduce != null and introduce != ''">introduce,</if>
+            <if test="link != null and link != ''">link,</if>
+            <if test="createBy != null and createBy != ''">create_by,</if>
+            <if test="createTime != null ">create_time,</if>
+            <if test="updateBy != null and updateBy != ''">update_by,</if>
+            <if test="updateTime != null ">update_time,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
-            <if test="affiliation != null">#{affiliation},</if>
-            <if test="location != null">#{location},</if>
-            <if test="chineseName != null">#{chineseName},</if>
-            <if test="englishName != null">#{englishName},</if>
-            <if test="link != null">#{link},</if>
-            <if test="introduce != null">#{introduce},</if>
-            <if test="createTime != null">#{createTime},</if>
-            <if test="createBy != null">#{createBy},</if>
-            <if test="updateTime != null">#{updateTime},</if>
-            <if test="updateBy != null">#{updateBy},</if>
+            <if test="affiliation != null and affiliation != ''">#{affiliation},</if>
+            <if test="location != null and location != ''">#{location},</if>
+            <if test="englishName != null and englishName != ''">#{englishName},</if>
+            <if test="chineseName != null and chineseName != ''">#{chineseName},</if>
+            <if test="introduce != null and introduce != ''">#{introduce},</if>
+            <if test="link != null and link != ''">#{link},</if>
+            <if test="createBy != null and createBy != ''">#{createBy},</if>
+            <if test="createTime != null ">#{createTime},</if>
+            <if test="updateBy != null and updateBy != ''">#{updateBy},</if>
+            <if test="updateTime != null ">#{updateTime},</if>
          </trim>
     </insert>
 
@@ -84,16 +84,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <update id="updateConsultation" parameterType="Consultation">
         update vr_consultation
         <trim prefix="SET" suffixOverrides=",">
-            <if test="affiliation != null">affiliation = #{affiliation},</if>
-            <if test="location != null">location = #{location},</if>
-            <if test="chineseName != null">chinese_name = #{chineseName},</if>
-            <if test="englishName != null">english_name = #{englishName},</if>
-            <if test="link != null">link = #{link},</if>
-            <if test="introduce != null">introduce = #{introduce},</if>
-            <if test="createTime != null">create_time = #{createTime},</if>
-            <if test="createBy != null">create_by = #{createBy},</if>
-            <if test="updateTime != null">update_time = #{updateTime},</if>
-            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="affiliation != null and affiliation != ''">affiliation = #{affiliation},</if>
+            <if test="location != null and location != ''">location = #{location},</if>
+            <if test="englishName != null and englishName != ''">english_name = #{englishName},</if>
+            <if test="chineseName != null and chineseName != ''">chinese_name = #{chineseName},</if>
+            <if test="introduce != null and introduce != ''">introduce = #{introduce},</if>
+            <if test="link != null and link != ''">link = #{link},</if>
+            <if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
+            <if test="createTime != null ">create_time = #{createTime},</if>
+            <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
+            <if test="updateTime != null ">update_time = #{updateTime},</if>
         </trim>
         where id = #{id}
     </update>

+ 34 - 34
src/main/resources/mybatis/VRdemo/EconomyMapper.xml

@@ -24,11 +24,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <select id="selectEconomyList" parameterType="Economy" resultMap="EconomyResult">
         <include refid="selectEconomyVo"/>
         <where>  
-            <if test="affiliation != null  and affiliation != ''"> and affiliation = #{affiliation}</if>
-            <if test="location != null  and location != ''"> and location = #{location}</if>
-            <if test="title != null  and title != ''"> and title = #{title}</if>
-            <if test="link != null  and link != ''"> and link = #{link}</if>
-            <if test="introduce != null  and introduce != ''"> and introduce = #{introduce}</if>
+            <if test="affiliation != null  and affiliation != ''"> and affiliation like concat('%', #{affiliation}, '%')</if>
+            <if test="location != null  and location != ''"> and location like concat('%', #{location}, '%')</if>
+            <if test="title != null  and title != ''"> and title like concat('%', #{title}, '%')</if>
+            <if test="link != null  and link != ''"> and link like concat('%', #{link}, '%')</if>
+            <if test="introduce != null  and introduce != ''"> and introduce like concat('%', #{introduce}, '%')</if>
         </where>
     </select>
     
@@ -45,27 +45,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <insert id="insertEconomy" parameterType="Economy" useGeneratedKeys="true" keyProperty="id">
         insert into vr_economy
         <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="affiliation != null">affiliation,</if>
-            <if test="location != null">location,</if>
-            <if test="title != null">title,</if>
-            <if test="link != null">link,</if>
-            <if test="introduce != null">introduce,</if>
-            <if test="createBy != null">create_by,</if>
-            <if test="createTime != null">create_time,</if>
-            <if test="updateBy != null">update_by,</if>
-            <if test="updateTime != null">update_time,</if>
-         </trim>
+            <if test="affiliation != null and affiliation != ''">affiliation,</if>
+            <if test="location != null and location != ''">location,</if>
+            <if test="title != null and title != ''">title,</if>
+            <if test="introduce != null and introduce != ''">introduce,</if>
+            <if test="link != null and link != ''">link,</if>
+            <if test="createBy != null and createBy != ''">create_by,</if>
+            <if test="createTime != null ">create_time,</if>
+            <if test="updateBy != null and updateBy != ''">update_by,</if>
+            <if test="updateTime != null ">update_time,</if>
+        </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
-            <if test="affiliation != null">#{affiliation},</if>
-            <if test="location != null">#{location},</if>
-            <if test="title != null">#{title},</if>
-            <if test="link != null">#{link},</if>
-            <if test="introduce != null">#{introduce},</if>
-            <if test="createBy != null">#{createBy},</if>
-            <if test="createTime != null">#{createTime},</if>
-            <if test="updateBy != null">#{updateBy},</if>
-            <if test="updateTime != null">#{updateTime},</if>
-         </trim>
+            <if test="affiliation != null and affiliation != ''">#{affiliation},</if>
+            <if test="location != null and location != ''">#{location},</if>
+            <if test="title != null and title != ''">#{title},</if>
+            <if test="introduce != null and introduce != ''">#{introduce},</if>
+            <if test="link != null and link != ''">#{link},</if>
+            <if test="createBy != null and createBy != ''">#{createBy},</if>
+            <if test="createTime != null ">#{createTime},</if>
+            <if test="updateBy != null and updateBy != ''">#{updateBy},</if>
+            <if test="updateTime != null ">#{updateTime},</if>
+        </trim>
     </insert>
 
     <insert id="insertEconomyDataList" parameterType="java.util.List">
@@ -80,15 +80,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <update id="updateEconomy" parameterType="Economy">
         update vr_economy
         <trim prefix="SET" suffixOverrides=",">
-            <if test="affiliation != null">affiliation = #{affiliation},</if>
-            <if test="location != null">location = #{location},</if>
-            <if test="title != null">title = #{title},</if>
-            <if test="link != null">link = #{link},</if>
-            <if test="introduce != null">introduce = #{introduce},</if>
-            <if test="createBy != null">create_by = #{createBy},</if>
-            <if test="createTime != null">create_time = #{createTime},</if>
-            <if test="updateBy != null">update_by = #{updateBy},</if>
-            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="affiliation != null and affiliation != ''">affiliation = #{affiliation},</if>
+            <if test="location != null and location != ''">location = #{location},</if>
+            <if test="title != null and title != ''">title = #{title},</if>
+            <if test="introduce != null and introduce != ''">introduce = #{introduce},</if>
+            <if test="link != null and link != ''">link = #{link},</if>
+            <if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
+            <if test="createTime != null ">create_time = #{createTime},</if>
+            <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
+            <if test="updateTime != null ">update_time = #{updateTime},</if>
         </trim>
         where id = #{id}
     </update>

+ 36 - 36
src/main/resources/mybatis/VRdemo/InstitutionMapper.xml

@@ -25,12 +25,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <select id="selectInstitutionList" parameterType="Institution" resultMap="InstitutionResult">
         <include refid="selectInstitutionVo"/>
         <where>
-            <if test="affiliation != null  and affiliation != ''">and affiliation = #{affiliation}</if>
-            <if test="location != null  and location != ''">and location = #{location}</if>
+            <if test="affiliation != null  and affiliation != ''"> and affiliation like concat('%', #{affiliation}, '%')</if>
+            <if test="location != null  and location != ''"> and location like concat('%', #{location}, '%')</if>
             <if test="chineseName != null  and chineseName != ''"> and chinese_name like concat('%', #{chineseName}, '%')</if>
             <if test="englishName != null  and englishName != ''"> and english_name like concat('%', #{englishName}, '%')</if>
-            <if test="link != null  and link != ''"> and link = #{link}</if>
-            <if test="introduce != null  and introduce != ''"> and introduce = #{introduce}</if>
+            <if test="link != null  and link != ''"> and link like concat('%', #{link}, '%')</if>
+            <if test="introduce != null  and introduce != ''"> and introduce like concat('%', #{introduce}, '%')</if>
         </where>
     </select>
     
@@ -47,29 +47,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <insert id="insertInstitution" parameterType="Institution" useGeneratedKeys="true" keyProperty="id">
         insert into vr_institution
         <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="affiliation != null">affiliation,</if>
-            <if test="location != null">location,</if>
-            <if test="chineseName != null">chinese_name,</if>
-            <if test="englishName != null">english_name,</if>
-            <if test="link != null">link,</if>
-            <if test="introduce != null">introduce,</if>
-            <if test="createTime != null">create_time,</if>
-            <if test="createBy != null">create_by,</if>
-            <if test="updateTime != null">update_time,</if>
-            <if test="updateBy != null">update_by,</if>
-         </trim>
+            <if test="affiliation != null and affiliation != ''">affiliation,</if>
+            <if test="location != null and location != ''">location,</if>
+            <if test="englishName != null and englishName != ''">english_name,</if>
+            <if test="chineseName != null and chineseName != ''">chinese_name,</if>
+            <if test="introduce != null and introduce != ''">introduce,</if>
+            <if test="link != null and link != ''">link,</if>
+            <if test="createBy != null and createBy != ''">create_by,</if>
+            <if test="createTime != null ">create_time,</if>
+            <if test="updateBy != null and updateBy != ''">update_by,</if>
+            <if test="updateTime != null ">update_time,</if>
+        </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
-            <if test="affiliation != null">#{affiliation},</if>
-            <if test="location != null">#{location},</if>
-            <if test="chineseName != null">#{chineseName},</if>
-            <if test="englishName != null">#{englishName},</if>
-            <if test="link != null">#{link},</if>
-            <if test="introduce != null">#{introduce},</if>
-            <if test="createTime != null">#{createTime},</if>
-            <if test="createBy != null">#{createBy},</if>
-            <if test="updateTime != null">#{updateTime},</if>
-            <if test="updateBy != null">#{updateBy},</if>
-         </trim>
+            <if test="affiliation != null and affiliation != ''">#{affiliation},</if>
+            <if test="location != null and location != ''">#{location},</if>
+            <if test="englishName != null and englishName != ''">#{englishName},</if>
+            <if test="chineseName != null and chineseName != ''">#{chineseName},</if>
+            <if test="introduce != null and introduce != ''">#{introduce},</if>
+            <if test="link != null and link != ''">#{link},</if>
+            <if test="createBy != null and createBy != ''">#{createBy},</if>
+            <if test="createTime != null ">#{createTime},</if>
+            <if test="updateBy != null and updateBy != ''">#{updateBy},</if>
+            <if test="updateTime != null ">#{updateTime},</if>
+        </trim>
     </insert>
 
     <insert id="insertInstitutionDataList" parameterType="java.util.List">
@@ -83,16 +83,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <update id="updateInstitution" parameterType="Institution">
         update vr_institution
         <trim prefix="SET" suffixOverrides=",">
-            <if test="affiliation != null">affiliation = #{affiliation},</if>
-            <if test="location != null">location = #{location},</if>
-            <if test="chineseName != null">chinese_name = #{chineseName},</if>
-            <if test="englishName != null">english_name = #{englishName},</if>
-            <if test="link != null">link = #{link},</if>
-            <if test="introduce != null">introduce = #{introduce},</if>
-            <if test="createTime != null">create_time = #{createTime},</if>
-            <if test="createBy != null">create_by = #{createBy},</if>
-            <if test="updateTime != null">update_time = #{updateTime},</if>
-            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="affiliation != null and affiliation != ''">affiliation = #{affiliation},</if>
+            <if test="location != null and location != ''">location = #{location},</if>
+            <if test="englishName != null and englishName != ''">english_name = #{englishName},</if>
+            <if test="chineseName != null and chineseName != ''">chinese_name = #{chineseName},</if>
+            <if test="introduce != null and introduce != ''">introduce = #{introduce},</if>
+            <if test="link != null and link != ''">link = #{link},</if>
+            <if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
+            <if test="createTime != null ">create_time = #{createTime},</if>
+            <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
+            <if test="updateTime != null ">update_time = #{updateTime},</if>
         </trim>
         where id = #{id}
     </update>

+ 51 - 41
src/main/resources/mybatis/VRdemo/LiteratureMapper.xml

@@ -1,33 +1,41 @@
 <?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.ruoyi.project.VRdemo.mapper.LiteratureMapper">
-    
+
     <resultMap type="Literature" id="LiteratureResult">
-        <result property="id"    column="id"    />
-        <result property="title"    column="title"    />
-        <result property="url"    column="url"    />
-        <result property="publicationTime"    column="publication_time"    />
-        <result property="createTime"    column="create_time"    />
-        <result property="createBy"    column="create_by"    />
-        <result property="updateTime"    column="update_time"    />
-        <result property="updateBy"    column="update_by"    />
+        <result property="id" column="id"/>
+        <result property="title" column="title"/>
+        <result property="url" column="url"/>
+        <result property="publicationTime" column="publication_time"/>
+        <result property="createTime" column="create_time"/>
+        <result property="createBy" column="create_by"/>
+        <result property="updateTime" column="update_time"/>
+        <result property="updateBy" column="update_by"/>
     </resultMap>
 
     <sql id="selectLiteratureVo">
-        select id, title, url, publication_time, create_time, create_by, update_time, update_by from vr_literature
+        select id,
+               title,
+               url,
+               publication_time,
+               create_time,
+               create_by,
+               update_time,
+               update_by
+        from vr_literature
     </sql>
 
     <select id="selectLiteratureList" parameterType="Literature" resultMap="LiteratureResult">
         <include refid="selectLiteratureVo"/>
-        <where>  
-            <if test="title != null  and title != ''"> and title = #{title}</if>
-            <if test="url != null  and url != ''"> and url = #{url}</if>
-            <if test="publicationTime != null "> and publication_time = #{publicationTime}</if>
+        <where>
+            <if test="title != null  and title != ''"> and title like concat('%', #{title}, '%')</if>
+            <if test="url != null  and url != ''">and url like concat('%', #{url}, '%')</if>
+            <if test="publicationTime != null and publicationTime != ''">and publication_time = #{publicationTime}</if>
         </where>
     </select>
-    
+
     <select id="selectLiteratureById" parameterType="Long" resultMap="LiteratureResult">
         <include refid="selectLiteratureVo"/>
         where id = #{id}
@@ -37,26 +45,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <include refid="selectLiteratureVo"/>
         WHERE title = #{titleAsLong}
     </select>
-        
+
     <insert id="insertLiterature" parameterType="Literature" useGeneratedKeys="true" keyProperty="id">
         insert into vr_literature
         <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="title != null">title,</if>
-            <if test="url != null">url,</if>
-            <if test="publicationTime != null">publication_time,</if>
-            <if test="createTime != null">create_time,</if>
-            <if test="createBy != null">create_by,</if>
-            <if test="updateTime != null">update_time,</if>
-            <if test="updateBy != null">update_by,</if>
+            <if test="title != null and title != ''">title,</if>
+            <if test="url != null and url != ''">url,</if>
+            <if test="publicationTime != null and publicationTime != ''">publication_time,</if>
+            <if test="createBy != null and createBy != ''">create_by,</if>
+            <if test="createTime != null ">create_time,</if>
+            <if test="updateBy != null and updateBy != ''">update_by,</if>
+            <if test="updateTime != null ">update_time,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
-            <if test="title != null">#{title},</if>
-            <if test="url != null">#{url},</if>
-            <if test="publicationTime != null">#{publicationTime},</if>
-            <if test="createTime != null">#{createTime},</if>
-            <if test="createBy != null">#{createBy},</if>
-            <if test="updateTime != null">#{updateTime},</if>
-            <if test="updateBy != null">#{updateBy},</if>
+            <if test="title != null and title != ''">#{title},</if>
+            <if test="url != null and url != ''">#{url},</if>
+            <if test="publicationTime != null and publicationTime != ''">#{publicationTime},</if>
+            <if test="createBy != null and createBy != ''">#{createBy},</if>
+            <if test="createTime != null ">#{createTime},</if>
+            <if test="updateBy != null and updateBy != ''">#{updateBy},</if>
+            <if test="updateTime != null ">#{updateTime},</if>
         </trim>
     </insert>
 
@@ -71,23 +79,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <update id="updateLiterature" parameterType="Literature">
         update vr_literature
         <trim prefix="SET" suffixOverrides=",">
-            <if test="title != null">title = #{title},</if>
-            <if test="url != null">url = #{url},</if>
-            <if test="publicationTime != null">publication_time = #{publicationTime},</if>
-            <if test="createTime != null">create_time = #{createTime},</if>
-            <if test="createBy != null">create_by = #{createBy},</if>
-            <if test="updateTime != null">update_time = #{updateTime},</if>
-            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="title != null and title != ''">title = #{title},</if>
+            <if test="url != null and url != ''">url = #{url},</if>
+            <if test="publicationTime != null and publicationTime != ''">publication_time = #{publicationTime},</if>
+            <if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
+            <if test="createTime != null ">create_time = #{createTime},</if>
+            <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
+            <if test="updateTime != null ">update_time = #{updateTime},</if>
         </trim>
         where id = #{id}
     </update>
 
     <delete id="deleteLiteratureById" parameterType="Long">
-        delete from vr_literature where id = #{id}
+        delete
+        from vr_literature
+        where id = #{id}
     </delete>
 
     <delete id="deleteLiteratureByIds" parameterType="String">
-        delete from vr_literature where id in 
+        delete from vr_literature where id in
         <foreach item="id" collection="array" open="(" separator="," close=")">
             #{id}
         </foreach>

+ 47 - 44
src/main/resources/mybatis/VRdemo/PressMapper.xml

@@ -40,14 +40,14 @@
     <select id="selectPressList" parameterType="Press" resultMap="PressResult">
         <include refid="selectPressVo"/>
         <where>
-            <if test="title != null  and title != ''">and title = #{title}</if>
-            <if test="author != null  and author != ''">and author = #{author}</if>
-            <if test="pressTitle != null  and pressTitle != ''">and press_title = #{pressTitle}</if>
-            <if test="issue != null ">and issue = #{issue}</if>
-            <if test="pages != null  and pages != ''">and pages = #{pages}</if>
-            <if test="keyword != null  and keyword != ''">and keyword = #{keyword}</if>
-            <if test="classify != null  and classify != ''">and classify = #{classify}</if>
-            <if test="area != null  and area != ''">and area = #{area}</if>
+            <if test="title != null  and title != ''"> and title like concat('%', #{title}, '%')</if>
+            <if test="author != null  and author != ''">and author like concat('%', #{author}, '%')</if>
+            <if test="pressTitle != null  and pressTitle != ''">and press_title like concat('%', #{pressTitle}, '%')</if>
+            <if test="issue != null and issue != ''">and issue like concat('%', #{issue}, '%')</if>
+            <if test="pages != null  and pages != ''">and pages like concat('%', #{pages}, '%')</if>
+            <if test="keyword != null  and keyword != ''">and keyword like concat('%', #{keyword}, '%')</if>
+            <if test="classify != null  and classify != ''">and classify like concat('%', #{classify}, '%')</if>
+            <if test="area != null  and area != ''">and area like concat('%', #{area}, '%')</if>
         </where>
     </select>
 
@@ -64,32 +64,34 @@
     <insert id="insertPress" parameterType="Press" useGeneratedKeys="true" keyProperty="pressId">
         insert into vr_press
         <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="title != null">title,</if>
-            <if test="author != null">author,</if>
-            <if test="pressTitle != null">press_title,</if>
-            <if test="issue != null">issue,</if>
-            <if test="pages != null">pages,</if>
-            <if test="keyword != null">keyword,</if>
-            <if test="classify != null">classify,</if>
-            <if test="area != null">area,</if>
-            <if test="createBy != null">create_by,</if>
-            <if test="createTime != null">create_time,</if>
-            <if test="updateBy != null">update_by,</if>
-            <if test="updateTime != null">update_time,</if>
+            <if test="title != null and title != ''">title,</if>
+            <if test="author != null and author != ''">author,</if>
+            <if test="pressTitle != null  and pressTitle != ''">press_title,</if>
+            <if test="date != null and date != ''">date,</if>
+            <if test="issue != null and issue != ''">issue,</if>
+            <if test="pages != null and pages != ''">pages,</if>
+            <if test="keyword != null and keyword != ''">keyword,</if>
+            <if test="classify != null and classify != ''">classify,</if>
+            <if test="area != null and area != ''">area,</if>
+            <if test="createBy != null and createBy != ''">create_by,</if>
+            <if test="createTime != null ">create_time,</if>
+            <if test="updateBy != null and updateBy != ''">update_by,</if>
+            <if test="updateTime != null ">update_time,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
-            <if test="title != null">#{title},</if>
-            <if test="author != null">#{author},</if>
-            <if test="pressTitle != null">#{pressTitle},</if>
-            <if test="issue != null">#{issue},</if>
-            <if test="pages != null">#{pages},</if>
-            <if test="keyword != null">#{keyword},</if>
-            <if test="classify != null">#{classify},</if>
-            <if test="area != null">#{area},</if>
-            <if test="createBy != null">#{createBy},</if>
-            <if test="createTime != null">#{createTime},</if>
-            <if test="updateBy != null">#{updateBy},</if>
-            <if test="updateTime != null">#{updateTime},</if>
+            <if test="title != null and title != ''">#{title},</if>
+            <if test="author != null and author != ''">#{author},</if>
+            <if test="pressTitle != null and pressTitle != ''">#{pressTitle},</if>
+            <if test="date != null and date != ''">#{date},</if>
+            <if test="issue != null and issue != ''">#{issue},</if>
+            <if test="pages != null and pages != ''">#{pages},</if>
+            <if test="keyword != null and keyword != ''">#{keyword},</if>
+            <if test="classify != null and classify != ''">#{classify},</if>
+            <if test="area != null and area != ''">#{area},</if>
+            <if test="createBy != null and createBy != ''">#{createBy},</if>
+            <if test="createTime != null ">#{createTime},</if>
+            <if test="updateBy != null and updateBy != ''">#{updateBy},</if>
+            <if test="updateTime != null ">#{updateTime},</if>
         </trim>
     </insert>
 
@@ -106,18 +108,19 @@
     <update id="updatePress" parameterType="Press">
         update vr_press
         <trim prefix="SET" suffixOverrides=",">
-            <if test="title != null">title = #{title},</if>
-            <if test="author != null">author = #{author},</if>
-            <if test="pressTitle != null">press_title = #{pressTitle},</if>
-            <if test="issue != null">issue = #{issue},</if>
-            <if test="pages != null">pages = #{pages},</if>
-            <if test="keyword != null">keyword = #{keyword},</if>
-            <if test="classify != null">classify = #{classify},</if>
-            <if test="area != null">area = #{area},</if>
-            <if test="createBy != null">create_by = #{createBy},</if>
-            <if test="createTime != null">create_time = #{createTime},</if>
-            <if test="updateBy != null">update_by = #{updateBy},</if>
-            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="title != null and title != ''">title = #{title},</if>
+            <if test="author != null and author != ''">author = #{author},</if>
+            <if test="pressTitle != null and pressTitle != ''">press_title = #{pressTitle},</if>
+            <if test="date != null and date != ''">date = #{date},</if>
+            <if test="issue != null and issue != ''">issue = #{issue},</if>
+            <if test="pages != null and pages != ''">pages = #{pages},</if>
+            <if test="keyword != null and keyword != ''">keyword = #{keyword},</if>
+            <if test="classify != null and classify != ''">classify = #{classify},</if>
+            <if test="area != null and area != ''">area = #{area},</if>
+            <if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
+            <if test="createTime != null ">create_time = #{createTime},</if>
+            <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
+            <if test="updateTime != null ">update_time = #{updateTime},</if>
         </trim>
         where press_id = #{pressId}
     </update>

+ 32 - 32
src/main/resources/mybatis/VRdemo/PublicationMapper.xml

@@ -34,11 +34,11 @@
     <select id="selectPublicationList" parameterType="Publication" resultMap="PublicationResult">
         <include refid="selectPublicationVo"/>
         <where>
-            <if test="affiliation != null  and affiliation != ''">and affiliation = #{affiliation}</if>
-            <if test="location != null  and location != ''">and location = #{location}</if>
-            <if test="title != null  and title != ''">and title = #{title}</if>
-            <if test="link != null  and link != ''">and link = #{link}</if>
-            <if test="introduce != null  and introduce != ''">and introduce = #{introduce}</if>
+            <if test="affiliation != null  and affiliation != ''"> and affiliation like concat('%', #{affiliation}, '%')</if>
+            <if test="location != null  and location != ''"> and location like concat('%', #{location}, '%')</if>
+            <if test="title != null  and title != ''"> and title like concat('%', #{title}, '%')</if>
+            <if test="link != null  and link != ''"> and link like concat('%', #{link}, '%')</if>
+            <if test="introduce != null  and introduce != ''"> and introduce like concat('%', #{introduce}, '%')</if>
         </where>
     </select>
 
@@ -56,26 +56,26 @@
     <insert id="insertPublication" parameterType="Publication" useGeneratedKeys="true" keyProperty="id">
         insert into vr_publication
         <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="affiliation != null">affiliation,</if>
-            <if test="location != null">location,</if>
-            <if test="title != null">title,</if>
-            <if test="link != null">link,</if>
-            <if test="introduce != null">introduce,</if>
-            <if test="createBy != null">create_by,</if>
-            <if test="createTime != null">create_time,</if>
-            <if test="updateBy != null">update_by,</if>
-            <if test="updateTime != null">update_time,</if>
+            <if test="affiliation != null and affiliation != ''">affiliation,</if>
+            <if test="location != null and location != ''">location,</if>
+            <if test="title != null and title != ''">title,</if>
+            <if test="introduce != null and introduce != ''">introduce,</if>
+            <if test="link != null and link != ''">link,</if>
+            <if test="createBy != null and createBy != ''">create_by,</if>
+            <if test="createTime != null ">create_time,</if>
+            <if test="updateBy != null and updateBy != ''">update_by,</if>
+            <if test="updateTime != null ">update_time,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
-            <if test="affiliation != null">#{affiliation},</if>
-            <if test="location != null">#{location},</if>
-            <if test="title != null">#{title},</if>
-            <if test="link != null">#{link},</if>
-            <if test="introduce != null">#{introduce},</if>
-            <if test="createBy != null">#{createBy},</if>
-            <if test="createTime != null">#{createTime},</if>
-            <if test="updateBy != null">#{updateBy},</if>
-            <if test="updateTime != null">#{updateTime},</if>
+            <if test="affiliation != null and affiliation != ''">#{affiliation},</if>
+            <if test="location != null and location != ''">#{location},</if>
+            <if test="title != null and title != ''">#{title},</if>
+            <if test="introduce != null and introduce != ''">#{introduce},</if>
+            <if test="link != null and link != ''">#{link},</if>
+            <if test="createBy != null and createBy != ''">#{createBy},</if>
+            <if test="createTime != null ">#{createTime},</if>
+            <if test="updateBy != null and updateBy != ''">#{updateBy},</if>
+            <if test="updateTime != null ">#{updateTime},</if>
         </trim>
     </insert>
 
@@ -91,15 +91,15 @@
     <update id="updatePublication" parameterType="Publication">
         update vr_publication
         <trim prefix="SET" suffixOverrides=",">
-            <if test="affiliation != null">affiliation = #{affiliation},</if>
-            <if test="location != null">location = #{location},</if>
-            <if test="title != null">title = #{title},</if>
-            <if test="link != null">link = #{link},</if>
-            <if test="introduce != null">introduce = #{introduce},</if>
-            <if test="createBy != null">create_by = #{createBy},</if>
-            <if test="createTime != null">create_time = #{createTime},</if>
-            <if test="updateBy != null">update_by = #{updateBy},</if>
-            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="affiliation != null and affiliation != ''">affiliation = #{affiliation},</if>
+            <if test="location != null and location != ''">location = #{location},</if>
+            <if test="title != null and title != ''">title = #{title},</if>
+            <if test="introduce != null and introduce != ''">introduce = #{introduce},</if>
+            <if test="link != null and link != ''">link = #{link},</if>
+            <if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
+            <if test="createTime != null ">create_time = #{createTime},</if>
+            <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
+            <if test="updateTime != null ">update_time = #{updateTime},</if>
         </trim>
         where id = #{id}
     </update>

+ 29 - 17
src/main/resources/mybatis/VRdemo/ResearchMapper.xml

@@ -28,8 +28,8 @@
                 '%')
             </if>
             <if test="topic != null  and topic != ''">and topic like concat('%', #{topic}, '%')</if>
-            <if test="publicationTime != null ">and publication_time = #{publicationTime}</if>
-            <if test="category != null  and category != ''">and category = #{category}</if>
+            <if test="publicationTime != null and publicationTime != ''">and publication_time = #{publicationTime}</if>
+            <if test="category != null  and category != ''">and category like concat('%', #{category}, '%')</if>
         </where>
     </select>
 
@@ -46,20 +46,28 @@
     <insert id="insertResearch" parameterType="Research" useGeneratedKeys="true" keyProperty="id">
         insert into vr_research
         <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="title != null">title,</if>
-            <if test="author != null">author,</if>
-            <if test="institution != null">institution,</if>
-            <if test="topic != null">topic,</if>
-            <if test="publicationTime != null">publication_time,</if>
+            <if test="title != null and title != ''">title,</if>
+            <if test="author != null and author != ''">author,</if>
+            <if test="institution != null and institution != ''">institution,</if>
+            <if test="topic != null and topic != ''">topic,</if>
+            <if test="publicationTime != null and publicationTime != ''">publication_time,</if>
             <if test="category != null">category,</if>
+            <if test="createBy != null and createBy != ''">create_by,</if>
+            <if test="createTime != null ">create_time,</if>
+            <if test="updateBy != null and updateBy != ''">update_by,</if>
+            <if test="updateTime != null ">update_time,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
-            <if test="title != null">#{title},</if>
-            <if test="author != null">#{author},</if>
-            <if test="institution != null">#{institution},</if>
-            <if test="topic != null">#{topic},</if>
-            <if test="publicationTime != null">#{publicationTime},</if>
+            <if test="title != null and title != ''">#{title},</if>
+            <if test="author != null and author != ''">#{author},</if>
+            <if test="institution != null and institution != ''">#{institution},</if>
+            <if test="topic != null and topic != ''">#{topic},</if>
+            <if test="publicationTime != null and publicationTime != ''">#{publicationTime},</if>
             <if test="category != null">#{category},</if>
+            <if test="createBy != null and createBy != ''">#{createBy},</if>
+            <if test="createTime != null ">#{createTime},</if>
+            <if test="updateBy != null and updateBy != ''">#{updateBy},</if>
+            <if test="updateTime != null ">#{updateTime},</if>
         </trim>
     </insert>
 
@@ -75,12 +83,16 @@
     <update id="updateResearch" parameterType="Research">
         update vr_research
         <trim prefix="SET" suffixOverrides=",">
-            <if test="title != null">title = #{title},</if>
-            <if test="author != null">author = #{author},</if>
-            <if test="institution != null">institution = #{institution},</if>
-            <if test="topic != null">topic = #{topic},</if>
-            <if test="publicationTime != null">publication_time = #{publicationTime},</if>
+            <if test="title != null and title != ''">title = #{title},</if>
+            <if test="author != null and author != ''">author = #{author},</if>
+            <if test="institution != null and institution != ''">institution = #{institution},</if>
+            <if test="topic != null and topic != ''">topic = #{topic},</if>
+            <if test="publicationTime != null and publicationTime != ''">publication_time = #{publicationTime},</if>
             <if test="category != null">category = #{category},</if>
+            <if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
+            <if test="createTime != null ">create_time = #{createTime},</if>
+            <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
+            <if test="updateTime != null ">update_time = #{updateTime},</if>
         </trim>
         where id = #{id}
     </update>

+ 25 - 25
src/main/resources/mybatis/VRdemo/SpecialCollectionMapper.xml

@@ -21,10 +21,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <select id="selectCollectionList" parameterType="Collection" resultMap="SpecialCollectionResult">
         <include refid="selectCollectionVo"/>
-        <where>  
-            <if test="title != null  and title != ''"> and title = #{title}</if>
-            <if test="content != null  and content != ''"> and content = #{content}</if>
-            <if test="link != null  and link != ''"> and link = #{link}</if>
+        <where>
+            <if test="title != null  and title != ''"> and title like concat('%', #{title}, '%')</if>
+            <if test="content != null  and content != ''"> and content like concat('%', #{content}, '%')</if>
+            <if test="link != null  and link != ''"> and link like concat('%', #{link}, '%')</if>
         </where>
     </select>
     
@@ -41,22 +41,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <insert id="insertCollection" parameterType="Collection" useGeneratedKeys="true" keyProperty="id">
         insert into vr_special_collection
         <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="title != null">title,</if>
-            <if test="content != null">content,</if>
-            <if test="link != null">link,</if>
-            <if test="createTime != null">create_time,</if>
-            <if test="createBy != null">create_by,</if>
-            <if test="updateTime != null">update_time,</if>
-            <if test="updateBy != null">update_by,</if>
+            <if test="title != null and title != ''">title,</if>
+            <if test="content != null and content != ''">content,</if>
+            <if test="link != null and link != ''">link,</if>
+            <if test="createBy != null and createBy != ''">create_by,</if>
+            <if test="createTime != null ">create_time,</if>
+            <if test="updateBy != null and updateBy != ''">update_by,</if>
+            <if test="updateTime != null ">update_time,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
-            <if test="title != null">#{title},</if>
-            <if test="content != null">#{content},</if>
-            <if test="link != null">#{link},</if>
-            <if test="createTime != null">#{createTime},</if>
-            <if test="createBy != null">#{createBy},</if>
-            <if test="updateTime != null">#{updateTime},</if>
-            <if test="updateBy != null">#{updateBy},</if>
+            <if test="title != null and title != ''">#{title},</if>
+            <if test="content != null and content != ''">#{content},</if>
+            <if test="link != null and link != ''">#{link},</if>
+            <if test="createBy != null and createBy != ''">#{createBy},</if>
+            <if test="createTime != null ">#{createTime},</if>
+            <if test="updateBy != null and updateBy != ''">#{updateBy},</if>
+            <if test="updateTime != null ">#{updateTime},</if>
         </trim>
     </insert>
 
@@ -71,13 +71,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <update id="updateCollection" parameterType="Collection">
         update vr_special_collection
         <trim prefix="SET" suffixOverrides=",">
-            <if test="title != null">title = #{title},</if>
-            <if test="content != null">content = #{content},</if>
-            <if test="link != null">link = #{link},</if>
-            <if test="createTime != null">create_time = #{createTime},</if>
-            <if test="createBy != null">create_by = #{createBy},</if>
-            <if test="updateTime != null">update_time = #{updateTime},</if>
-            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="title != null and title != ''">title = #{title},</if>
+            <if test="content != null and content != ''">content = #{content},</if>
+            <if test="link != null and link != ''">link = #{link},</if>
+            <if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
+            <if test="createTime != null ">create_time = #{createTime},</if>
+            <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
+            <if test="updateTime != null ">update_time = #{updateTime},</if>
         </trim>
         where id = #{id}
     </update>

+ 38 - 26
src/main/resources/mybatis/VRdemo/ThesisMapper.xml

@@ -31,12 +31,12 @@
         <include refid="selectThesisVo"/>
         <where>
             <if test="name != null  and name != ''">and name like concat('%', #{name}, '%')</if>
-            <if test="teacher != null  and teacher != ''">and teacher = #{teacher}</if>
-            <if test="major != null  and major != ''">and major = #{major}</if>
-            <if test="title != null  and title != ''">and title = #{title}</if>
-            <if test="keyword != null  and keyword != ''">and keyword = #{keyword}</if>
+            <if test="teacher != null  and teacher != ''">and teacher like concat('%', #{teacher}, '%')</if>
+            <if test="major != null  and major != ''">and major like concat('%', #{major}, '%')</if>
+            <if test="title != null  and title != ''"> and title like concat('%', #{title}, '%')</if>
+            <if test="keyword != null  and keyword != ''">and keyword like concat('%', #{keyword}, '%')</if>
             <if test="replyTime != null  and replyTime != ''">and reply_time = #{replyTime}</if>
-            <if test="degree != null  and degree != ''">and degree = #{degree}</if>
+            <if test="degree != null  and degree != ''">and degree like concat('%', #{degree}, '%')</if>
         </where>
     </select>
 
@@ -53,22 +53,30 @@
     <insert id="insertThesis" parameterType="Thesis" useGeneratedKeys="true" keyProperty="id">
         insert into vr_thesis
         <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="name != null">name,</if>
-            <if test="teacher != null">teacher,</if>
-            <if test="major != null">major,</if>
-            <if test="title != null">title,</if>
-            <if test="keyword != null">keyword,</if>
-            <if test="replyTime != null">reply_time,</if>
-            <if test="degree != null">degree,</if>
+            <if test="name != null and name != ''">name,</if>
+            <if test="teacher != null and teacher != ''">teacher,</if>
+            <if test="major != null and major != ''">major,</if>
+            <if test="title != null and title != ''">title,</if>
+            <if test="keyword != null and keyword != ''">keyword,</if>
+            <if test="replyTime != null and replyTime != ''">reply_time,</if>
+            <if test="degree != null and degree != ''">degree,</if>
+            <if test="createBy != null and createBy != ''">create_by,</if>
+            <if test="createTime != null ">create_time,</if>
+            <if test="updateBy != null and updateBy != ''">update_by,</if>
+            <if test="updateTime != null ">update_time,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
-            <if test="name != null">#{name},</if>
-            <if test="teacher != null">#{teacher},</if>
-            <if test="major != null">#{major},</if>
-            <if test="title != null">#{title},</if>
-            <if test="keyword != null">#{keyword},</if>
-            <if test="replyTime != null">#{replyTime},</if>
-            <if test="degree != null">#{degree},</if>
+            <if test="name != null and name != ''">#{name},</if>
+            <if test="teacher != null and teacher != ''">#{teacher},</if>
+            <if test="major != null and major != ''">#{major},</if>
+            <if test="title != null and title != ''">#{title},</if>
+            <if test="keyword != null and keyword != ''">#{keyword},</if>
+            <if test="replyTime != null and replyTime != ''">#{replyTime},</if>
+            <if test="degree != null and degree != ''">#{degree},</if>
+            <if test="createBy != null and createBy != ''">#{createBy},</if>
+            <if test="createTime != null ">#{createTime},</if>
+            <if test="updateBy != null and updateBy != ''">#{updateBy},</if>
+            <if test="updateTime != null ">#{updateTime},</if>
         </trim>
     </insert>
 
@@ -84,13 +92,17 @@
     <update id="updateThesis" parameterType="Thesis">
         update vr_thesis
         <trim prefix="SET" suffixOverrides=",">
-            <if test="name != null">name = #{name},</if>
-            <if test="teacher != null">teacher = #{teacher},</if>
-            <if test="major != null">major = #{major},</if>
-            <if test="title != null">title = #{title},</if>
-            <if test="keyword != null">keyword = #{keyword},</if>
-            <if test="replyTime != null">reply_time = #{replyTime},</if>
-            <if test="degree != null">degree = #{degree},</if>
+            <if test="name != null and name != ''">name = #{name},</if>
+            <if test="teacher != null and teacher != ''">teacher = #{teacher},</if>
+            <if test="major != null and major != ''">major = #{major},</if>
+            <if test="title != null and title != ''">title = #{title},</if>
+            <if test="keyword != null and keyword != ''">keyword = #{keyword},</if>
+            <if test="replyTime != null and replyTime != ''">reply_time = #{replyTime},</if>
+            <if test="degree != null and degree != ''">degree = #{degree},</if>
+            <if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
+            <if test="createTime != null ">create_time = #{createTime},</if>
+            <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
+            <if test="updateTime != null ">update_time = #{updateTime},</if>
         </trim>
         where id = #{id}
     </update>