<?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="WebDevice">

	<select id="selectListDevice" parameterType="hashmap" resultType="hashmap">
		SELECT MD.MU_DEVICE_ID  AS "muDeviceId"
			  ,MD.PHONE_TYPE    AS "phoneType"
			  ,MD.DEVICE_UUID   AS "deviceUuid"
			  ,MD.PUSH_KEY      AS "pushKey"
		      ,MU.MU_USER_ID    AS "muUserId"
		      ,MU.USER_NAME     AS "userName"
		  FROM MU_DEVICE AS MD
    INNER JOIN MU_USER AS MU
		  	ON MD.MU_USER_ID = MU.MU_USER_ID
		   AND MD.USE_YN      = 'Y'
		   AND MU.USE_YN      = 'Y'
		   AND MD.MU_USER_ID IN (${muUserIdList})
		   AND MD.MARKETING_PUSH_YN = 'Y'
		   AND MD.STATUS = 'Y'
	</select>

	<select id="selectListDevice2" parameterType="hashmap" resultType="hashmap">
		SELECT MD.MU_DEVICE_ID  AS "muDeviceId"
			  ,MD.PHONE_TYPE    AS "phoneType"
			  ,MD.DEVICE_UUID   AS "deviceUuid"
			  ,MD.PUSH_KEY      AS "pushKey"
		      ,MU.MU_USER_ID    AS "muUserId"
		      ,MU.USER_NAME     AS "userName"
		  FROM MU_DEVICE AS MD
    INNER JOIN MU_USER AS MU
		  	ON MD.MU_USER_ID = MU.MU_USER_ID
		   AND MD.USE_YN      = 'Y'
		   AND MU.USE_YN      = 'Y'
		   AND MD.MU_USER_ID = #{muUserId}
		   AND MD.AUTO_PUSH_YN = 'Y'
		   AND MD.STATUS = 'Y'
	</select>
</mapper>