admin
2024-05-27 816ba1e56476f0e23f51711aae4b34507a04a59c
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
<?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.ruoyi.interchange.mapper.TbCoalMineInfoMapper">
    
    <resultMap type="TbCoalMineInfo" id="TbCoalMineInfoResult">
        <result property="id"    column="id"    />
        <result property="deptId"    column="dept_id"    />
        <result property="coalMineCode"    column="coal_mine_code"    />
        <result property="lsqy"    column="lsqy"    />
        <result property="scnl"    column="scnl"    />
        <result property="szdz"    column="szdz"    />
    </resultMap>
 
    <sql id="selectTbCoalMineInfoVo">
        select id, dept_id, coal_mine_code, lsqy, scnl, szdz from tb_coal_mine_info
    </sql>
 
    <select id="selectTbCoalMineInfoList" parameterType="TbCoalMineInfo" resultMap="TbCoalMineInfoResult">
        <include refid="selectTbCoalMineInfoVo"/>
        <where>  
            <if test="deptId != null "> and dept_id = #{deptId}</if>
            <if test="coalMineCode != null  and coalMineCode != ''"> and coal_mine_code = #{coalMineCode}</if>
            <if test="lsqy != null  and lsqy != ''"> and lsqy = #{lsqy}</if>
            <if test="scnl != null  and scnl != ''"> and scnl = #{scnl}</if>
            <if test="szdz != null  and szdz != ''"> and szdz = #{szdz}</if>
        </where>
    </select>
    
    <select id="selectTbCoalMineInfoById" parameterType="Long" resultMap="TbCoalMineInfoResult">
        <include refid="selectTbCoalMineInfoVo"/>
        where id = #{id}
    </select>
        
    <insert id="insertTbCoalMineInfo" parameterType="TbCoalMineInfo" useGeneratedKeys="true" keyProperty="id">
        insert into tb_coal_mine_info
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="deptId != null">dept_id,</if>
            <if test="coalMineCode != null">coal_mine_code,</if>
            <if test="lsqy != null">lsqy,</if>
            <if test="scnl != null">scnl,</if>
            <if test="szdz != null">szdz,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="deptId != null">#{deptId},</if>
            <if test="coalMineCode != null">#{coalMineCode},</if>
            <if test="lsqy != null">#{lsqy},</if>
            <if test="scnl != null">#{scnl},</if>
            <if test="szdz != null">#{szdz},</if>
         </trim>
    </insert>
 
    <update id="updateTbCoalMineInfo" parameterType="TbCoalMineInfo">
        update tb_coal_mine_info
        <trim prefix="SET" suffixOverrides=",">
            <if test="deptId != null">dept_id = #{deptId},</if>
            <if test="coalMineCode != null">coal_mine_code = #{coalMineCode},</if>
            <if test="lsqy != null">lsqy = #{lsqy},</if>
            <if test="scnl != null">scnl = #{scnl},</if>
            <if test="szdz != null">szdz = #{szdz},</if>
        </trim>
        where id = #{id}
    </update>
 
    <delete id="deleteTbCoalMineInfoById" parameterType="Long">
        delete from tb_coal_mine_info where id = #{id}
    </delete>
 
    <delete id="deleteTbCoalMineInfoByIds" parameterType="String">
        delete from tb_coal_mine_info where id in 
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
</mapper>