WaveFlowDetailMapper.xml 2.84 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.huaheng.pc.config.waveFlowDetail.mapper.WaveFlowDetailMapper">
  <resultMap id="BaseResultMap" type="com.huaheng.pc.config.waveFlowDetail.domain.WaveFlowDetail">
    <!--@mbg.generated-->
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="headerId" jdbcType="INTEGER" property="headerId" />
    <result column="waveFlowCode" jdbcType="VARCHAR" property="waveFlowCode" />
    <result column="warehouseCode" jdbcType="VARCHAR" property="warehouseCode" />
    <result column="sequence" jdbcType="INTEGER" property="sequence" />
    <result column="waveStepCode" jdbcType="VARCHAR" property="waveStepCode" />
    <result column="waveStepName" jdbcType="VARCHAR" property="waveStepName" />
    <result column="value1" jdbcType="VARCHAR" property="value1" />
    <result column="value2" jdbcType="VARCHAR" property="value2" />
    <result column="value3" jdbcType="VARCHAR" property="value3" />
    <result column="value4" jdbcType="VARCHAR" property="value4" />
    <result column="created" jdbcType="TIMESTAMP" property="created" />
    <result column="createdBy" jdbcType="VARCHAR" property="createdBy" />
    <result column="lastUpdated" jdbcType="TIMESTAMP" property="lastUpdated" />
    <result column="lastUpdatedBy" jdbcType="VARCHAR" property="lastUpdatedBy" />
    <result column="version" jdbcType="INTEGER" property="version" />
    <result column="userDef1" jdbcType="VARCHAR" property="userDef1" />
    <result column="userDef2" jdbcType="VARCHAR" property="userDef2" />
    <result column="userDef3" jdbcType="VARCHAR" property="userDef3" />
    <result column="userDef4" jdbcType="VARCHAR" property="userDef4" />
    <result column="processStamp" jdbcType="VARCHAR" property="processStamp" />
  </resultMap>
  <sql id="Base_Column_List">
    <!--@mbg.generated-->
    id, headerId, waveFlowCode, warehouseCode, `sequence`, waveStepCode, waveStepName, 
    value1, value2, value3, value4, created, createdBy, lastUpdated, lastUpdatedBy, version, 
    userDef1, userDef2, userDef3, userDef4,  processStamp
  </sql>


  <insert id="waveFlowDetailCopy">
  insert into wave_flow_detail(headerId, waveFlowCode, warehouseCode, `sequence`, waveStepCode, waveStepName,
    value1, value2, value3, value4, createdBy, lastUpdatedBy, version,processStamp)
    select  headerId, waveFlowCode, #{newCode}, `sequence`, waveStepCode, waveStepName,
    value1, value2, value3, value4, createdBy, lastUpdatedBy, version, processStamp from wave_flow_detail
    where warehouseCode =#{code}


  </insert>

 <update id="updateHeaderId">
  update wave_flow_detail d
	inner join wave_flow_header t
	on t.code=d.waveFlowCode and d.warehouseCode=t.warehouseCode and d.warehouseCode=#{code}
	set d.headerId=t.id

 </update>

</mapper>