Commit e061a7e2 authored by litengwei's avatar litengwei

SQL Injection: MyBatis Mapper(SQL注入:MyBatis Mapper)

parent 99007a37
...@@ -292,7 +292,7 @@ select * from ( ...@@ -292,7 +292,7 @@ select * from (
group by cd.instance_id group by cd.instance_id
) result ) result
<if test="groupByName != null and groupByName!='' "> <if test="groupByName != null and groupByName!='' ">
group by #{groupByName} group by ${groupByName}
</if> </if>
</select> </select>
...@@ -335,7 +335,7 @@ select * from ( ...@@ -335,7 +335,7 @@ select * from (
group by cd.instance_id group by cd.instance_id
) result ) result
<if test="groupByName != null and groupByName!='' "> <if test="groupByName != null and groupByName!='' ">
group by #{groupByName} group by ${groupByName}
</if> </if>
</select> </select>
......
...@@ -218,7 +218,7 @@ ...@@ -218,7 +218,7 @@
<if test="map.fieldsValue != null"> <if test="map.fieldsValue != null">
<foreach collection="map.fieldsValue.keys" item="item"> <foreach collection="map.fieldsValue.keys" item="item">
<if test="item != 'bizOrgName'"> <if test="item != 'bizOrgName'">
AND a.#{item} = #{map.fieldsValue[#{item}]} AND a.${item} = #{map.fieldsValue[#{item}]}
</if> </if>
</foreach> </foreach>
</if> </if>
...@@ -251,7 +251,7 @@ ...@@ -251,7 +251,7 @@
u.biz_org_code bizOrgCode, u.biz_org_code bizOrgCode,
<if test="fields != null"> <if test="fields != null">
<foreach collection="fields" item="item" separator=",">MAX(case f.field_code when #{item} then IFNULL(v.field_value_label, v.field_value) <foreach collection="fields" item="item" separator=",">MAX(case f.field_code when #{item} then IFNULL(v.field_value_label, v.field_value)
end) #{item} end) ${item}
</foreach> </foreach>
</if> </if>
FROM FROM
......
...@@ -28,10 +28,10 @@ ...@@ -28,10 +28,10 @@
<foreach collection="params" index="key" item="value" separator=""> <foreach collection="params" index="key" item="value" separator="">
<choose> <choose>
<when test="fieldNames[key] == 'like' and value !=null and value !=''"> <when test="fieldNames[key] == 'like' and value !=null and value !=''">
and d.${key} like concat('%',#{value},'%') and d.#{key} like concat('%',#{value},'%')
</when> </when>
<when test="fieldNames[key] == 'eq' and value !=null and value !=''"> <when test="fieldNames[key] == 'eq' and value !=null and value !=''">
and d.${key} = #{value} and d.#{key} = #{value}
</when> </when>
</choose> </choose>
</foreach> </foreach>
...@@ -80,10 +80,10 @@ ...@@ -80,10 +80,10 @@
<foreach collection="params" index="key" item="value" separator=""> <foreach collection="params" index="key" item="value" separator="">
<choose> <choose>
<when test="fieldNames[key] == 'like' and value !=null and value !=''"> <when test="fieldNames[key] == 'like' and value !=null and value !=''">
AND d.${key} like concat('%',#{value},'%') AND d.#{key} like concat('%',#{value},'%')
</when> </when>
<when test="fieldNames[key] == 'eq' and value !=null and value !=''"> <when test="fieldNames[key] == 'eq' and value !=null and value !=''">
AND d.${key} = #{value} AND d.#{key} = #{value}
</when> </when>
</choose> </choose>
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
and dc.USER_ID = #{userId} and dc.USER_ID = #{userId}
</if> </if>
<if test="orgCode != null and orgCode !=''"> <if test="orgCode != null and orgCode !=''">
and dc.ORG_CODE like '%#{orgCode}%' and dc.ORG_CODE like CONCAT('%',#{orgCode},'%' )
</if> </if>
) )
UNION ALL UNION ALL
...@@ -70,7 +70,7 @@ ...@@ -70,7 +70,7 @@
and dc.USER_ID = #{userId} and dc.USER_ID = #{userId}
</if> </if>
<if test="orgCode != null and orgCode !=''"> <if test="orgCode != null and orgCode !=''">
and dc.ORG_CODE like '%#{orgCode}%' and dc.ORG_CODE like CONCAT('%',#{orgCode},'%' )
</if> </if>
) )
)d LIMIT #{offset},#{length} )d LIMIT #{offset},#{length}
...@@ -84,7 +84,7 @@ ...@@ -84,7 +84,7 @@
(SELECT kdc.CATEGORY_NAME FROM knowledge_doc_category kdc WHERE kdc.SEQUENCE_NBR = DIRECTORY_ID) directoryName, (SELECT kdc.CATEGORY_NAME FROM knowledge_doc_category kdc WHERE kdc.SEQUENCE_NBR = DIRECTORY_ID) directoryName,
<if test="extraFields != null and extraFields.size > 0"> <if test="extraFields != null and extraFields.size > 0">
<foreach collection="extraFields" item="_field" > <foreach collection="extraFields" item="_field" >
#{_field}, ${_field},
</foreach> </foreach>
</if> </if>
IFNULL(collectNum, 0) collectNum, IFNULL(quoteNum, 0) quoteNum, IFNULL(collect, "UNCOLLECT") collect IFNULL(collectNum, 0) collectNum, IFNULL(quoteNum, 0) quoteNum, IFNULL(collect, "UNCOLLECT") collect
...@@ -157,7 +157,7 @@ ...@@ -157,7 +157,7 @@
ORG_CODE LIKE CONCAT(#{permissionFilters.orgCode}, "%") ORG_CODE LIKE CONCAT(#{permissionFilters.orgCode}, "%")
AND AUDIT_STATUS IN AND AUDIT_STATUS IN
<foreach collection="permissionFilters.auditStatusList" item="auditStatus" open="(" close=")" separator=", "> <foreach collection="permissionFilters.auditStatusList" item="auditStatus" open="(" close=")" separator=", ">
#{auditStatus} ${auditStatus}
</foreach> </foreach>
) )
</if> </if>
...@@ -166,7 +166,7 @@ ...@@ -166,7 +166,7 @@
</if> </if>
<if test="extraStrFilters != null and extraStrFilters.size > 0"> <if test="extraStrFilters != null and extraStrFilters.size > 0">
<foreach collection="extraStrFilters" item="str"> <foreach collection="extraStrFilters" item="str">
AND #{str} AND ${str}
</foreach> </foreach>
</if> </if>
</where> </where>
......
...@@ -343,7 +343,7 @@ ...@@ -343,7 +343,7 @@
<select id="tagChartStatistics" resultType="java.util.Map" <select id="tagChartStatistics" resultType="java.util.Map"
parameterType="java.util.Map"> parameterType="java.util.Map">
SELECT SELECT
COUNT(1) AS datas,${splitSQL} AS level COUNT(1) AS datas,#{splitSQL} AS level
FROM FROM
knowledge_doc_content kdc knowledge_doc_content kdc
LEFT JOIN knowledge_tag_instance kti ON kti.TARGET_SEQ = kdc.SEQUENCE_NBR LEFT JOIN knowledge_tag_instance kti ON kti.TARGET_SEQ = kdc.SEQUENCE_NBR
...@@ -384,7 +384,7 @@ ...@@ -384,7 +384,7 @@
<select id="tagTimeChartStatistics" resultType="java.util.Map" <select id="tagTimeChartStatistics" resultType="java.util.Map"
parameterType="java.util.Map"> parameterType="java.util.Map">
SELECT SELECT
COUNT(1) AS datas ,${splitSQL} AS level COUNT(1) AS datas ,#{splitSQL} AS level
FROM FROM
( (
SELECT SELECT
......
...@@ -254,7 +254,7 @@ ...@@ -254,7 +254,7 @@
and d.biz_org_code LIKE CONCAT(#{bizOrgCode},'%') and d.biz_org_code LIKE CONCAT(#{bizOrgCode},'%')
</if> </if>
</trim> </trim>
order by #{orderBy} order by ${orderBy}
<choose> <choose>
<when test="pageSize==-1"></when> <when test="pageSize==-1"></when>
<when test="pageSize!=-1">limit #{offset},#{pageSize}</when> <when test="pageSize!=-1">limit #{offset},#{pageSize}</when>
...@@ -425,7 +425,7 @@ ...@@ -425,7 +425,7 @@
<if test="isExecute!=null and isExecute!='' and isExecute == '3'">and a.is_OK != #{isExecute}</if> <if test="isExecute!=null and isExecute!='' and isExecute == '3'">and a.is_OK != #{isExecute}</if>
</trim> </trim>
order by order by
#{orderBy} ${orderBy}
<choose> <choose>
<when test="pageSize==-1"></when> <when test="pageSize==-1"></when>
<when test="pageSize!=-1">limit #{offset}, #{pageSize}</when> <when test="pageSize!=-1">limit #{offset}, #{pageSize}</when>
...@@ -476,7 +476,7 @@ ...@@ -476,7 +476,7 @@
and a.org_code LIKE CONCAT(#{bizOrgCode},'%') and a.org_code LIKE CONCAT(#{bizOrgCode},'%')
</if> </if>
</trim> </trim>
order by #{orderBy} order by ${orderBy}
<choose> <choose>
<when test="pageSize==-1"></when> <when test="pageSize==-1"></when>
<when test="pageSize!=-1">limit #{offset},#{pageSize}</when> <when test="pageSize!=-1">limit #{offset},#{pageSize}</when>
......
...@@ -102,7 +102,7 @@ ...@@ -102,7 +102,7 @@
order by b.id desc order by b.id desc
<choose> <choose>
<when test="pageSize==-1"></when> <when test="pageSize==-1"></when>
<when test="pageSize!=-1">limit #{offset},#{pageSize}</when> <when test="pageSize!=-1">limit ${offset},${pageSize}</when>
</choose> </choose>
</select> </select>
...@@ -237,8 +237,8 @@ ...@@ -237,8 +237,8 @@
) a ) a
<include refid="plan-task-app-where"/> <include refid="plan-task-app-where"/>
<if test="orderBy != null and orderBy != ''"> order by #{orderBy} </if> <if test="orderBy != null and orderBy != ''"> order by ${orderBy} </if>
limit #{offset},#{pageSize} limit ${offset},${pageSize}
</select> </select>
<select id="getPlanTasksCount" resultType="long"> <select id="getPlanTasksCount" resultType="long">
SELECT SELECT
...@@ -555,7 +555,7 @@ ...@@ -555,7 +555,7 @@
order by a.id order by a.id
<choose> <choose>
<when test="pageSize==-1"></when> <when test="pageSize==-1"></when>
<when test="pageSize!=-1">limit #{offset},#{pageSize}</when> <when test="pageSize!=-1">limit ${offset},${pageSize}</when>
</choose> </choose>
</select> </select>
...@@ -588,7 +588,7 @@ ...@@ -588,7 +588,7 @@
order by a.id order by a.id
<choose> <choose>
<when test="pageSize==-1"></when> <when test="pageSize==-1"></when>
<when test="pageSize!=-1">limit #{offset},#{pageSize}</when> <when test="pageSize!=-1">limit ${offset},${pageSize}</when>
</choose> </choose>
</select> </select>
...@@ -1177,7 +1177,7 @@ ...@@ -1177,7 +1177,7 @@
ppk.begin_time DESC ppk.begin_time DESC
<choose> <choose>
<when test="param.pageSize==-1"></when> <when test="param.pageSize==-1"></when>
<when test="param.pageSize!=-1">limit #{param.pageNumber}, #{param.pageSize}</when> <when test="param.pageSize!=-1">limit ${param.pageNumber}, ${param.pageSize}</when>
</choose> </choose>
</select> </select>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment