修蹄,去势,转群的新增功能的完善
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
<resultMap type="ScTransGroup" id="ScTransGroupResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="sheepId" column="sheep_id"/>
|
||||
<result property="manageTags" column="manageTags"/>
|
||||
<result property="foldTo" column="fold_to"/>
|
||||
<result property="foldFrom" column="fold_from"/>
|
||||
<result property="reason" column="reason"/>
|
||||
@@ -22,6 +23,7 @@
|
||||
<sql id="selectScTransGroupVo">
|
||||
SELECT tg.id,
|
||||
tg.sheep_id,
|
||||
s.manage_tags AS manageTags,
|
||||
tg.fold_to,
|
||||
tg.fold_from,
|
||||
tg.reason,
|
||||
@@ -35,6 +37,7 @@
|
||||
sf_from.sheepfold_name AS foldFromName,
|
||||
sf_to.sheepfold_name AS foldToName
|
||||
FROM sc_trans_group tg
|
||||
LEFT JOIN bas_sheep s ON tg.sheep_id = s.id
|
||||
LEFT JOIN da_sheepfold sf_from ON tg.fold_from = sf_from.id
|
||||
LEFT JOIN da_sheepfold sf_to ON tg.fold_to = sf_to.id
|
||||
LEFT JOIN bas_sheep_variety bv ON tg.variety_id = bv.id
|
||||
@@ -44,6 +47,9 @@
|
||||
<include refid="selectScTransGroupVo"/>
|
||||
<where>
|
||||
<if test="sheepId != null">and sheep_id = #{sheepId}</if>
|
||||
<if test="manageTags != null and manageTags != ''">
|
||||
and s.manage_tags like concat('%', #{manageTags}, '%')
|
||||
</if>
|
||||
<if test="foldTo != null and foldTo != ''">and fold_to = #{foldTo}</if>
|
||||
<if test="foldFrom != null and foldFrom != ''">and fold_from = #{foldFrom}</if>
|
||||
<if test="status != null">and status = #{status}</if>
|
||||
|
||||
@@ -7,9 +7,12 @@
|
||||
<resultMap type="ScCastrate" id="ScCastrateResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="sheepId" column="sheep_id"/>
|
||||
<result property="manageTags" column="manageTags"/> <!-- 新增耳号映射 -->
|
||||
<result property="sheepfold" column="sheepfold"/>
|
||||
<result property="comment" column="comment"/>
|
||||
<result property="sheepfoldName" column="sheepfoldName"/>
|
||||
<result property="varietyId" column="variety_id"/>
|
||||
<result property="varietyName" column="varietyName"/>
|
||||
<result property="comment" column="comment"/>
|
||||
<result property="technician" column="technician"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
@@ -18,15 +21,17 @@
|
||||
<sql id="selectScCastrateVo">
|
||||
select sc.id,
|
||||
sc.sheep_id,
|
||||
bs.manage_tags as manageTags, -- 关联羊只表的耳号
|
||||
sc.sheepfold,
|
||||
sf.sheepfold_name as sheepfoldName,
|
||||
sc.variety_id,
|
||||
bv.variety as varietyName,
|
||||
bv.variety as varietyName,
|
||||
sc.comment,
|
||||
sc.technician,
|
||||
sc.create_by,
|
||||
sc.create_time
|
||||
from sc_castrate sc
|
||||
left join bas_sheep bs on sc.sheep_id = bs.id -- 关联羊只表获取耳号
|
||||
left join da_sheepfold sf on sc.sheepfold = sf.id
|
||||
left join bas_sheep_variety bv on sc.variety_id = bv.id
|
||||
</sql>
|
||||
@@ -34,16 +39,16 @@
|
||||
<select id="selectScCastrateList" parameterType="ScCastrate" resultMap="ScCastrateResult">
|
||||
<include refid="selectScCastrateVo"/>
|
||||
<where>
|
||||
<if test="sheepId != null and sheepId != ''">and sheep_id like concat('%', #{sheepId}, '%')</if>
|
||||
<if test="sheepfold != null ">and sheepfold like concat('%', #{sheepfold}, '%')</if>
|
||||
<if test="varietyId != null">
|
||||
and sc.variety_id = #{varietyId}
|
||||
<!-- 替换原sheepId条件为耳号条件 -->
|
||||
<if test="manageTags != null and manageTags != ''">
|
||||
and bs.manage_tags like concat('%', #{manageTags}, '%')
|
||||
</if>
|
||||
<if test="technician != null and technician != ''">and technician like concat('%', #{technician}, '%')</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 test="sheepfold != null ">and sc.sheepfold = #{sheepfold}</if>
|
||||
<if test="varietyId != null">and sc.variety_id = #{varietyId}</if>
|
||||
<if test="technician != null and technician != ''">and sc.technician like concat('%', #{technician}, '%')</if>
|
||||
<if test="params.beginCreateTime != null and params.endCreateTime != null">
|
||||
and sc.create_time between #{params.beginCreateTime} and #{params.endCreateTime}
|
||||
</if>
|
||||
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
@@ -6,8 +6,9 @@
|
||||
|
||||
<resultMap type="ScFixHoof" id="ScFixHoofResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="sheepId" column="sheep_id"/>
|
||||
<result property="manageTags" column="manageTags"/>
|
||||
<result property="sheepfold" column="sheepfold"/>
|
||||
<result property="varietyId" column="variety_id"/>
|
||||
<result property="sheepfoldName" column="sheepfoldName"/>
|
||||
<result property="comment" column="comment"/>
|
||||
<result property="technician" column="technician"/>
|
||||
@@ -17,15 +18,19 @@
|
||||
|
||||
<sql id="selectScFixHoofVo">
|
||||
select fh.id,
|
||||
fh.sheep_id,
|
||||
bs.manage_tags AS manageTags,
|
||||
fh.sheepfold,
|
||||
sf.sheepfold_name as sheepfoldName,
|
||||
sf.sheepfold_name AS sheepfoldName,
|
||||
fh.variety_id,
|
||||
bv.variety AS varietyName,
|
||||
fh.comment,
|
||||
fh.technician,
|
||||
fh.create_by,
|
||||
fh.create_time
|
||||
from sc_fix_hoof fh
|
||||
left join bas_sheep bs on fh.sheep_id = bs.id
|
||||
left join da_sheepfold sf on fh.sheepfold = sf.id
|
||||
left join bas_sheep_variety bv on fh.variety_id = bv.id
|
||||
</sql>
|
||||
|
||||
<select id="selectScFixHoofList" parameterType="ScFixHoof" resultMap="ScFixHoofResult">
|
||||
@@ -33,9 +38,15 @@
|
||||
<where>
|
||||
<if test="sheepId != null ">and sheep_id = #{sheepId}</if>
|
||||
<if test="sheepfold != null ">and sheepfold = #{sheepfold}</if>
|
||||
<if test="varietyId != null">
|
||||
and fh.variety_id = #{varietyId}
|
||||
</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>
|
||||
<if test="manageTags != null and manageTags != ''">
|
||||
and bs.manage_tags like concat('%', #{manageTags}, '%')
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
@@ -44,24 +55,24 @@
|
||||
where fh.id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertScFixHoof" parameterType="ScFixHoof" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into sc_fix_hoof
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="sheepId != null and sheepId != ''">and fh.sheep_id like concat('%', #{sheepId}, '%')</if>
|
||||
<if test="sheepfold != null">and fh.sheepfold = #{sheepfold}</if>
|
||||
<if test="comment != null">comment,</if>
|
||||
<if test="technician != null and technician != ''">technician,</if>
|
||||
<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>
|
||||
<if test="technician != null and technician != ''">#{technician},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
</trim>
|
||||
<insert id="insertScFixHoof" parameterType="ScFixHoof"
|
||||
useGeneratedKeys="true" keyProperty="id">
|
||||
INSERT INTO sc_fix_hoof
|
||||
(sheep_id,
|
||||
sheepfold,
|
||||
variety_id,
|
||||
<if test="comment != null">comment,</if>
|
||||
<if test="technician != null and technician != ''">technician,</if>
|
||||
create_by,
|
||||
create_time)
|
||||
VALUES
|
||||
(#{sheepId},
|
||||
#{sheepfold},
|
||||
<if test="varietyId != null">#{varietyId},</if>
|
||||
<if test="comment != null">#{comment},</if>
|
||||
<if test="technician != null and technician != ''">#{technician},</if>
|
||||
#{createBy},
|
||||
#{createTime})
|
||||
</insert>
|
||||
|
||||
<update id="updateScFixHoof" parameterType="ScFixHoof">
|
||||
@@ -69,6 +80,7 @@
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="sheepId != null">sheep_id = #{sheepId},</if>
|
||||
<if test="sheepfold != null">sheepfold = #{sheepfold},</if>
|
||||
<if test="varietyId != null">variety_id=#{varietyId},</if>
|
||||
<if test="comment != null">comment = #{comment},</if>
|
||||
<if test="technician != null and technician != ''">technician = #{technician},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
@@ -89,4 +101,6 @@
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user