From 398a4927e195755bd6a46be99337efd8dacc3dc2 Mon Sep 17 00:00:00 2001 From: 박지현 <jhpark@maprex.co.kr> Date: 월, 07 3월 2022 18:08:13 +0900 Subject: [PATCH] Merge branch 'master' of http://maprex.iptime.org:9001/r/owl-kisa --- src/main/resources/mybatis/query-template/companyField-template.xml | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 54 insertions(+), 2 deletions(-) diff --git a/src/main/resources/mybatis/query-template/companyField-template.xml b/src/main/resources/mybatis/query-template/companyField-template.xml index 61f27e8..4973732 100644 --- a/src/main/resources/mybatis/query-template/companyField-template.xml +++ b/src/main/resources/mybatis/query-template/companyField-template.xml @@ -11,6 +11,9 @@ cf.tel as tel, cf.email as email, cf.url as url, + cf.ip_start as ipStart, + cf.ip_end as ipEnd, + concat(cf.ip_start, "~", cf.ip_end) AS ipRange, cf.memo as memo, cf.isp_id as ispId, cf.hosting_id as hostingId, @@ -33,8 +36,16 @@ <if test="id != '' and id != null"> AND cf.id like CONCAT('%',#{id},'%') </if> - <if test="url != '' and id != url"> - AND cf.url like CONCAT('%',#{url},'%') + <choose> + <when test="url != null and url.size != 0"> + AND + <foreach collection="url" item="item" index="index" separator="or" open="(" close=")"> + cf.url LIKE CONCAT('%',#{item},'%') + </foreach> + </when> + </choose> + <if test="ip != '' and ip != null"> + AND INET_ATON(cf.ip_start) <![CDATA[ <= ]]> #{ip} AND INET_ATON(cf.ip_end) >= #{ip} </if> ORDER BY cf.register_date DESC <if test="pageSize != '' and pageSize != null"> @@ -55,4 +66,45 @@ AND cf.id like CONCAT('%',#{id},'%') </if> </select> + + <select id="findByUrls" resultType="kr.wisestone.owl.domain.CompanyField" parameterType="kr.wisestone.owl.web.condition.CompanyFieldCondition"> + SELECT + cf.id as id, + cf.name as name, + cf.email as email, + cf.url as url + FROM + company_field cf + WHERE 1=1 + <choose> + <when test="url != null and url.size != 0"> + AND + <foreach collection="url" item="item" index="index" separator="or" open="(" close=")"> + cf.url LIKE CONCAT('%',#{item},'%') + </foreach> + </when> + </choose> + </select> + + <select id="findByUrlsAndIdNot" resultType="kr.wisestone.owl.domain.CompanyField" parameterType="kr.wisestone.owl.web.condition.CompanyFieldCondition"> + SELECT + cf.id as id, + cf.name as name, + cf.email as email, + cf.url as url + FROM + company_field cf + WHERE 1=1 + <choose> + <when test="url != null and url.size != 0"> + AND + <foreach collection="url" item="item" index="index" separator="or" open="(" close=")"> + cf.url LIKE CONCAT('%',#{item},'%') + </foreach> + </when> + </choose> + <if test="id != '' and id != null"> + AND cf.id not like CONCAT('%',#{id},'%') + </if> + </select> </mapper> \ No newline at end of file -- Gitblit v1.8.0