liurunyu
2024-10-08 dbe3ed318dfe013663271fd64c8b8b152005e0b6
pms-parent/pms-global/src/main/resources/mapper/PrScheduleRelMapper.xml
New file
@@ -0,0 +1,129 @@
<?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.dy.pmsGlobal.daoPr.PrScheduleRelMapper">
  <resultMap id="BaseResultMap" type="com.dy.pmsGlobal.pojoPr.PrScheduleRel">
    <!--@mbg.generated-->
    <!--@Table pr_schedule_rel-->
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="schedule_id" jdbcType="BIGINT" property="scheduleId" />
    <result column="plan_id" jdbcType="BIGINT" property="planId" />
    <result column="node_id" jdbcType="BIGINT" property="nodeId" />
    <result column="station_id" jdbcType="BIGINT" property="stationId" />
    <result column="work_details" jdbcType="VARCHAR" property="workDetails" />
    <association property="nodeName" column="node_id" javaType="java.lang.String"
                 select="com.dy.pmsGlobal.daoPr.PrProductionNodeMapper.selectNameByNodeId" fetchType="eager"/>
    <association property="planName" column="plan_id" javaType="java.lang.String"
                 select="com.dy.pmsGlobal.daoPr.PrAssemblyPlanMapper.selectNameByPlanId" fetchType="eager"/>
    <association property="stationName" column="station_id" javaType="java.lang.String"
                 select="com.dy.pmsGlobal.daoPlt.PltStationMapper.selectNameByStationId" fetchType="eager"/>
  </resultMap>
  <sql id="Base_Column_List">
    <!--@mbg.generated-->
    id, schedule_id, plan_id, node_id, station_id, work_details
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
    <!--@mbg.generated-->
    select
    <include refid="Base_Column_List" />
    from pr_schedule_rel
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    <!--@mbg.generated-->
    delete from pr_schedule_rel
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <insert id="insert" parameterType="com.dy.pmsGlobal.pojoPr.PrScheduleRel">
    <!--@mbg.generated-->
    insert into pr_schedule_rel (id, schedule_id, plan_id,
      node_id, station_id, work_details
      )
    values (#{id,jdbcType=BIGINT}, #{scheduleId,jdbcType=BIGINT}, #{planId,jdbcType=BIGINT},
      #{nodeId,jdbcType=BIGINT}, #{stationId,jdbcType=BIGINT}, #{workDetails,jdbcType=VARCHAR}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.dy.pmsGlobal.pojoPr.PrScheduleRel">
    <!--@mbg.generated-->
    insert into pr_schedule_rel
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="scheduleId!= null and scheduleId !=''">
        schedule_id,
      </if>
      <if test="planId != null">
        plan_id,
      </if>
      <if test="nodeId!= null">
        node_id,
      </if>
      <if test="stationId != null">
        station_id,
      </if>
      <if test="workDetails!= null and workDetails !=''">
        work_details,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=BIGINT},
      </if>
      <if test="scheduleId!= null and scheduleId !=''">
        #{scheduleId,jdbcType=BIGINT},
      </if>
      <if test="planId != null">
        #{planId,jdbcType=BIGINT},
      </if>
      <if test="nodeId!= null">
        #{nodeId,jdbcType=BIGINT},
      </if>
      <if test="stationId != null">
        #{stationId,jdbcType=BIGINT},
      </if>
      <if test="workDetails!= null and workDetails !=''">
        #{workDetails,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.dy.pmsGlobal.pojoPr.PrScheduleRel">
    <!--@mbg.generated-->
    update pr_schedule_rel
    <set>
      <if test="scheduleId!= null and scheduleId !=''">
        schedule_id = #{scheduleId,jdbcType=BIGINT},
      </if>
      <if test="planId != null">
        plan_id = #{planId,jdbcType=BIGINT},
      </if>
      <if test="nodeId!= null">
        node_id = #{nodeId,jdbcType=BIGINT},
      </if>
      <if test="stationId != null">
        station_id = #{stationId,jdbcType=BIGINT},
      </if>
      <if test="workDetails!= null and workDetails !=''">
        work_details = #{workDetails,jdbcType=VARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.dy.pmsGlobal.pojoPr.PrScheduleRel">
    <!--@mbg.generated-->
    update pr_schedule_rel
    set schedule_id = #{scheduleId,jdbcType=BIGINT},
      plan_id = #{planId,jdbcType=BIGINT},
      node_id = #{nodeId,jdbcType=BIGINT},
      station_id = #{stationId,jdbcType=BIGINT},
      work_details = #{workDetails,jdbcType=VARCHAR}
    where id = #{id,jdbcType=BIGINT}
  </update>
  <delete id="deleteByScheduleId">
    delete  from pr_schedule_rel where schedule_id=#{scheduleId}
  </delete>
  <select id="selectByScheduleId" resultMap="BaseResultMap">
    select * from pr_schedule_rel where schedule_id=#{scheduleId}
  </select>
</mapper>