BizPaywayMapper.xml 7.6 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.runsa.portal.base.dao.BizPaywayMapper" >
  <resultMap id="BaseResultMap" type="cn.runsa.portal.base.entity.BizPayway" >
    <id column="bepId" property="id" jdbcType="INTEGER" />
    <result column="bebId" property="bebid" jdbcType="INTEGER" />
    <result column="pwId" property="pwid" jdbcType="INTEGER" />
    <result column="beaId" property="beaid" jdbcType="INTEGER" />
    <result column="bepAccount" property="account" jdbcType="VARCHAR" />
    <result column="bepProceeds" property="proceeds" jdbcType="VARCHAR" />
    <result column="bepPayee" property="payee" jdbcType="VARCHAR" />
    <result column="bepIncome" property="income" jdbcType="BIT" />
    <result column="bepPoint" property="point" jdbcType="BIT" />
    <result column="piId" property="piid" jdbcType="INTEGER" />
    <result column="ptValid" property="valid" jdbcType="SMALLINT" />
    <result column="ptRemark1" property="remark1" jdbcType="VARCHAR" />
    <result column="ptUpTime" property="uptime" jdbcType="TIMESTAMP" />
    <result column="ptUpdater" property="updater" jdbcType="INTEGER" />
     <!-- 店铺收款方式名称和ID -->
    <result column="sipId" property="sipId" jdbcType="INTEGER" />
    <result column="sipName" property="sipName" jdbcType="VARCHAR" />
    
    <result column="cuId" property="cuid" jdbcType="INTEGER" />
    <result column="cuName" property="cuname" jdbcType="VARCHAR" /> 
    <result column="cuRate" property="curate" jdbcType="DECIMAL" /> 
  </resultMap>
  <sql id="Base_Column_List" >
    bepId, bebId, pwId, beaId, bepAccount, bepProceeds, bepPayee, bepIncome, 
    bepPoint, piId, ptValid, ptRemark1, ptUpTime, ptUpdater
  </sql>
  <select id="findById" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
	SELECT
	t1.bepId,
	t1.bebId,
	t1.pwId,
	t1.beaId,
	t1.bepAccount,
	t1.bepProceeds,
	t1.bepPayee,
	t1.bepIncome,
	t1.bepPoint,
	t1.piId,
	t1.ptValid,
	t2.pwName,
	t3.cuName,
	t3.cuRate
	FROM
	mtBizPayway t1
	LEFT JOIN mtPayway t2 ON t1.pwId = t2.pwId
	LEFT JOIN mtCurrencyUnit t3 ON t3.cuId=t2.cuId
	WHERE t1.bepId=#{id,jdbcType=INTEGER} 
  </select>
  <select id="findList" resultMap="BaseResultMap" parameterType="cn.runsa.portal.base.entity.BizPayway" >
    select 
    <include refid="Base_Column_List" />
    from mtBizPayway
    where bebId = #{bebid,jdbcType=INTEGER}
  </select>
  <delete id="delete" parameterType="java.lang.Integer" >
    delete from mtBizPayway
    where bepId = #{id,jdbcType=INTEGER}
  </delete>
  <delete id="deleteByebId" parameterType="java.lang.Integer" >
    delete from mtBizPayway
    where bebId = #{bebid,jdbcType=INTEGER}
  </delete>
  <insert id="insert" useGeneratedKeys="true" keyProperty="id" parameterType="cn.runsa.portal.base.entity.BizPayway" >
    insert into mtBizPayway (bebId, pwId, 
      beaId, bepAccount, bepProceeds, 
      bepPayee, bepIncome, bepPoint, 
      piId, ptValid, ptRemark1, 
      ptUpTime, ptUpdater)
    values (#{bebid,jdbcType=INTEGER}, #{pwid,jdbcType=INTEGER}, 
      #{beaid,jdbcType=INTEGER}, #{account,jdbcType=VARCHAR}, #{proceeds,jdbcType=VARCHAR}, 
      #{payee,jdbcType=VARCHAR}, #{income,jdbcType=BIT}, #{point,jdbcType=BIT}, 
      #{piid,jdbcType=INTEGER}, #{valid,jdbcType=SMALLINT}, #{remark1,jdbcType=VARCHAR}, 
      #{uptime,jdbcType=TIMESTAMP}, #{updater,jdbcType=INTEGER})
  </insert>
  <insert id="insertSelective" useGeneratedKeys="true" keyProperty="id" parameterType="cn.runsa.portal.base.entity.BizPayway" >
    insert into mtBizPayway
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="bebid != null" >
        bebId,
      </if>
      <if test="pwid != null" >
        pwid,
      </if>
      <if test="beaid != null" >
        beaId,
      </if>
      <if test="account != null" >
        bepAccount,
      </if>
      <if test="proceeds != null" >
        bepProceeds,
      </if>
      <if test="payee != null" >
        bepPayee,
      </if>
      <if test="income != null" >
        bepIncome,
      </if>
      <if test="point != null" >
        bepPoint,
      </if>
      <if test="piid != null" >
        piId,
      </if>
      <if test="valid != null" >
        ptValid,
      </if>
      <if test="remark1 != null" >
        ptRemark1,
      </if>
      <if test="uptime != null" >
        ptUpTime,
      </if>
      <if test="updater != null" >
        ptUpdater,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="bebid != null" >
        #{bebid,jdbcType=INTEGER},
      </if>
      <if test="pwid != null" >
        #{pwid,jdbcType=INTEGER},
      </if>
      <if test="beaid != null" >
        #{beaid,jdbcType=INTEGER},
      </if>
      <if test="account != null" >
        #{account,jdbcType=VARCHAR},
      </if>
      <if test="proceeds != null" >
        #{proceeds,jdbcType=VARCHAR},
      </if>
      <if test="payee != null" >
        #{payee,jdbcType=VARCHAR},
      </if>
      <if test="income != null" >
        #{income,jdbcType=BIT},
      </if>
      <if test="point != null" >
        #{point,jdbcType=BIT},
      </if>
      <if test="piid != null" >
        #{piid,jdbcType=INTEGER},
      </if>
      <if test="valid != null" >
        #{valid,jdbcType=SMALLINT},
      </if>
      <if test="remark1 != null" >
        #{remark1,jdbcType=VARCHAR},
      </if>
      <if test="uptime != null" >
        #{uptime,jdbcType=TIMESTAMP},
      </if>
      <if test="updater != null" >
        #{updater,jdbcType=INTEGER},
      </if>
    </trim>
  </insert>
  <update id="updateSelective" parameterType="cn.runsa.portal.base.entity.BizPayway" >
    update mtBizPayway
    <set >
      <if test="bebid != null" >
        bebId = #{bebid,jdbcType=INTEGER},
      </if>
      <if test="pwid != null" >
        cuId = #{cuid,jdbcType=INTEGER},
      </if>
      <if test="beaid != null" >
        beaId = #{beaid,jdbcType=INTEGER},
      </if>
      <if test="account != null" >
        bepAccount = #{account,jdbcType=VARCHAR},
      </if>
      <if test="proceeds != null" >
        bepProceeds = #{proceeds,jdbcType=VARCHAR},
      </if>
      <if test="payee != null" >
        bepPayee = #{payee,jdbcType=VARCHAR},
      </if>
      <if test="income != null" >
        bepIncome = #{income,jdbcType=BIT},
      </if>
      <if test="point != null" >
        bepPoint = #{point,jdbcType=BIT},
      </if>
      <if test="piid != null" >
        piId = #{piid,jdbcType=INTEGER},
      </if>
      <if test="valid != null" >
        ptValid = #{valid,jdbcType=SMALLINT},
      </if>
      <if test="remark1 != null" >
        ptRemark1 = #{remark1,jdbcType=VARCHAR},
      </if>
      <if test="uptime != null" >
        ptUpTime = #{uptime,jdbcType=TIMESTAMP},
      </if>
      <if test="updater != null" >
        ptUpdater = #{updater,jdbcType=INTEGER},
      </if>
    </set>
    where bepId = #{id,jdbcType=INTEGER}
  </update>
  <update id="update" parameterType="cn.runsa.portal.base.entity.BizPayway" >
    update mtBizPayway
    set bebId = #{bebid,jdbcType=INTEGER},
      pwId = #{pwid,jdbcType=INTEGER},
      beaId = #{beaid,jdbcType=INTEGER},
      bepAccount = #{account,jdbcType=VARCHAR},
      bepProceeds = #{proceeds,jdbcType=VARCHAR},
      bepPayee = #{payee,jdbcType=VARCHAR},
      bepIncome = #{income,jdbcType=BIT},
      bepPoint = #{point,jdbcType=BIT},
      piId = #{piid,jdbcType=INTEGER},
      ptValid = #{valid,jdbcType=SMALLINT},
      ptRemark1 = #{remark1,jdbcType=VARCHAR},
      ptUpTime = #{uptime,jdbcType=TIMESTAMP},
      ptUpdater = #{updater,jdbcType=INTEGER}
    where bepId = #{id,jdbcType=INTEGER}
  </update>
</mapper>