54 lines
1.7 KiB
XML
54 lines
1.7 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
<mapper namespace="com.mca.map.mapper.UseHistoryMapper">
|
|
|
|
<!--해당 회원의 전체 요청 리스트 가져오기-->
|
|
<select id="selectUseHistoryList" parameterType="useHistorySearchVO" resultType="useHistoryVO" >
|
|
SELECT
|
|
log_date AS logDate,
|
|
req_area AS reqArea,
|
|
-- content,
|
|
a.userid,
|
|
b.name,
|
|
b.company
|
|
FROM
|
|
map_use_history a JOIN t_user b ON a.userid=b.userid
|
|
WHERE 1 = 1
|
|
<if test='searchKeyword != null and searchKeyword != ""'>
|
|
<choose>
|
|
<when test='searchCondition eq "all"'>
|
|
AND (content LIKE CONCAT('%',#{searchKeyword},'%')
|
|
OR b.name LIKE CONCAT('%',#{searchKeyword},'%')
|
|
OR b.company LIKE CONCAT('%',#{searchKeyword},'%')
|
|
OR a.area LIKE CONCAT('%',#{searchKeyword},'%'))
|
|
</when>
|
|
<otherwise>
|
|
AND ${searchCondition} LIKE CONCAT('%',#{searchKeyword},'%')
|
|
</otherwise>
|
|
</choose>
|
|
</if>
|
|
ORDER BY log_date DESC
|
|
LIMIT #{recordCountPerPage} OFFSET #{firstIndex}
|
|
</select>
|
|
|
|
<select id="selectUseHistoryCnt" resultType="int" >
|
|
SELECT
|
|
COUNT(*)
|
|
FROM
|
|
map_use_history a JOIN t_user b ON a.userid=b.userid
|
|
WHERE 1 = 1
|
|
<if test='searchKeyword != null and searchKeyword != ""'>
|
|
<choose>
|
|
<when test='searchCondition eq "all"'>
|
|
AND (content LIKE CONCAT('%',#{searchKeyword},'%')
|
|
OR b.name LIKE CONCAT('%',#{searchKeyword},'%')
|
|
OR b.company LIKE CONCAT('%',#{searchKeyword},'%'))
|
|
OR a.area LIKE CONCAT('%',#{searchKeyword},'%'))
|
|
</when>
|
|
<otherwise>
|
|
AND ${searchCondition} LIKE CONCAT('%',#{searchKeyword},'%')
|
|
</otherwise>
|
|
</choose>
|
|
</if>
|
|
</select>
|
|
</mapper> |