2025-07-09 14:31:05 +08:00
<?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">
2025-07-12 17:56:28 +08:00
<mapper namespace= "com.zhyc.module.produce.other.fixHoof.mapper.ScFixHoofMapper" >
2025-07-09 14:31:05 +08:00
2025-07-12 17:56:28 +08:00
<resultMap type= "ScFixHoof" id= "ScFixHoofResult" >
2025-07-09 14:31:05 +08:00
<result property= "id" column= "id" />
<result property= "sheepId" column= "sheep_id" />
<result property= "sheepfold" column= "sheepfold" />
<result property= "comment" column= "comment" />
<result property= "technician" column= "technician" />
<result property= "createBy" column= "create_by" />
<result property= "createTime" column= "create_time" />
</resultMap>
2025-07-12 17:56:28 +08:00
<sql id= "selectScFixHoofVo" >
select id, sheep_id, sheepfold, comment, technician, create_by, create_time from sc_fix_hoof
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-09 14:31:05 +08:00
<where >
2025-07-12 17:56:28 +08:00
<if test= "sheepId != null " > and sheep_id = #{sheepId}</if>
<if test= "sheepfold != null " > and sheepfold = #{sheepfold}</if>
2025-07-09 14:31:05 +08:00
<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>
</where>
</select>
2025-07-12 17:56:28 +08:00
<select id= "selectScFixHoofById" parameterType= "Long" resultMap= "ScFixHoofResult" >
<include refid= "selectScFixHoofVo" />
2025-07-09 14:31:05 +08:00
where id = #{id}
</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= "," >
<if test= "sheepId != null" > sheep_id,</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" > create_by,</if>
<if test= "createTime != null" > create_time,</if>
</trim>
<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>
</trim>
</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-12 17:56:28 +08:00
<delete id= "deleteScFixHoofById" parameterType= "Long" >
delete from sc_fix_hoof where id = #{id}
2025-07-09 14:31:05 +08:00
</delete>
2025-07-12 17:56:28 +08:00
<delete id= "deleteScFixHoofByIds" parameterType= "String" >
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>