牧场跟跟部门绑定

This commit is contained in:
2026-01-30 15:50:23 +08:00
parent 086cb43359
commit f0acd149c7
9 changed files with 150 additions and 30 deletions

View File

@@ -6,18 +6,18 @@
<resultMap type="DaRanch" id="DaRanchResult">
<result property="id" column="id"/>
<result property="ranch" column="ranch"/>
<result property="sysRanch" column="sysRanch"/>
</resultMap>
<sql id="selectDaRanchVo">
select id, ranch
select id, sysRanch
from da_ranch
</sql>
<select id="selectDaRanchList" parameterType="DaRanch" resultMap="DaRanchResult">
<include refid="selectDaRanchVo"/>
<where>
<if test="ranch != null and ranch != ''">and ranch = #{ranch}</if>
<if test="sysRanch != null and sysRanch != ''">and sysRanch = #{sysRanch}</if>
</where>
</select>
@@ -29,17 +29,17 @@
<insert id="insertDaRanch" parameterType="DaRanch" useGeneratedKeys="true" keyProperty="id">
insert into da_ranch
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="ranch != null">ranch,</if>
<if test="sysRanch != null">sysRanch,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="ranch != null">#{ranch},</if>
<if test="sysRanch != null">#{sysRanch},</if>
</trim>
</insert>
<update id="updateDaRanch" parameterType="DaRanch">
update da_ranch
<trim prefix="SET" suffixOverrides=",">
<if test="ranch != null">ranch = #{ranch},</if>
<if test="sysRanch != null">sysRanch = #{sysRanch},</if>
</trim>
where id = #{id}
</update>

View File

@@ -29,7 +29,7 @@
<result property="matingDate" column="mating_date" />
<result property="expectedDate" column="expected_date" />
<result property="lastEventDate" column="last_event_date" />
<result property="ranchName" column="ranch" />
<result property="ranchName" column="sysRanch" />
<result property="daysAfterMating" column="days_after_mating" />
</resultMap>
@@ -54,7 +54,7 @@
sf.breed,
sf.expected_date,
sf.lambing_date as last_event_date,
sf.dr_ranch as ranch,
sf.dr_ranch as sysRanch,
-- 关联配种信息
ram_sf.bs_manage_tags as father_manage_tags,
ram_sf.variety as father_variety,