<?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="kr.co.jinwoosi.clfd.clfd.dgns.mapper.DgnsAnsMapper">
    <sql id="where">
        <if test="!empty(dgnsAnsId)"> AND DGNS_ANS_ID = #{dgnsAnsId}</if>
        <if test="!empty(dgnsAskId)"> AND DGNS_ASK_ID = #{dgnsAskId}</if>
    </sql>
    <select id="selectList" parameterType="dgnsAnsSearch" resultType="dgnsAns">
        SELECT *
        FROM CF_DGNS_ANS
        WHERE 1=1
            AND REC_ST = 'Y'
            <include refid="where"/>
    </select>
    <select id="select" parameterType="dgnsAnsSearch" resultType="dgnsAns">
        SELECT *
        FROM CF_DGNS_ANS
        WHERE DGNS_ANS_ID = #{dgnsAnsId}
    </select>
</mapper>
