ReceptionMaterialRecommendPackageConfigMapper.xml 2.61 KB
<?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="cn.com.glsx.dj.mindworkplate.mapper.ReceptionMaterialRecommendPackageConfigMapper" >
  <resultMap id="BaseResultMap" type="cn.com.glsx.dj.mindworkplate.model.ReceptionMaterialRecommendPackageConfig" >
    <!--
      WARNING - @mbg.generated
    -->
    <id column="id" property="id" jdbcType="INTEGER" />
    <result column="merchant_config_id" property="merchantConfigId" jdbcType="INTEGER" />
    <result column="type" property="type" jdbcType="TINYINT" />
    <result column="name" property="name" jdbcType="VARCHAR" />
    <result column="content" property="content" jdbcType="VARCHAR" />
    <result column="market_price" property="marketPrice" jdbcType="DECIMAL" />
    <result column="package_price" property="packagePrice" jdbcType="DECIMAL" />
    <result column="discount_Price" property="discountPrice" jdbcType="DECIMAL" />
    <result column="brief_introduction" property="briefIntroduction" jdbcType="VARCHAR" />
    <result column="script_introduction" property="scriptIntroduction" jdbcType="VARCHAR" />
    <result column="top_flag" property="topFlag" jdbcType="CHAR" />
    <result column="created_by" property="createdBy" jdbcType="VARCHAR" />
    <result column="created_date" property="createdDate" jdbcType="TIMESTAMP" />
    <result column="updated_by" property="updatedBy" jdbcType="VARCHAR" />
    <result column="updated_date" property="updatedDate" jdbcType="TIMESTAMP" />
    <result column="deleted_flag" property="deletedFlag" jdbcType="CHAR" />
  </resultMap>
  <sql id="Base_Column_List" >
    <!--
      WARNING - @mbg.generated
    -->
    id, merchant_config_id, type, name, content, market_price, package_price, discount_Price, 
    brief_introduction, script_introduction, top_flag, created_by, created_date, updated_by, 
    updated_date, deleted_flag
  </sql>
  <update id="deleteByMerchantConfigId">
  	update reception_material_recommend_package_config set deleted_flag='D',updated_by = #{updatedBy},updated_date=now()
  	where deleted_flag='N' and merchant_config_id = #{merchantConfigId}
  </update>
  
  <select id="list" resultMap="BaseResultMap">
  	select 
  		type, name, content, market_price, package_price, discount_Price,brief_introduction, script_introduction, top_flag, updated_date
    from reception_material_recommend_package_config
    <where>
    	deleted_flag='N'
    	<if test="merchantConfigId != null">
    		and merchant_config_id = #{merchantConfigId}
    	</if>
    </where>
    order by type asc,top_flag desc,id asc
  </select>
</mapper>