牧场跟跟部门绑定

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>