Pārlūkot izejas kodu

图片素材库-order by create_time desc

三七 1 nedēļu atpakaļ
vecāks
revīzija
dfa68b2daf

+ 7 - 6
fs-service/src/main/resources/mapper/his/FsMaterialMapper.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.FsMaterialMapper">
-    
+
     <resultMap type="FsMaterial" id="FsMaterialResult">
         <result property="materialId"    column="material_id"    />
         <result property="type"    column="type"    />
@@ -23,7 +23,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <select id="selectFsMaterialList" parameterType="FsMaterial" resultMap="FsMaterialResult">
         <include refid="selectFsMaterialVo"/>
-        <where>  
+        <where>
             <if test="type != null  and type != ''"> and type = #{type}</if>
             <if test="groupId != null "> and group_id = #{groupId}</if>
             <if test="name != null  and name != ''"> and name like concat('%', #{name}, '%')</if>
@@ -32,13 +32,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="createUserId != null "> and create_user_id = #{createUserId}</if>
             <if test="storeId != null "> and store_id = #{storeId}</if>
         </where>
+        order by create_time desc
     </select>
-    
+
     <select id="selectFsMaterialByMaterialId" parameterType="Long" resultMap="FsMaterialResult">
         <include refid="selectFsMaterialVo"/>
         where material_id = #{materialId}
     </select>
-        
+
     <insert id="insertFsMaterial" parameterType="FsMaterial" useGeneratedKeys="true" keyProperty="materialId">
         insert into fs_material
         <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -86,9 +87,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </delete>
 
     <delete id="deleteFsMaterialByMaterialIds" parameterType="String">
-        delete from fs_material where material_id in 
+        delete from fs_material where material_id in
         <foreach item="materialId" collection="array" open="(" separator="," close=")">
             #{materialId}
         </foreach>
     </delete>
-</mapper>
+</mapper>