2025-07-09 14:31:05 +08:00
|
|
|
<?xml version="1.0" encoding="UTF-8" ?>
|
|
|
|
<!DOCTYPE mapper
|
2025-07-15 18:40:22 +08:00
|
|
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
2025-07-12 17:56:28 +08:00
|
|
|
<mapper namespace="com.zhyc.module.produce.other.fixHoof.mapper.ScFixHoofMapper">
|
2025-07-15 18:40:22 +08:00
|
|
|
|
2025-07-12 17:56:28 +08:00
|
|
|
<resultMap type="ScFixHoof" id="ScFixHoofResult">
|
2025-07-15 18:40:22 +08:00
|
|
|
<result property="id" column="id"/>
|
|
|
|
<result property="sheepId" column="sheep_id"/>
|
|
|
|
<result property="sheepfold" column="sheepfold"/>
|
|
|
|
<result property="sheepfoldName" column="sheepfoldName"/>
|
|
|
|
<result property="comment" column="comment"/>
|
|
|
|
<result property="technician" column="technician"/>
|
|
|
|
<result property="createBy" column="create_by"/>
|
|
|
|
<result property="createTime" column="create_time"/>
|
2025-07-09 14:31:05 +08:00
|
|
|
</resultMap>
|
|
|
|
|
2025-07-12 17:56:28 +08:00
|
|
|
<sql id="selectScFixHoofVo">
|
2025-07-15 18:40:22 +08:00
|
|
|
select fh.id,
|
|
|
|
fh.sheep_id,
|
|
|
|
fh.sheepfold,
|
|
|
|
sf.sheepfold_name as sheepfoldName,
|
|
|
|
fh.comment,
|
|
|
|
fh.technician,
|
|
|
|
fh.create_by,
|
|
|
|
fh.create_time
|
|
|
|
from sc_fix_hoof fh
|
|
|
|
left join da_sheepfold sf on fh.sheepfold = sf.id
|
2025-07-09 14:31:05 +08:00
|
|
|
</sql>
|
|
|
|
|
2025-07-12 17:56:28 +08:00
|
|
|
<select id="selectScFixHoofList" parameterType="ScFixHoof" resultMap="ScFixHoofResult">
|
|
|
|
<include refid="selectScFixHoofVo"/>
|
2025-07-15 18:40:22 +08:00
|
|
|
<where>
|
|
|
|
<if test="sheepId != null ">and sheep_id = #{sheepId}</if>
|
|
|
|
<if test="sheepfold != null ">and sheepfold = #{sheepfold}</if>
|
|
|
|
<if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''">
|
|
|
|
and create_time between #{params.beginCreateTime} and #{params.endCreateTime}
|
|
|
|
</if>
|
2025-07-09 14:31:05 +08:00
|
|
|
</where>
|
|
|
|
</select>
|
2025-07-15 18:40:22 +08:00
|
|
|
|
|
|
|
<select id="selectScFixHoofById" parameterType="java.lang.Integer" resultMap="ScFixHoofResult">
|
2025-07-12 17:56:28 +08:00
|
|
|
<include refid="selectScFixHoofVo"/>
|
2025-07-15 18:40:22 +08:00
|
|
|
where fh.id = #{id}
|
2025-07-09 14:31:05 +08:00
|
|
|
</select>
|
|
|
|
|
2025-07-12 17:56:28 +08:00
|
|
|
<insert id="insertScFixHoof" parameterType="ScFixHoof" useGeneratedKeys="true" keyProperty="id">
|
|
|
|
insert into sc_fix_hoof
|
2025-07-09 14:31:05 +08:00
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
2025-07-15 18:40:22 +08:00
|
|
|
<if test="sheepId != null and sheepId != ''">and fh.sheep_id like concat('%', #{sheepId}, '%')</if>
|
|
|
|
<if test="sheepfold != null">and fh.sheepfold = #{sheepfold}</if>
|
2025-07-09 14:31:05 +08:00
|
|
|
<if test="comment != null">comment,</if>
|
2025-07-12 17:56:28 +08:00
|
|
|
<if test="technician != null and technician != ''">technician,</if>
|
2025-07-09 14:31:05 +08:00
|
|
|
<if test="createBy != null">create_by,</if>
|
|
|
|
<if test="createTime != null">create_time,</if>
|
2025-07-15 18:40:22 +08:00
|
|
|
</trim>
|
2025-07-09 14:31:05 +08:00
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
<if test="sheepId != null">#{sheepId},</if>
|
|
|
|
<if test="sheepfold != null">#{sheepfold},</if>
|
|
|
|
<if test="comment != null">#{comment},</if>
|
2025-07-12 17:56:28 +08:00
|
|
|
<if test="technician != null and technician != ''">#{technician},</if>
|
2025-07-09 14:31:05 +08:00
|
|
|
<if test="createBy != null">#{createBy},</if>
|
|
|
|
<if test="createTime != null">#{createTime},</if>
|
2025-07-15 18:40:22 +08:00
|
|
|
</trim>
|
2025-07-09 14:31:05 +08:00
|
|
|
</insert>
|
|
|
|
|
2025-07-12 17:56:28 +08:00
|
|
|
<update id="updateScFixHoof" parameterType="ScFixHoof">
|
|
|
|
update sc_fix_hoof
|
2025-07-09 14:31:05 +08:00
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
|
<if test="sheepId != null">sheep_id = #{sheepId},</if>
|
|
|
|
<if test="sheepfold != null">sheepfold = #{sheepfold},</if>
|
|
|
|
<if test="comment != null">comment = #{comment},</if>
|
2025-07-12 17:56:28 +08:00
|
|
|
<if test="technician != null and technician != ''">technician = #{technician},</if>
|
2025-07-09 14:31:05 +08:00
|
|
|
<if test="createBy != null">create_by = #{createBy},</if>
|
|
|
|
<if test="createTime != null">create_time = #{createTime},</if>
|
|
|
|
</trim>
|
|
|
|
where id = #{id}
|
|
|
|
</update>
|
|
|
|
|
2025-07-15 18:40:22 +08:00
|
|
|
<delete id="deleteScFixHoofById" parameterType="java.lang.Integer">
|
|
|
|
delete
|
|
|
|
from sc_fix_hoof
|
|
|
|
where id = #{id}
|
2025-07-09 14:31:05 +08:00
|
|
|
</delete>
|
|
|
|
|
2025-07-15 18:40:22 +08:00
|
|
|
<delete id="deleteScFixHoofByIds" parameterType="java.lang.Integer">
|
|
|
|
delete from sc_fix_hoof where id in
|
2025-07-09 14:31:05 +08:00
|
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
|
#{id}
|
|
|
|
</foreach>
|
|
|
|
</delete>
|
|
|
|
</mapper>
|