"left join SPECIAL_CARD on SPECIAL_CARD.ACCEPT_NO = prod_card_t.accept_no\n"+
"left join GROUP_NO on GROUP_NO.GROUP_NO = SPECIAL_CARD.GROUP_NO \n"+
"left join task on task.task_id =SPECIAL_CARD.task_id \n"+
"left join PRODYD_DBA.DIC_UPLOAD_UNIT_T@PRODYD_LINK on subStr(prod_card_t.UPLOAD_NO,0,9)= subStr(DIC_UPLOAD_UNIT_T.UPLOAD_UNIT_NO,0,9) \n"+
"LEFT JOIN PRODYD_DBA.PROD_GROUP_RELATION_T@PRODYD_LINK on PROD_GROUP_RELATION_T.GROUP_NO = subStr(prod_card_t.ACCEPT_NO,0,8) \n"+
"LEFT JOIN PRODYD_DBA.DIC_UPLOAD_UNIT_T@PRODYD_LINK on PROD_GROUP_RELATION_T.UPLOAD_UNIT_NO=DIC_UPLOAD_UNIT_T.UPLOAD_UNIT_NO \n"+
"where prod_card_t.id_no=#{id} and prod_card_t.BEGIN_DATE= #{beginDate} and prod_card_t.EXPIRE_DATE = #{expireDate} \n"+
"group by GROUP_NO.GROUP_NO, prod_card_t.accept_no, DIC_UPLOAD_UNIT_T.UPLOAD_UNIT_NO, DIC_UPLOAD_UNIT_T.UNIT_NAME, task.CARD_TYPE, task.OLD_CARD_TYPE ")
"group by PROD_GROUP_RELATION_T.GROUP_NO,prod_card_t.accept_no,DIC_UPLOAD_UNIT_T.UPLOAD_UNIT_NO,DIC_UPLOAD_UNIT_T.UNIT_NAME,task.CARD_TYPE,task.OLD_CARD_TYPE")
"left join group_no on group_no.group_no =subStr(prod_card_t.accept_no,0,8)\n"+
"left join task on task.task_id =group_no.task_id \n"+
"left join PRODYD_DBA.DIC_UPLOAD_UNIT_T@PRODYD_LINK on subStr(prod_card_t.UPLOAD_NO,0,9)= subStr(DIC_UPLOAD_UNIT_T.UPLOAD_UNIT_NO,0,9) \n"+
"left join PRODYD_DBA.PROD_GROUP_RELATION_T@PRODYD_LINK on subStr(prod_card_t.accept_no,0,8) = PROD_GROUP_RELATION_T.GROUP_NO \n"+
"left join PRODYD_DBA.DIC_UPLOAD_UNIT_T@PRODYD_LINK ON PROD_GROUP_RELATION_T.UPLOAD_UNIT_NO=DIC_UPLOAD_UNIT_T.UPLOAD_UNIT_NO \n"+
"where substr(prod_card_t.accept_no,0,8) =substr(#{groupNo},0,8) and prod_card_t.accept_no not in (select accept_no from SPECIAL_CARD where accept_no like #{groupNo} ) \n"+
"group by prod_card_t.accept_no,DIC_UPLOAD_UNIT_T.UPLOAD_UNIT_NO, DIC_UPLOAD_UNIT_T.UNIT_NAME, task.CARD_TYPE,task.OLD_CARD_TYPE,prod_card_t.id_no,prod_card_t.sex_no,prod_card_t.upload_no")