xdd пре 2 недеља
родитељ
комит
bfa9d003b4

+ 8 - 7
fs-doctor-app/src/main/java/com/fs/framework/config/MyBatisConfig.java

@@ -1,5 +1,6 @@
 package com.fs.framework.config;
 
+import com.baomidou.mybatisplus.extension.spring.MybatisSqlSessionFactoryBean;
 import com.fs.common.utils.StringUtils;
 import org.apache.ibatis.io.VFS;
 import org.apache.ibatis.session.SqlSessionFactory;
@@ -27,7 +28,7 @@ import java.util.List;
 
 /**
  * Mybatis支持*匹配扫描包
- * 
+ *
 
  */
 @Configuration
@@ -117,17 +118,17 @@ public class MyBatisConfig
     @Bean
     public SqlSessionFactory sqlSessionFactory(DataSource dataSource) throws Exception
     {
-        String typeAliasesPackage = env.getProperty("mybatis.typeAliasesPackage");
-        String mapperLocations = env.getProperty("mybatis.mapperLocations");
-        String configLocation = env.getProperty("mybatis.configLocation");
+        String typeAliasesPackage = env.getProperty("mybatis-plus.typeAliasesPackage");
+        String mapperLocations = env.getProperty("mybatis-plus.mapperLocations");
+        String configLocation = env.getProperty("mybatis-plus.configLocation");
         typeAliasesPackage = setTypeAliasesPackage(typeAliasesPackage);
         VFS.addImplClass(SpringBootVFS.class);
 
-        final SqlSessionFactoryBean sessionFactory = new SqlSessionFactoryBean();
+        final MybatisSqlSessionFactoryBean sessionFactory = new MybatisSqlSessionFactoryBean();
         sessionFactory.setDataSource(dataSource);
         sessionFactory.setTypeAliasesPackage(typeAliasesPackage);
-        sessionFactory.setMapperLocations(resolveMapperLocations(StringUtils.split(mapperLocations, ",")));
+        sessionFactory.setMapperLocations(new PathMatchingResourcePatternResolver().getResources(mapperLocations));
         sessionFactory.setConfigLocation(new DefaultResourceLoader().getResource(configLocation));
         return sessionFactory.getObject();
     }
-}
+}

+ 1 - 17
fs-service/src/main/java/com/fs/his/mapper/FsPackageMapper.java

@@ -108,23 +108,7 @@ public interface FsPackageMapper
             "        order by sort,package_id desc"+
             "</script>"})
     List<FsPackageExcelVO> selectFsPackageListExcelVO(@Param("maps") FsPackage fsPackage);
-    @Select({"<script> " +
-            "select p.*  from fs_package p    " +
-            "where p.status=1 and p.is_del=0   " +
-            "<if test = 'maps.keyword != null     '> " +
-            "and ( p.package_name like CONCAT('%',#{maps.keyword},'%') or p.second_name like CONCAT('%',#{maps.keyword},'%')) " +
-            "</if>" +
-            "<if test = 'maps.diseaseType != null and maps.diseaseType !=0    '> " +
-            "and p.disease_type = #{maps.diseaseType} " +
-            "</if>" +
-            "<if test = 'maps.privateType != null and maps.privateType !=0    '> " +
-            "and p.private_type = #{maps.privateType} " +
-            "</if>" +
-            "<if test = 'maps.isShow != null '> " +
-            "and p.is_show = #{maps.isShow} " +
-            "</if>" +
-            " order by p.sort desc,package_id  "+
-            "</script>"})
+
     List<FsPackageListUVO> selectFsPackageListUVO(@Param("maps") FsPackageListUParam param);
     @Select("select count(order_id) from fs_package_order WHERE user_id=#{userId} AND package_id=#{packageId} AND `status`>=0")
     int selectFsPackageListByUser(@Param("userId")Long userId,@Param("packageId")Long packageId);

+ 0 - 7
fs-service/src/main/resources/mapper/his/FsArticleCateMapper.xml

@@ -33,13 +33,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         where cate_id = #{cateId}
     </select>
 
-    <select id="selectFsArticleCateAllListVO" resultType="com.fs.his.domain.FsArticleCate">
-        select * FROM fs_article_cate where is_del=0
-        <if test="params.status != null">
-            and status = #{params.status}
-        </if>
-        order by sort asc
-    </select>
 
     <insert id="insertFsArticleCate" parameterType="FsArticleCate" useGeneratedKeys="true" keyProperty="cateId">
         insert into fs_article_cate

+ 6 - 22
fs-service/src/main/resources/mapper/his/FsArticleMapper.xml

@@ -3,7 +3,7 @@
 PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.fs.his.mapper.FsArticleMapper">
-    
+
     <resultMap type="FsArticle" id="FsArticleResult">
         <result property="articleId"    column="article_id"    />
         <result property="cateId"    column="cate_id"    />
@@ -25,7 +25,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <select id="selectFsArticleList" parameterType="FsArticle" resultMap="FsArticleResult">
         <include refid="selectFsArticleVo"/>
-        <where>  
+        <where>
             <if test="cateId != null "> and cate_id = #{cateId}</if>
             <if test="title != null  and title != ''"> and title like concat('%', #{title}, '%')</if>
             <if test="imageUrl != null  and imageUrl != ''"> and image_url = #{imageUrl}</if>
@@ -38,29 +38,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </where>
         order by article_id desc
     </select>
-    
+
     <select id="selectFsArticleByArticleId" parameterType="Long" resultMap="FsArticleResult">
         <include refid="selectFsArticleVo"/>
         where article_id = #{articleId}
     </select>
 
-    <select id="selectFsArticleListUVO" resultType="com.fs.his.vo.FsArticleListUVO">
-        select
-            a.*
-        from fs_article a
-        inner join fs_article_cate c on c.cate_id = a.cate_id
-        where c.status = 1 and c.is_del = 0
-        <if test = 'maps.cateId != null and maps.cateId !=0'>
-            and a.cate_id = #{maps.cateId}
-        </if>
-        <if test = 'maps.isTui != null'>
-            and a.is_tui = #{maps.isTui}
-        </if>
-        <if test="maps.keyword != null and maps.keyword != ''">
-            and a.title like concat('%', #{maps.keyword}, '%')
-        </if>
-        order by a.article_id desc
-    </select>
+
 
     <insert id="insertFsArticle" parameterType="FsArticle" useGeneratedKeys="true" keyProperty="articleId">
         insert into fs_article
@@ -115,9 +99,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </delete>
 
     <delete id="deleteFsArticleByArticleIds" parameterType="String">
-        delete from fs_article where article_id in 
+        delete from fs_article where article_id in
         <foreach item="articleId" collection="array" open="(" separator="," close=")">
             #{articleId}
         </foreach>
     </delete>
-</mapper>
+</mapper>