59 lines
1.9 KiB
XML
59 lines
1.9 KiB
XML
<?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">
|
|
<mapper namespace="com.zhyc.module.base.mapper.DaRanchMapper">
|
|
|
|
<resultMap type="DaRanch" id="DaRanchResult">
|
|
<result property="id" column="id"/>
|
|
<result property="sysRanch" column="sysRanch"/>
|
|
</resultMap>
|
|
|
|
<sql id="selectDaRanchVo">
|
|
select id, sysRanch
|
|
from da_ranch
|
|
</sql>
|
|
|
|
<select id="selectDaRanchList" parameterType="DaRanch" resultMap="DaRanchResult">
|
|
<include refid="selectDaRanchVo"/>
|
|
<where>
|
|
<if test="sysRanch != null and sysRanch != ''">and sysRanch = #{sysRanch}</if>
|
|
</where>
|
|
</select>
|
|
|
|
<select id="selectDaRanchById" parameterType="Long" resultMap="DaRanchResult">
|
|
<include refid="selectDaRanchVo"/>
|
|
where id = #{id}
|
|
</select>
|
|
|
|
<insert id="insertDaRanch" parameterType="DaRanch" useGeneratedKeys="true" keyProperty="id">
|
|
insert into da_ranch
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="sysRanch != null">sysRanch,</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="sysRanch != null">#{sysRanch},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateDaRanch" parameterType="DaRanch">
|
|
update da_ranch
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="sysRanch != null">sysRanch = #{sysRanch},</if>
|
|
</trim>
|
|
where id = #{id}
|
|
</update>
|
|
|
|
<delete id="deleteDaRanchById" parameterType="Long">
|
|
delete
|
|
from da_ranch
|
|
where id = #{id}
|
|
</delete>
|
|
|
|
<delete id="deleteDaRanchByIds" parameterType="String">
|
|
delete from da_ranch where id in
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
</delete>
|
|
</mapper> |