| | |
| | | </foreach> |
| | | </when> |
| | | </choose> |
| | | <if test="ip != null and ip != ''"> |
| | | <if test="ip != null and ip != '' and ip > -1"> |
| | | AND INET_ATON(cf.ip_start) <![CDATA[ <= ]]> #{ip} AND INET_ATON(cf.ip_end) >= #{ip} |
| | | </if> |
| | | ORDER BY cf.register_date DESC |
| | |
| | | <foreach collection="urls" 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> |
| | | |
| | | <select id="findByIps" 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, |
| | | cf.ip_start AS ipStart, |
| | | cf.ip_end AS ipEnd |
| | | FROM |
| | | company_field cf |
| | | WHERE 1=1 |
| | | <choose> |
| | | <when test="ipStart != null and ipStart != '' and ipEnd != null and ipEnd != ''"> |
| | | AND (INET_ATON(cf.ip_start) BETWEEN #{ipStart} AND #{ipEnd} OR INET_ATON(cf.ip_end) BETWEEN #{ipStart} AND #{ipEnd} |
| | | OR #{ipStart} BETWEEN INET_ATON(cf.ip_start) AND INET_ATON(cf.ip_end) OR #{ipEnd} BETWEEN INET_ATON(cf.ip_start) AND INET_ATON(cf.ip_end)) |
| | | </when> |
| | | </choose> |
| | | </select> |
| | | |
| | | <select id="findByIpsAndIdNot" 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, |
| | | cf.ip_start AS ipStart, |
| | | cf.ip_end AS ipEnd |
| | | FROM |
| | | company_field cf |
| | | WHERE 1=1 |
| | | <choose> |
| | | <when test="ipStart != null and ipStart != '' and ipEnd != null and ipEnd != ''"> |
| | | AND (INET_ATON(cf.ip_start) BETWEEN #{ipStart} AND #{ipEnd} OR INET_ATON(cf.ip_end) BETWEEN #{ipStart} AND #{ipEnd} |
| | | OR #{ipStart} BETWEEN INET_ATON(cf.ip_start) AND INET_ATON(cf.ip_end) OR #{ipEnd} BETWEEN INET_ATON(cf.ip_start) AND INET_ATON(cf.ip_end)) |
| | | </when> |
| | | </choose> |
| | | <if test="id != '' and id != null"> |