<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
<mapper namespace="kr.wisestone.owl.mapper.CustomFieldMapper">
|
|
<select id="find" resultType="java.util.HashMap" parameterType="kr.wisestone.owl.web.condition.CustomFieldCondition">
|
SELECT
|
DISTINCT cf.id as id,
|
cf.name as name,
|
cf.custom_field_type as customFieldType,
|
cf.default_value as defaultValue
|
FROM
|
custom_field cf
|
INNER JOIN workspace ws on cf.workspace_id = ws.id
|
WHERE cf.use_flag = 'Y'
|
<if test="name != '' and name != null">
|
AND cf.name like CONCAT('%',#{name},'%')
|
</if>
|
<choose>
|
<when test="customFieldTypes.size != 0">
|
AND cf.custom_field_type IN
|
<foreach collection="customFieldTypes" item="item" index="index" separator="," open="(" close=")">
|
#{item}
|
</foreach>
|
</when>
|
</choose>
|
AND ws.id = #{workspaceId}
|
ORDER BY cf.id DESC
|
<if test="page != null and !page.equals('')">
|
limit #{pageSize} offset #{page};
|
</if>
|
</select>
|
|
<select id="count" resultType="java.lang.Long" parameterType="kr.wisestone.owl.web.condition.CustomFieldCondition">
|
SELECT
|
COUNT(DISTINCT cf.id)
|
FROM
|
custom_field cf
|
INNER JOIN workspace ws on cf.workspace_id = ws.id
|
WHERE cf.use_flag = 'Y'
|
<if test="name != '' and name != null">
|
AND cf.name like CONCAT('%',#{name},'%')
|
</if>
|
<choose>
|
<when test="customFieldTypes.size != 0">
|
AND cf.custom_field_type IN
|
<foreach collection="customFieldTypes" item="item" index="index" separator="," open="(" close=")">
|
#{item}
|
</foreach>
|
</when>
|
</choose>
|
AND ws.id = #{workspaceId}
|
</select>
|
|
</mapper>
|