UnionOrderPushMapper.xml 1.35 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="com.yoho.unions.dal.IUnionOrderPushDAO" >
  <resultMap id="BaseResultMap" type="com.yoho.unions.dal.model.UnionOrderPush" >
    <id column="id" property="id" jdbcType="INTEGER" />
    <result column="channel_id" property="channelId" jdbcType="VARCHAR" />
    <result column="url" property="url" jdbcType="VARCHAR" />
    <result column="comm_rate" property="commRate" jdbcType="VARCHAR" />
    <result column="is_new" property="isNew" jdbcType="CHAR" />
  </resultMap>
  <sql id="Base_Column_List" >
    id, channel_id, url, comm_rate,is_new
  </sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
    select 
    <include refid="Base_Column_List" />
    from union_order_push
    where id = #{id,jdbcType=INTEGER}
  </select>
  <select id="selectByChannelId" resultMap="BaseResultMap">
    select  <include refid="Base_Column_List" />
    from union_order_push
    where channel_id = #{channelId,jdbcType=VARCHAR} limit 1
  </select>

  <select id="selectByChannelIdAndIsNew" resultMap="BaseResultMap">
    select <include refid="Base_Column_List" />
    from union_order_push where channel_id = #{channelId} and is_new = #{isNew} limit 1
  </select>
</mapper>