Fancy
2024-07-05 eead3af59c94c35422463fbbd19d26dffcbacc06
pms-parent/pms-global/src/main/resources/mapper/StaAssemblyWorkLastMapper.xml
@@ -20,12 +20,20 @@
            <result property="assistants" column="assistants" jdbcType="VARCHAR"/>
            <association property="userName" column="user_id" javaType="java.lang.Long"
                     select="com.dy.pmsGlobal.daoBa.BaUserMapper.selectNameByUserId" fetchType="eager" />
            <association property="stationName" column="station_id" javaType="java.lang.Long"
       <!-- <association property="stationName" column="station_id" javaType="java.lang.Long"
                     select="com.dy.pmsGlobal.daoPlt.PltStationMapper.selectNameByStationId" fetchType="eager" />
        <association property="planName" column="plan_id" javaType="java.lang.Long"
                     select="com.dy.pmsGlobal.daoPr.PrAssemblyPlanMapper.selectNameByPlanId" fetchType="eager"/>
        <association property="processName" column="process_id" javaType="java.lang.Long"
                     select="com.dy.pmsGlobal.daoPr.PrProductionProcessMapper.selectProcessNameById" fetchType="eager"/>
        <association property="nodeName" column="node_id" javaType="java.lang.Long"
                     select="com.dy.pmsGlobal.daoPr.PrProductionNodeMapper.selectNameByNodeId" fetchType="eager"/>-->
            <association property="lineName" column="line_id" javaType="java.lang.Long"
                     select="com.dy.pmsGlobal.daoPlt.PltProductionLineMapper.selectNameByLineId" fetchType="eager" />
            <collection property="assistantsList" ofType="com.dy.pmsGlobal.pojoBa.BaUser"
                    select="com.dy.pmsGlobal.daoBa.BaUserMapper.selectByAssistants" fetchType="eager" column="assistants" />
                    select="com.dy.pmsGlobal.daoBa.BaUserMapper.selectByAssistants" fetchType="eager"
                    column="assistants"/>
    </resultMap>
    <resultMap id="SelectResultMap" type="com.dy.pmsGlobal.pojoSta.StaAssemblyWorkLast">
@@ -49,29 +57,58 @@
        <result property="nodeName" column="node_name" jdbcType="VARCHAR"/>
        <result property="lineName" column="line_name" jdbcType="VARCHAR"/>
        <collection property="assistantsList" ofType="com.dy.pmsGlobal.pojoBa.BaUser"
                    select="com.dy.pmsGlobal.daoBa.BaUserMapper.selectByAssistants" fetchType="eager" column="assistants" />
                    select="com.dy.pmsGlobal.daoBa.BaUserMapper.selectByAssistants" fetchType="eager"
                    column="assistants"/>
    </resultMap>
    <sql id="Base_Column_List">
        id,user_id,line_id,
        id
        ,user_id,line_id,
        station_id,plan_id,process_id,
        node_id,node_type,dt,status,
        start_time,end_time,assistants
    </sql>
    <sql id="part_Column_List">
        ${alias}.id,
        ${alias}.user_id,
        ${alias}.line_id,
        ${alias}.station_id,
        ${alias}.plan_id,
        ${alias}.process_id,
        ${alias}.node_id,
        ${alias}.node_type,
        ${alias}.dt,
        ${alias}.status,
        ${alias}.start_time,
        ${alias}.end_time,
        ${alias}.assistants
        ${alias}
        .
        id
        ,
        ${alias}
        .
        user_id,
        ${alias}
        .
        line_id,
        ${alias}
        .
        station_id,
        ${alias}
        .
        plan_id,
        ${alias}
        .
        process_id,
        ${alias}
        .
        node_id,
        ${alias}
        .
        node_type,
        ${alias}
        .
        dt,
        ${alias}
        .
        status,
        ${alias}
        .
        start_time,
        ${alias}
        .
        end_time,
        ${alias}
        .
        assistants
    </sql>
    <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
        select
@@ -146,7 +183,8 @@
        select
        <include refid="part_Column_List" >
            <property name="alias" value="l"/>
        </include>,
        </include>
        ,
               u.name as user_name,
               s.name as station_name,
               p.name as plan_name,
@@ -280,23 +318,25 @@
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
        delete from sta_assembly_work_last
        delete
        from sta_assembly_work_last
        where  id = #{id,jdbcType=BIGINT} 
    </delete>
    <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.dy.pmsGlobal.pojoSta.StaAssemblyWorkLast" useGeneratedKeys="true">
    <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.dy.pmsGlobal.pojoSta.StaAssemblyWorkLast"
            useGeneratedKeys="true">
        insert into sta_assembly_work_last
        ( id,user_id,line_id
        ,station_id,plan_id,process_id
        ,node_id,node_type,dt,status
        ,start_time,end_time,assistants
        )
        , start_time, end_time, assistants)
        values (#{id,jdbcType=BIGINT},#{userId,jdbcType=BIGINT},#{lineId,jdbcType=BIGINT}
        ,#{stationId,jdbcType=BIGINT},#{planId,jdbcType=BIGINT},#{processId,jdbcType=BIGINT}
        ,#{nodeId,jdbcType=BIGINT},#{nodeType,jdbcType=TINYINT},#{dt,jdbcType=TIMESTAMP},#{status,jdbcType=TINYINT}
        ,#{startTime,jdbcType=TIMESTAMP},#{endTime,jdbcType=TIMESTAMP},#{assistants,jdbcType=VARCHAR}
        )
               , #{nodeId,jdbcType=BIGINT}, #{nodeType,jdbcType=TINYINT}, #{dt,jdbcType=TIMESTAMP}
               , #{status,jdbcType=TINYINT}
               , #{startTime,jdbcType=TIMESTAMP}, #{endTime,jdbcType=TIMESTAMP}, #{assistants,jdbcType=VARCHAR})
    </insert>
    <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.dy.pmsGlobal.pojoSta.StaAssemblyWorkLast" useGeneratedKeys="true">
    <insert id="insertSelective" keyColumn="id" keyProperty="id"
            parameterType="com.dy.pmsGlobal.pojoSta.StaAssemblyWorkLast" useGeneratedKeys="true">
        insert into sta_assembly_work_last
        <trim prefix="(" suffix=")" suffixOverrides=",">
                <if test="id != null">id,</if>
@@ -373,8 +413,7 @@
    </update>
    <update id="updateByPrimaryKey" parameterType="com.dy.pmsGlobal.pojoSta.StaAssemblyWorkLast">
        update sta_assembly_work_last
        set
            user_id =  #{userId,jdbcType=BIGINT},
        set user_id    = #{userId,jdbcType=BIGINT},
            line_id =  #{lineId,jdbcType=BIGINT},
            station_id =  #{stationId,jdbcType=BIGINT},
            plan_id =  #{planId,jdbcType=BIGINT},