春风项目四线(合箱线、总装线)
wujian
5 天以前 ea3c33c8561df39d4f123d1424fda99dd0f0c51d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?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.jcdm.main.bs.beatSetting.mapper.ProductNumTableMapper">
    
    <resultMap type="ProductNumTable" id="ProductNumTableResult">
        <result property="id"    column="id"    />
        <result property="zzOfflineNum"    column="zz_offline_num"    />
        <result property="zzOnlineNum"    column="zz_online_num"    />
        <result property="hxOnlineNum"    column="hx_online_num"    />
        <result property="productTime"    column="product_time"    />
        <result property="model"    column="model"    />
        <result property="productNumTheory"    column="product_num_theory"    />
    </resultMap>
 
    <sql id="selectProductNumVo">
        select id, zz_offline_num, zz_online_num, hx_online_num, product_time, model from product_num_table
    </sql>
 
    <insert id="insertProductNum">
        INSERT INTO product_num_table (id, zz_offline_num,zz_online_num,hx_online_num,product_time,model,product_num_theory )
        VALUES
        <foreach collection="list" item="item" index="index" separator=",">
            (#{item.id}, #{item.zzOfflineNum}, #{item.zzOnlineNum}, #{item.hxOnlineNum}, #{item.productTime},#{item.model},#{item.productNumTheory})
        </foreach>
    </insert>
 
    <update id="updateProductNum">
        update product_num_table
        <trim prefix="SET" suffixOverrides=",">
            <if test="zzOfflineNum != null">zz_offline_num = #{zzOfflineNum},</if>
            <if test="zzOnlineNum != null">zz_online_num = #{zzOnlineNum},</if>
            <if test="hxOnlineNum != null ">hx_online_num = #{hxOnlineNum},</if>
            <if test="productTime != null">product_time = #{productTime},</if>
            <if test="model != null and model != ''">model = #{model},</if>
            <if test="productNumTheory != null">product_num_theory = #{productNumTheory},</if>
        </trim>
        where id = #{id}
    </update>
 
 
    <select id="selectProductNum" parameterType="ProductNumTable" resultMap="ProductNumTableResult">
        <include refid="selectProductNumVo"/>
        <where>
            <if test="id != null  and id != ''"> and id = #{id}</if>
            <if test="zzOfflineNum != null  and zzOfflineNum != ''"> and zz_offline_num = #{zzOfflineNum}</if>
            <if test="zzOnlineNum != null  and zzOnlineNum != ''"> and zz_online_num = #{zzOnlineNum}</if>
            <if test="hxOnlineNum != null  and hxOnlineNum != ''"> and hx_online_num = #{hxOnlineNum}</if>
            <if test="productTime != null "> and product_time = #{productTime}</if>
            <if test="model != null  and model != ''"> and model = #{model}</if>
        </where>
    </select>
 
</mapper>