<?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.TbCoalMineSystemMapper">
|
|
<resultMap type="TbCoalMineSystem" id="TbCoalMineSystemResult">
|
<result property="id" column="id" />
|
<result property="coalMineId" column="coal_mine_id" />
|
<result property="systemName" column="system_name" />
|
<result property="headName" column="head_name" />
|
<result property="headPhone" column="head_phone" />
|
<result property="systemCode" column="system_code" />
|
<result property="ftpUrl" column="ftp_url" />
|
</resultMap>
|
|
<sql id="selectTbCoalMineSystemVo">
|
select id, coal_mine_id, system_name, head_name, head_phone, system_code, ftp_url from tb_coal_mine_system
|
</sql>
|
|
<select id="selectTbCoalMineSystemList" parameterType="TbCoalMineSystem" resultMap="TbCoalMineSystemResult">
|
<include refid="selectTbCoalMineSystemVo"/>
|
<where>
|
<if test="coalMineId != null "> and coal_mine_id = #{coalMineId}</if>
|
<if test="systemName != null and systemName != ''"> and system_name like concat('%', #{systemName}, '%')</if>
|
<if test="headName != null and headName != ''"> and head_name like concat('%', #{headName}, '%')</if>
|
<if test="headPhone != null and headPhone != ''"> and head_phone = #{headPhone}</if>
|
<if test="systemCode != null and systemCode != ''"> and system_code = #{systemCode}</if>
|
<if test="ftpUrl != null and ftpUrl != ''"> and ftp_url = #{ftpUrl}</if>
|
</where>
|
</select>
|
|
<select id="selectTbCoalMineSystemById" parameterType="Long" resultMap="TbCoalMineSystemResult">
|
<include refid="selectTbCoalMineSystemVo"/>
|
where id = #{id}
|
</select>
|
|
<insert id="insertTbCoalMineSystem" parameterType="TbCoalMineSystem" useGeneratedKeys="true" keyProperty="id">
|
insert into tb_coal_mine_system
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="coalMineId != null">coal_mine_id,</if>
|
<if test="systemName != null">system_name,</if>
|
<if test="headName != null">head_name,</if>
|
<if test="headPhone != null">head_phone,</if>
|
<if test="systemCode != null">system_code,</if>
|
<if test="ftpUrl != null">ftp_url,</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="coalMineId != null">#{coalMineId},</if>
|
<if test="systemName != null">#{systemName},</if>
|
<if test="headName != null">#{headName},</if>
|
<if test="headPhone != null">#{headPhone},</if>
|
<if test="systemCode != null">#{systemCode},</if>
|
<if test="ftpUrl != null">#{ftpUrl},</if>
|
</trim>
|
</insert>
|
|
<update id="updateTbCoalMineSystem" parameterType="TbCoalMineSystem">
|
update tb_coal_mine_system
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="coalMineId != null">coal_mine_id = #{coalMineId},</if>
|
<if test="systemName != null">system_name = #{systemName},</if>
|
<if test="headName != null">head_name = #{headName},</if>
|
<if test="headPhone != null">head_phone = #{headPhone},</if>
|
<if test="systemCode != null">system_code = #{systemCode},</if>
|
<if test="ftpUrl != null">ftp_url = #{ftpUrl},</if>
|
</trim>
|
where id = #{id}
|
</update>
|
|
<delete id="deleteTbCoalMineSystemById" parameterType="Long">
|
delete from tb_coal_mine_system where id = #{id}
|
</delete>
|
|
<delete id="deleteTbCoalMineSystemByIds" parameterType="String">
|
delete from tb_coal_mine_system where id in
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</delete>
|
</mapper>
|