<?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="MobileTreatmentProcedure">
	<select id="selectTotalTreatmentProcedureOptionCount" parameterType="hashMap" resultType="hashMap">
		SELECT COUNT(*)                           AS "totalCount"
		  FROM MU_TREATMENT AS MT
		  INNER JOIN MU_TREATMENT_PROCEDURE AS MTP
		  ON MT.MU_TREATMENT_ID                 = MTP.MU_TREATMENT_ID
			  AND MT.USE_YN                     = 'Y'
			  AND MTP.USE_YN                    = 'Y'
		      AND MTP.MU_TREATMENT_ID           = #{muTreatmentId}
	</select>

	<select id="selectListTreatmentProcedureOption" parameterType="hashMap" resultType="hashMap">
		SELECT MT.MU_TREATMENT_ID                 AS "muTreatmentId"
			  ,MT.TREATMENT_NAME                  AS "treatmentName"
			  ,MTP.MU_TREATMENT_PROCEDURE_ID      AS "muTreatmentProcedureId"
			  ,MTP.TREATMENT_PROCEDURE_NAME       AS "treatmentProcedureName"
		  FROM MU_TREATMENT AS MT
	INNER JOIN MU_TREATMENT_PROCEDURE AS MTP
			ON MT.MU_TREATMENT_ID = MTP.MU_TREATMENT_ID
		   AND MT.USE_YN          = 'Y'
		   AND MTP.USE_YN         = 'Y'
		   AND MTP.ENABLE_YN                      = 'Y'
		   AND MT.MU_TREATMENT_ID = #{muTreatmentId}
		WHERE TREATMENT_NAME != '멤버십'
	  ORDER BY MT.ORDER_NUMBER ASC ,MTP.TREATMENT_PROCEDURE_NAME ASC
	</select>
</mapper>