sqlmap 中配置sql时候
如果sql出现 < > ‘ 时候需要替换掉,否则.xml配置文件编译不通过
lt; <
> >
<> <>
& &
' '
" "
sqlmap配置中
传入单个参数 java.long.String
传入多个参数 hashmap
#key:int#
#key:varchar#
传入多个参数bean 传入方式
<select id="getDocIds" resultMap="BaseResultMap" parameterClass="java.util.HashMap" >
select
docId,
appId,
authorUsername,
authorRealname,
authorOrgname,
authorOrgId,
authorPositionName,
subject,
createTime,
finishTime,
isParallel,
authorOpid,
nextStatus,
opid,
docBody,
receiverUsername,
receiverRealname,
lastNoteId,
isdel
from appdoc where docid in
(
select docid from
(
select count(docid) num , SUM(distinct(docid)) docid from flowNote where docId in
(
select docId from appDoc where appid = #appid:int# and isdel = 0
and createTime >= cast(#beginTime:varchar# as datetime)
and createTime <= cast(#endTime:varchar# as datetime)
) group by docId
) a where a.num>1
)
</select>
如果sql出现 < > ‘ 时候需要替换掉,否则.xml配置文件编译不通过
lt; <
> >
<> <>
& &
' '
" "
sqlmap配置中
传入单个参数 java.long.String
传入多个参数 hashmap
#key:int#
#key:varchar#
传入多个参数bean 传入方式
<select id="getDocIds" resultMap="BaseResultMap" parameterClass="java.util.HashMap" >
select
docId,
appId,
authorUsername,
authorRealname,
authorOrgname,
authorOrgId,
authorPositionName,
subject,
createTime,
finishTime,
isParallel,
authorOpid,
nextStatus,
opid,
docBody,
receiverUsername,
receiverRealname,
lastNoteId,
isdel
from appdoc where docid in
(
select docid from
(
select count(docid) num , SUM(distinct(docid)) docid from flowNote where docId in
(
select docId from appDoc where appid = #appid:int# and isdel = 0
and createTime >= cast(#beginTime:varchar# as datetime)
and createTime <= cast(#endTime:varchar# as datetime)
) group by docId
) a where a.num>1
)
</select>