<select id="getSearchPage" parameterType="java.util.Map" resultType="MockSearchOutput">
SELECT
MOCK_USER_GROUP.GROUP_ID as id,
MOCK_BI_COLLECTION.UM as UM,
MOCK_BI_COLLECTION.REQUEST_SYSTEM as requestSystem,
MOCK_BI_COLLECTION.RESPONSE_SYSTEM responseSystem,
MOCK_BI_COLLECTION.RESPONSE_FACADE as responseFacade,
MOCK_BI_COLLECTION.RESPONSE_METHOD as responseMethod,
MOCK_BI_COLLECTION.REQUEST_COUNT as requestCount,
MOCK_BI_COLLECTION.CREATE_TIME as createTime,
MOCK_USER_GROUP.GROUP_NAME as groupName
FROM
MOCK_BI_COLLECTION LEFT JOIN MOCK_USER_GROUP
ON MOCK_BI_COLLECTION.UM=MOCK_USER_GROUP.UM
WHERE
1=1
<if test="mockSearchInput.UM != null and mockSearchInput.UM!=''">
AND MOCK_BI_COLLECTION.UM like CONCAT('%',#{mockSearchInput.UM},'%')
</if>
<if test="mockSearchInput.groupName != null and mockSearchInput.groupName!=''">
AND GROUP_NAME like CONCAT('%',#{mockSearchInput.groupName},'%')
</if>
<if test="mockSearchInput.requestSystem != null and mockSearchInput.requestSystem!=''">
AND REQUEST_SYSTEM like CONCAT('%',#{mockSearchInput.requestSystem},'%')
</if>
<if test="mockSearchInput.beginTime != null">
AND unix_timestamp(CREATE_TIME )>= unix_timestamp(mockSearchInput.beginTime)
</if>
<if test="endTime != null">
AND unix_timestamp(CREATE_TIME)<= unix_timestamp(mockSearchInput.endTime)
</if>
ORDER BY
MOCK_USER_GROUP.ID ASC
LIMIT
<!--从第dbIndex条开始,共显示dbNumber条-->
#{page.dbIndex},#{page.dbNumber}
</select>
<select id="getCount" parameterType="com.pinganfu.hycx.mock.model.MockSearchInput" resultType="Integer">
SELECT
COUNT(MOCK_BI_COLLECTION.UM)
FROM
MOCK_BI_COLLECTION LEFT JOIN MOCK_USER_GROUP
ON MOCK_BI_COLLECTION.UM=MOCK_USER_GROUP.UM
WHERE
1=1
<!--<if test="UM != null">-->
<if test="UM != null and UM!=''">
AND MOCK_BI_COLLECTION.UM like CONCAT('%',#{UM},'%')
</if>
<if test="groupName != null and groupName!=''">
AND GROUP_NAME like CONCAT('%',#{groupName},'%')
</if>
<if test="requestSystem != null and requestSystem!=''">
AND REQUEST_SYSTEM like CONCAT('%',#{requestSystem},'%')
</if>
<if test="beginTime != null">
AND unix_timestamp(CREATE_TIME )>= unix_timestamp(beginTime)
</if>
<if test="endTime != null">
AND unix_timestamp(CREATE_TIME)<= unix_timestamp(endTime)
</if>
</select>
<select id="getGroupNameList" resultType="String">
SELECT
DISTINCT MOCK_USER_GROUP.GROUP_NAME as groupName
FROM
MOCK_USER_GROUP
WHERE
MOCK_USER_GROUP.GROUP_NAME IS NOT NULL
</select>