and a.affair_category = #{affairCategory} and a.wrt_user_seq = #{wrtUserSeq} and a.wrt_user_nm like '%'||#{wrtUserNm}||'%' and a.wrt_organ = #{wrtOrgan} and a.affair_type1 = #{affairType1} and a.affair_type2 = #{affairType2} and a.affair_type3 = #{affairType3} and a.affair_type4 = #{affairType4} and a.title like '%'||#{title}||'%' and c.affair_status = #{affairStatus} and a.wrt_dt >= #{startDate}::date and a.wrt_dt <= #{endDate}::date+1 and c.rating_organ = #{ratingOrgan} and a.wrt_organ in #{organCd} and c.affair_status in ('DST002', 'DST004') and c.affair_status in ('DST003', 'DST005', 'DST006') and c.affair_status in ('DST003', 'DST004', 'DST005', 'DST006') and c.affair_status in ('DST003', 'DST005', 'DST006') and c.affair_status in ('DST002', 'DST004') and c.affair_status in ('DST003', 'DST005', 'DST006') and wrt_user_nm like '%'||#{userNm}||'%' and wrt_dt >= #{startDate}::date and wrt_dt <= #{endDate}::date+1 and ab.affair_key in ( select affair_key from affair_rating ar2 inner join organ_config oc2 on ar2.rating_organ = oc2.organ_cd and ar2.affair_rate in #{item} and ar2.organ_up = 'T' and oc2.organ_type in #{item} ) and item_cd in #{item} and item_cd not in (select item_cd from code_mgt where category_cd = 'DC01') and item_cd in #{item} and item_cd not in (select item_cd from code_mgt where category_cd = 'DC02') and item_cd in #{item} and item_cd not in (select item_cd from code_mgt where category_cd = 'DC03') and item_cd in #{item} and item_cd not in (select item_cd from code_mgt where category_cd = 'DC04') and wrt_user_nm like '%'||#{userNm}||'%' and wrt_dt >= #{startDate}::date and wrt_dt <= #{endDate}::date+1 and ab.affair_key in ( select affair_key from affair_rating ar2 inner join organ_config oc2 on ar2.rating_organ = oc2.organ_cd and ar2.affair_rate in #{item} and ar2.organ_up = 'T' and oc2.organ_type in #{item} ) and affair_type1 in #{item} and affair_type2 in #{item} and affair_type3 in #{item} and affair_type4 in #{item}