<?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="MdeActivityDetailMapper" >
  <resultMap id="BaseResultMap" type="com.wechat.model.dbEntity.MdeActivityDetail" >
    <id column="PRIZE_ID" property="prizeId" jdbcType="VARCHAR" />
    <id column="ACT_ID" property="actId" jdbcType="INTEGER" />
    <result column="PRIZE_NAME_CN" property="prizeNameCn" jdbcType="VARCHAR" />
    <result column="PRIZE_NAME_EN" property="prizeNameEn" jdbcType="VARCHAR" />
    <result column="CONDITION_CN" property="conditionCn" jdbcType="VARCHAR" />
    <result column="CONDITION_EN" property="conditionEn" jdbcType="VARCHAR" />
    <result column="EXCHANGE_QUALITY" property="exchangeQuality" jdbcType="INTEGER" />
    <result column="EXCHANGE_NORMAL" property="exchangeNormal" jdbcType="INTEGER" />
	<result column="IMG_PC" property="imgPc" jdbcType="VARCHAR" />
    <result column="IMG_MOBILE" property="imgMobile" jdbcType="VARCHAR" />
    <result column="SORT" property="sort" jdbcType="INTEGER" />
    <result column="VERSION_NO" property="versionNo" jdbcType="INTEGER" />
    <result column="REMARKS" property="remarks" jdbcType="VARCHAR" />
    <result column="DEL_FLAG" property="delFlag" jdbcType="INTEGER" />
    <result column="CREATE_BY" property="createBy" jdbcType="VARCHAR" />
    <result column="CREATE_DATE" property="createDate" jdbcType="TIMESTAMP" />
    <result column="UPDATE_BY" property="updateBy" jdbcType="VARCHAR" />
    <result column="UPDATE_DATE" property="updateDate" jdbcType="TIMESTAMP" />
  </resultMap>
  <sql id="Base_Column_List" >
    PRIZE_ID, ACT_ID, PRIZE_NAME_CN, PRIZE_NAME_EN, CONDITION_CN, CONDITION_EN, EXCHANGE_QUALITY, EXCHANGE_NORMAL, SORT, VERSION_NO, REMARKS, 
    DEL_FLAG, CREATE_BY, CREATE_DATE, UPDATE_BY, UPDATE_DATE
  </sql>
  <select id="getActivityDetails" resultType="com.wechat.model.dto.ActivityDetailDto"  >
    select 
    	PRIZE_ID as prizeId, 
    	ACT_ID as actId, 
    	PRIZE_NAME_CN as prizeNameCn, 
    	PRIZE_NAME_EN as prizeNameEn, 
    	CONDITION_CN as conditionCn, 
    	CONDITION_EN as conditionEn, 
    	IMG_PC as imgPc,
    	IMG_MOBILE as imgMobile,
    	EXCHANGE_QUALITY as exchangeQuality, 
    	EXCHANGE_NORMAL as exchangeNormal
    from mde_activity_detail
    where ACT_ID = #{actId}
      and DEL_FLAG = 0
      order by SORT
  </select>
  
  <delete id="deleteByPrimaryKey" parameterType="com.wechat.model.dbEntity.MdeActivityDetail" >
    delete from mde_activity_detail
    where PRIZE_ID = #{prizeId,jdbcType=VARCHAR}
      and ACT_ID = #{actId,jdbcType=INTEGER}
  </delete>

</mapper>