liulingling.177216
2024-08-26 349f1cfc5fa77fbc636d542df0d8050fddec48c2
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<?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.dingzhuo.energy.basic.data.enerInfoManage.mapper.SysPriceMapper">
 
    <resultMap type="SysPrice" id="SysPriceResult">
        <result property="oprTime"    column="opr_time"    />
        <result property="modMan"    column="mod_man"    />
        <result property="priceid"    column="priceid"    />
        <result property="objectid"    column="objectid"    />
        <result property="objecttype"    column="objecttype"    />
        <result property="price"    column="price"    />
        <result property="execdate"    column="execdate"    />
        <result property="oprMan"    column="opr_man"    />
        <result property="modTime"    column="mod_time"    />
        <result property="note"    column="note"    />
    </resultMap>
 
    <sql id="selectSysPriceVo">
        select a.opr_time, a.mod_man, a.priceid, a.objectid, a.objecttype, a.price, a.execdate, a.opr_man, a.mod_time, a.note , b.enername
        from sys_price a
        left join sys_energy b on objectid = enerid and objecttype = 1
    </sql>
 
    <select id="selectSysPriceList" parameterType="SysPrice" resultMap="SysPriceResult">
        <include refid="selectSysPriceVo"/>
        <where>
            <if test="enername != null  and enername != ''"> and enername like concat('%', #{enername}, '%')</if>
        </where>
    </select>
 
    <select id="selectSysPriceById" parameterType="Date" resultMap="SysPriceResult">
        <include refid="selectSysPriceVo"/>
        where opr_time = #{oprTime}
    </select>
 
    <insert id="insertSysPrice" parameterType="SysPrice">
        insert into sys_price
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="oprTime != null ">opr_time,</if>
            <if test="modMan != null  and modMan != ''">mod_man,</if>
            <if test="priceid != null ">priceid,</if>
            <if test="objectid != null ">objectid,</if>
            <if test="objecttype != null ">objecttype,</if>
            <if test="price != null ">price,</if>
            <if test="execdate != null ">execdate,</if>
            <if test="oprMan != null  and oprMan != ''">opr_man,</if>
            <if test="modTime != null ">mod_time,</if>
            <if test="note != null  and note != ''">note,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="oprTime != null ">#{oprTime},</if>
            <if test="modMan != null  and modMan != ''">#{modMan},</if>
            <if test="priceid != null ">#{priceid},</if>
            <if test="objectid != null ">#{objectid},</if>
            <if test="objecttype != null ">#{objecttype},</if>
            <if test="price != null ">#{price},</if>
            <if test="execdate != null ">#{execdate},</if>
            <if test="oprMan != null  and oprMan != ''">#{oprMan},</if>
            <if test="modTime != null ">#{modTime},</if>
            <if test="note != null  and note != ''">#{note},</if>
        </trim>
    </insert>
 
    <update id="updateSysPrice" parameterType="SysPrice">
        update sys_price
        <trim prefix="SET" suffixOverrides=",">
            <if test="modMan != null  and modMan != ''">mod_man = #{modMan},</if>
            <if test="priceid != null ">priceid = #{priceid},</if>
            <if test="objectid != null ">objectid = #{objectid},</if>
            <if test="objecttype != null ">objecttype = #{objecttype},</if>
            <if test="price != null ">price = #{price},</if>
            <if test="execdate != null ">execdate = #{execdate},</if>
            <if test="oprMan != null  and oprMan != ''">opr_man = #{oprMan},</if>
            <if test="modTime != null ">mod_time = #{modTime},</if>
            <if test="note != null  and note != ''">note = #{note},</if>
        </trim>
        where opr_time = #{oprTime}
    </update>
 
    <delete id="deleteSysPriceById" parameterType="Date">
        delete from sys_price where opr_time = #{oprTime}
    </delete>
 
    <delete id="deleteSysPriceByIds" parameterType="String">
        delete from sys_price where opr_time in
        <foreach item="oprTime" collection="array" open="(" separator="," close=")">
            #{oprTime}
        </foreach>
    </delete>
 
</mapper>