瀏覽代碼

修改sql

ZeroLiYi 1 年之前
父節點
當前提交
40f88f4ac2
共有 1 個文件被更改,包括 8 次插入2 次删除
  1. 8 2
      safety-server/src/main/resources/mybatis/mapper/TrainingMapper.xml

+ 8 - 2
safety-server/src/main/resources/mybatis/mapper/TrainingMapper.xml

@@ -37,7 +37,7 @@
37 37
 				and pxlx = #{pxlx}
38 38
 			</if>
39 39
 			<if test="cjdw != null and cjdw != ''">
40
-				and cjdw like '%'||#{cjdw}||'%'
40
+				and cjdw like '%${cjdw}%'
41 41
 			</if>
42 42
 			<if test="pxzt != null and pxzt != ''">
43 43
 				and pxzt =#{pxzt}
@@ -47,7 +47,13 @@
47 47
 			</if>
48 48
 		</where>
49 49
 		) training
50
-		order by decode(tjzt,'0',1,'1',2),pxsj,cjsj desc
50
+		ORDER BY
51
+		CASE tjzt
52
+		WHEN '0' THEN 1
53
+		WHEN '1' THEN 2
54
+		END,
55
+		pxsj,
56
+		cjsj DESC
51 57
 	</select>
52 58
 	<select id="selectPageLists" resultType="com.unis.safety.common.vo.safety.TrainingVO"
53 59
 			parameterType="com.unis.safety.common.vo.safety.TrainingVO">