mes-lqqt/ktg-mes/src/main/resources/mapper/md/HtGglMapper.xml
2025-03-11 11:05:50 +08:00

66 lines
2.5 KiB
XML

<?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.ktg.mes.md.mapper.HtGglMapper">
<resultMap type="HtGgl" id="HtGglResult">
<result property="id" column="id" />
<result property="biaoti" column="biaoti" />
<result property="shijian" column="shijian" />
<result property="neirong" column="neirong" />
</resultMap>
<sql id="selectHtGglVo">
select id, biaoti, shijian, neirong from ht_ggl
</sql>
<select id="selectHtGglList" parameterType="HtGgl" resultMap="HtGglResult">
<include refid="selectHtGglVo"/>
<where>
<if test="biaoti != null and biaoti != ''"> and biaoti = #{biaoti}</if>
<if test="shijian != null "> and shijian = #{shijian}</if>
<if test="neirong != null and neirong != ''"> and neirong = #{neirong}</if>
</where>
</select>
<select id="selectHtGglById" parameterType="Integer" resultMap="HtGglResult">
<include refid="selectHtGglVo"/>
where id = #{id}
</select>
<insert id="insertHtGgl" parameterType="HtGgl" useGeneratedKeys="true" keyProperty="id">
insert into ht_ggl
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="biaoti != null">biaoti,</if>
<if test="shijian != null">shijian,</if>
<if test="neirong != null">neirong,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="biaoti != null">#{biaoti},</if>
<if test="shijian != null">#{shijian},</if>
<if test="neirong != null">#{neirong},</if>
</trim>
</insert>
<update id="updateHtGgl" parameterType="HtGgl">
update ht_ggl
<trim prefix="SET" suffixOverrides=",">
<if test="biaoti != null">biaoti = #{biaoti},</if>
<if test="shijian != null">shijian = #{shijian},</if>
<if test="neirong != null">neirong = #{neirong},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteHtGglById" parameterType="Integer">
delete from ht_ggl where id = #{id}
</delete>
<delete id="deleteHtGglByIds" parameterType="String">
delete from ht_ggl where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>