新增羊只,转场,转群,改耳号,改品种,改备注,体尺测量,体况评分,乳况评分,修蹄,去势初版
This commit is contained in:
@@ -1,124 +1,178 @@
|
||||
<?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">
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.zhyc.module.base.mapper.BasSheepMapper">
|
||||
|
||||
<resultMap type="BasSheep" id="BasSheepResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="manageTags" column="manage_tags" />
|
||||
<result property="ranchId" column="ranch_id" />
|
||||
<result property="sheepfoldId" column="sheepfold_id" />
|
||||
<result property="electronicTags" column="electronic_tags" />
|
||||
<result property="varietyId" column="variety_id" />
|
||||
<result property="family" column="family" />
|
||||
<result property="typeId" column="type_id" />
|
||||
<result property="gender" column="gender" />
|
||||
<result property="birthday" column="birthday" />
|
||||
<result property="birthWeight" column="birth_weight" />
|
||||
<result property="parity" column="parity" />
|
||||
<result property="statusId" column="status_id" />
|
||||
<result property="weaningDate" column="weaning_date" />
|
||||
<result property="weaningWeight" column="weaning_weight" />
|
||||
<result property="breedStatusId" column="breed_status_id" />
|
||||
<result property="fatherId" column="father_id" />
|
||||
<result property="motherId" column="mother_id" />
|
||||
<result property="receptorId" column="receptor_id" />
|
||||
<result property="matingDate" column="mating_date" />
|
||||
<result property="matingTypeId" column="mating_type_id" />
|
||||
<result property="pregDate" column="preg_date" />
|
||||
<result property="lambingDate" column="lambing_date" />
|
||||
<result property="lambingDay" column="lambing_day" />
|
||||
<result property="expectedDate" column="expected_date" />
|
||||
<result property="controlled" column="controlled" />
|
||||
<result property="matingCounts" column="mating_counts" />
|
||||
<result property="matingTotal" column="mating_total" />
|
||||
<result property="miscarriageCounts" column="miscarriage_counts" />
|
||||
<result property="body" column="body" />
|
||||
<result property="breast" column="breast" />
|
||||
<result property="source" column="source" />
|
||||
<result property="sourceDate" column="source_date" />
|
||||
<result property="sourceRanchId" column="source_ranch_id" />
|
||||
<result property="comment" column="comment" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="isDelete" column="is_delete" />
|
||||
<resultMap type="com.zhyc.module.base.domain.BasSheep" id="BasSheepResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="manageTags" column="manage_tags"/>
|
||||
<result property="ranchId" column="ranch_id"/>
|
||||
<result property="sheepfoldId" column="sheepfold_id"/>
|
||||
<result property="electronicTags" column="electronic_tags"/>
|
||||
<result property="varietyId" column="variety_id"/>
|
||||
<result property="family" column="family"/>
|
||||
<result property="typeId" column="type_id"/>
|
||||
<result property="gender" column="gender"/>
|
||||
<result property="birthday" column="birthday"/>
|
||||
<result property="birthWeight" column="birth_weight"/>
|
||||
<result property="parity" column="parity"/>
|
||||
<result property="statusId" column="status_id"/>
|
||||
<result property="weaningDate" column="weaning_date"/>
|
||||
<result property="weaningWeight" column="weaning_weight"/>
|
||||
<result property="breedStatusId" column="breed_status_id"/>
|
||||
<result property="fatherId" column="father_id"/>
|
||||
<result property="motherId" column="mother_id"/>
|
||||
<result property="receptorId" column="receptor_id"/>
|
||||
<result property="matingDate" column="mating_date"/>
|
||||
<result property="matingTypeId" column="mating_type_id"/>
|
||||
<result property="pregDate" column="preg_date"/>
|
||||
<result property="lambingDate" column="lambing_date"/>
|
||||
<result property="lambingDay" column="lambing_day"/>
|
||||
<result property="expectedDate" column="expected_date"/>
|
||||
<result property="controlled" column="controlled"/>
|
||||
<result property="matingCounts" column="mating_counts"/>
|
||||
<result property="matingTotal" column="mating_total"/>
|
||||
<result property="miscarriageCounts" column="miscarriage_counts"/>
|
||||
<result property="body" column="body"/>
|
||||
<result property="breast" column="breast"/>
|
||||
<result property="source" column="source"/>
|
||||
<result property="sourceDate" column="source_date"/>
|
||||
<result property="sourceRanchId" column="source_ranch_id"/>
|
||||
<result property="comment" column="comment"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="isDelete" column="is_delete"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectBasSheepVo">
|
||||
select id, manage_tags, ranch_id, sheepfold_id, electronic_tags, variety_id, family, type_id, gender, birthday, birth_weight, parity, status_id, weaning_date, weaning_weight, breed_status_id, father_id, mother_id, receptor_id, mating_date, mating_type_id, preg_date, lambing_date, lambing_day, expected_date, controlled, mating_counts, mating_total, miscarriage_counts, body, breast, source, source_date, source_ranch_id, comment, update_by, update_time, create_by, create_time, is_delete from bas_sheep
|
||||
select id,
|
||||
manage_tags,
|
||||
ranch_id,
|
||||
sheepfold_id,
|
||||
electronic_tags,
|
||||
variety_id,
|
||||
family,
|
||||
type_id,
|
||||
gender,
|
||||
birthday,
|
||||
birth_weight,
|
||||
parity,
|
||||
status_id,
|
||||
weaning_date,
|
||||
weaning_weight,
|
||||
breed_status_id,
|
||||
father_id,
|
||||
mother_id,
|
||||
receptor_id,
|
||||
mating_date,
|
||||
mating_type_id,
|
||||
preg_date,
|
||||
lambing_date,
|
||||
lambing_day,
|
||||
expected_date,
|
||||
controlled,
|
||||
mating_counts,
|
||||
mating_total,
|
||||
miscarriage_counts,
|
||||
body,
|
||||
breast,
|
||||
source,
|
||||
source_date,
|
||||
source_ranch_id,
|
||||
comment,
|
||||
update_by,
|
||||
update_time,
|
||||
create_by,
|
||||
create_time,
|
||||
is_delete
|
||||
from bas_sheep
|
||||
</sql>
|
||||
|
||||
<select id="selectBasSheepList" parameterType="BasSheep" resultMap="BasSheepResult">
|
||||
<include refid="selectBasSheepVo"/>
|
||||
<where>
|
||||
<if test="manageTags != null and manageTags != ''"> and manage_tags = #{manageTags}</if>
|
||||
<if test="ranchId != null "> and ranch_id = #{ranchId}</if>
|
||||
<if test="sheepfoldId != null "> and sheepfold_id = #{sheepfoldId}</if>
|
||||
<if test="electronicTags != null and electronicTags != ''"> and electronic_tags = #{electronicTags}</if>
|
||||
<if test="varietyId != null "> and variety_id = #{varietyId}</if>
|
||||
<if test="family != null and family != ''"> and family = #{family}</if>
|
||||
<if test="typeId != null "> and type_id = #{typeId}</if>
|
||||
<if test="gender != null "> and gender = #{gender}</if>
|
||||
<if test="birthday != null "> and birthday = #{birthday}</if>
|
||||
<if test="birthWeight != null "> and birth_weight = #{birthWeight}</if>
|
||||
<if test="parity != null "> and parity = #{parity}</if>
|
||||
<if test="statusId != null "> and status_id = #{statusId}</if>
|
||||
<if test="weaningDate != null "> and weaning_date = #{weaningDate}</if>
|
||||
<if test="weaningWeight != null "> and weaning_weight = #{weaningWeight}</if>
|
||||
<if test="breedStatusId != null "> and breed_status_id = #{breedStatusId}</if>
|
||||
<if test="fatherId != null "> and father_id = #{fatherId}</if>
|
||||
<if test="motherId != null "> and mother_id = #{motherId}</if>
|
||||
<if test="receptorId != null "> and receptor_id = #{receptorId}</if>
|
||||
<if test="matingDate != null "> and mating_date = #{matingDate}</if>
|
||||
<if test="matingTypeId != null "> and mating_type_id = #{matingTypeId}</if>
|
||||
<if test="pregDate != null "> and preg_date = #{pregDate}</if>
|
||||
<if test="lambingDate != null "> and lambing_date = #{lambingDate}</if>
|
||||
<if test="lambingDay != null "> and lambing_day = #{lambingDay}</if>
|
||||
<if test="expectedDate != null "> and expected_date = #{expectedDate}</if>
|
||||
<if test="controlled != null "> and controlled = #{controlled}</if>
|
||||
<if test="matingCounts != null "> and mating_counts = #{matingCounts}</if>
|
||||
<if test="matingTotal != null "> and mating_total = #{matingTotal}</if>
|
||||
<if test="miscarriageCounts != null "> and miscarriage_counts = #{miscarriageCounts}</if>
|
||||
<if test="body != null "> and body = #{body}</if>
|
||||
<if test="breast != null "> and breast = #{breast}</if>
|
||||
<if test="source != null and source != ''"> and source = #{source}</if>
|
||||
<if test="sourceDate != null "> and source_date = #{sourceDate}</if>
|
||||
<if test="sourceRanchId != null "> and source_ranch_id = #{sourceRanchId}</if>
|
||||
<if test="comment != null and comment != ''"> and comment = #{comment}</if>
|
||||
<if test="isDelete != null "> and is_delete = #{isDelete}</if>
|
||||
<if test="manageTags != null and manageTags != ''">and manage_tags = #{manageTags}</if>
|
||||
<if test="ranchId != null ">and ranch_id = #{ranchId}</if>
|
||||
<if test="sheepfoldId != null ">and sheepfold_id = #{sheepfoldId}</if>
|
||||
<if test="electronicTags != null and electronicTags != ''">and electronic_tags = #{electronicTags}</if>
|
||||
<if test="varietyId != null ">and variety_id = #{varietyId}</if>
|
||||
<if test="family != null and family != ''">and family = #{family}</if>
|
||||
<if test="typeId != null ">and type_id = #{typeId}</if>
|
||||
<if test="gender != null ">and gender = #{gender}</if>
|
||||
<if test="birthday != null ">and birthday = #{birthday}</if>
|
||||
<if test="birthWeight != null ">and birth_weight = #{birthWeight}</if>
|
||||
<if test="parity != null ">and parity = #{parity}</if>
|
||||
<if test="statusId != null ">and status_id = #{statusId}</if>
|
||||
<if test="weaningDate != null ">and weaning_date = #{weaningDate}</if>
|
||||
<if test="weaningWeight != null ">and weaning_weight = #{weaningWeight}</if>
|
||||
<if test="breedStatusId != null ">and breed_status_id = #{breedStatusId}</if>
|
||||
<if test="fatherId != null ">and father_id = #{fatherId}</if>
|
||||
<if test="motherId != null ">and mother_id = #{motherId}</if>
|
||||
<if test="receptorId != null ">and receptor_id = #{receptorId}</if>
|
||||
<if test="matingDate != null ">and mating_date = #{matingDate}</if>
|
||||
<if test="matingTypeId != null ">and mating_type_id = #{matingTypeId}</if>
|
||||
<if test="pregDate != null ">and preg_date = #{pregDate}</if>
|
||||
<if test="lambingDate != null ">and lambing_date = #{lambingDate}</if>
|
||||
<if test="lambingDay != null ">and lambing_day = #{lambingDay}</if>
|
||||
<if test="expectedDate != null ">and expected_date = #{expectedDate}</if>
|
||||
<if test="controlled != null ">and controlled = #{controlled}</if>
|
||||
<if test="matingCounts != null ">and mating_counts = #{matingCounts}</if>
|
||||
<if test="matingTotal != null ">and mating_total = #{matingTotal}</if>
|
||||
<if test="miscarriageCounts != null ">and miscarriage_counts = #{miscarriageCounts}</if>
|
||||
<if test="body != null ">and body = #{body}</if>
|
||||
<if test="breast != null ">and breast = #{breast}</if>
|
||||
<if test="source != null and source != ''">and source = #{source}</if>
|
||||
<if test="sourceDate != null ">and source_date = #{sourceDate}</if>
|
||||
<if test="sourceRanchId != null ">and source_ranch_id = #{sourceRanchId}</if>
|
||||
<if test="comment != null and comment != ''">and comment = #{comment}</if>
|
||||
<if test="isDelete != null ">and is_delete = #{isDelete}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectBasSheepById" parameterType="java.lang.Long" resultType="com.zhyc.module.base.domain.BasSheep">
|
||||
SELECT s.id,
|
||||
s.sheepfold_id AS sheepfoldId,
|
||||
sf.sheepfold_name AS sheepfoldName,
|
||||
s.variety_id AS varietyId,
|
||||
bv.variety AS varietyName
|
||||
s.manage_tags AS manageTags,
|
||||
s.electronic_tags AS electronicTags,
|
||||
s.sheepfold_id AS sheepfoldId,
|
||||
sf.sheepfold_name AS sheepfoldName,
|
||||
s.variety_id AS varietyId,
|
||||
bv.variety AS varietyName
|
||||
FROM bas_sheep s
|
||||
LEFT JOIN da_sheepfold sf ON s.sheepfold_id = sf.id
|
||||
LEFT JOIN bas_sheep_variety bv ON s.variety_id = bv.id
|
||||
WHERE s.id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="selectBasSheepByManageTags" parameterType="BasSheep" resultMap="BasSheepResult">
|
||||
<include refid="selectBasSheepVo"/>
|
||||
<where>
|
||||
manage_tags = #{manageTags}
|
||||
</where>
|
||||
|
||||
<select id="selectBasSheepByManageTags" parameterType="String" resultMap="BasSheepResult">
|
||||
SELECT s.*,
|
||||
bv.variety AS varietyName
|
||||
FROM bas_sheep s
|
||||
LEFT JOIN bas_sheep_variety bv ON s.variety_id = bv.id
|
||||
WHERE s.manage_tags = #{manageTags} LIMIT 1
|
||||
</select>
|
||||
|
||||
<select id="selectBasSheepBySheepfold" parameterType="BasSheep" resultMap="BasSheepResult">
|
||||
<include refid="selectBasSheepVo"/>
|
||||
<where>
|
||||
sheepfold_id = #{id}
|
||||
</where>
|
||||
<where>
|
||||
sheepfold_id = #{id}
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="getSheepByRanchId" resultMap="BasSheepResult">
|
||||
SELECT *
|
||||
FROM bas_sheep
|
||||
WHERE ranch_id = #{ranchId}
|
||||
</select>
|
||||
|
||||
<select id="selectBasSheepListByIds" parameterType="list" resultMap="BasSheepResult">
|
||||
SELECT * FROM bas_sheep WHERE id IN
|
||||
<foreach item="id" collection="list" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<insert id="insertBasSheep" parameterType="BasSheep" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into bas_sheep
|
||||
@@ -162,7 +216,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="isDelete != null">is_delete,</if>
|
||||
</trim>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="manageTags != null">#{manageTags},</if>
|
||||
<if test="ranchId != null">#{ranchId},</if>
|
||||
@@ -203,7 +257,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="isDelete != null">#{isDelete},</if>
|
||||
</trim>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateBasSheep" parameterType="BasSheep">
|
||||
@@ -253,7 +307,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</update>
|
||||
|
||||
<delete id="deleteBasSheepById" parameterType="Long">
|
||||
delete from bas_sheep where id = #{id}
|
||||
delete
|
||||
from bas_sheep
|
||||
where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteBasSheepByIds" parameterType="String">
|
||||
@@ -263,5 +319,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="existsByManageTag" resultType="int">
|
||||
SELECT COUNT(*) FROM bas_sheep WHERE manage_tags = #{tag} AND is_delete = 0
|
||||
</select>
|
||||
|
||||
<select id="existsByElectronicTag" resultType="int">
|
||||
SELECT COUNT(*) FROM bas_sheep WHERE electronic_tags = #{tag} AND is_delete = 0
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -1,25 +1,26 @@
|
||||
<?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">
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.zhyc.module.base.mapper.BasSheepVarietyMapper">
|
||||
|
||||
|
||||
<resultMap type="BasSheepVariety" id="BasSheepVarietyResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="variety" column="variety" />
|
||||
<result property="id" column="id"/>
|
||||
<result property="variety" column="variety"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectBasSheepVarietyVo">
|
||||
select id, variety from bas_sheep_variety
|
||||
select id, variety
|
||||
from bas_sheep_variety
|
||||
</sql>
|
||||
|
||||
<select id="selectBasSheepVarietyList" parameterType="BasSheepVariety" resultMap="BasSheepVarietyResult">
|
||||
<include refid="selectBasSheepVarietyVo"/>
|
||||
<where>
|
||||
<if test="variety != null and variety != ''"> and variety = #{variety}</if>
|
||||
<where>
|
||||
<if test="variety != null and variety != ''">and variety = #{variety}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectBasSheepVarietyById" parameterType="Long" resultMap="BasSheepVarietyResult">
|
||||
<include refid="selectBasSheepVarietyVo"/>
|
||||
where id = #{id}
|
||||
@@ -29,10 +30,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
insert into bas_sheep_variety
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="variety != null">variety,</if>
|
||||
</trim>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="variety != null">#{variety},</if>
|
||||
</trim>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateBasSheepVariety" parameterType="BasSheepVariety">
|
||||
@@ -44,11 +45,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</update>
|
||||
|
||||
<delete id="deleteBasSheepVarietyById" parameterType="Long">
|
||||
delete from bas_sheep_variety where id = #{id}
|
||||
delete
|
||||
from bas_sheep_variety
|
||||
where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteBasSheepVarietyByIds" parameterType="String">
|
||||
delete from bas_sheep_variety where id in
|
||||
delete from bas_sheep_variety where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
@@ -57,7 +60,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<select id="selectIdByName" parameterType="string" resultType="java.lang.Long">
|
||||
SELECT id
|
||||
FROM bas_sheep_variety
|
||||
WHERE variety = #{varietyName}
|
||||
LIMIT 1
|
||||
WHERE variety = #{varietyName} LIMIT 1
|
||||
</select>
|
||||
|
||||
<select id="selectByVarietyName" parameterType="String" resultMap="BasSheepVarietyResult">
|
||||
SELECT id, variety
|
||||
FROM bas_sheep_variety
|
||||
WHERE variety = #{varietyName} LIMIT 1
|
||||
</select>
|
||||
</mapper>
|
||||
59
zhyc-module/src/main/resources/mapper/base/DaRanchMapper.xml
Normal file
59
zhyc-module/src/main/resources/mapper/base/DaRanchMapper.xml
Normal file
@@ -0,0 +1,59 @@
|
||||
<?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="ranch" column="ranch"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectDaRanchVo">
|
||||
select id, ranch
|
||||
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>
|
||||
</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="ranch != null">ranch,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="ranch != null">#{ranch},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateDaRanch" parameterType="DaRanch">
|
||||
update da_ranch
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="ranch != null">ranch = #{ranch},</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>
|
||||
@@ -1,32 +1,40 @@
|
||||
<?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">
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.zhyc.module.base.mapper.DaSheepfoldMapper">
|
||||
|
||||
<resultMap type="DaSheepfold" id="DaSheepfoldResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="ranchId" column="ranch_id" />
|
||||
<result property="sheepfoldName" column="sheepfold_name" />
|
||||
<result property="sheepfoldTypeId" column="sheepfold_type_id" />
|
||||
<result property="sheepfoldNo" column="sheepfold_no" />
|
||||
<result property="rowNo" column="row_no" />
|
||||
<result property="columns" column="columns" />
|
||||
<result property="comment" column="comment" />
|
||||
|
||||
<resultMap type="com.zhyc.module.base.domain.DaSheepfold" id="DaSheepfoldResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="ranchId" column="ranch_id"/>
|
||||
<result property="sheepfoldName" column="sheepfold_name"/>
|
||||
<result property="sheepfoldTypeId" column="sheepfold_type_id"/>
|
||||
<result property="sheepfoldNo" column="sheepfold_no"/>
|
||||
<result property="rowNo" column="row_no"/>
|
||||
<result property="columns" column="columns"/>
|
||||
<result property="comment" column="comment"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectDaSheepfoldVo">
|
||||
select id, ranch_id, sheepfold_name, sheepfold_type_id, sheepfold_no, row_no, columns, comment from da_sheepfold
|
||||
select id,
|
||||
ranch_id,
|
||||
sheepfold_name,
|
||||
sheepfold_type_id,
|
||||
sheepfold_no,
|
||||
row_no,
|
||||
columns,
|
||||
comment
|
||||
from da_sheepfold
|
||||
</sql>
|
||||
|
||||
<select id="selectDaSheepfoldList" parameterType="DaSheepfold" resultMap="DaSheepfoldResult">
|
||||
<include refid="selectDaSheepfoldVo"/>
|
||||
<where>
|
||||
<if test="ranchId != null "> and ranch_id = #{ranchId}</if>
|
||||
<if test="sheepfoldTypeId != null "> and sheepfold_type_id = #{sheepfoldTypeId}</if>
|
||||
<where>
|
||||
<if test="ranchId != null ">and ranch_id = #{ranchId}</if>
|
||||
<if test="sheepfoldTypeId != null ">and sheepfold_type_id = #{sheepfoldTypeId}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectDaSheepfoldById" parameterType="Long" resultMap="DaSheepfoldResult">
|
||||
<include refid="selectDaSheepfoldVo"/>
|
||||
where id = #{id}
|
||||
@@ -42,7 +50,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="rowNo != null">row_no,</if>
|
||||
<if test="columns != null">columns,</if>
|
||||
<if test="comment != null">comment,</if>
|
||||
</trim>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="ranchId != null">#{ranchId},</if>
|
||||
<if test="sheepfoldName != null">#{sheepfoldName},</if>
|
||||
@@ -51,7 +59,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="rowNo != null">#{rowNo},</if>
|
||||
<if test="columns != null">#{columns},</if>
|
||||
<if test="comment != null">#{comment},</if>
|
||||
</trim>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateDaSheepfold" parameterType="DaSheepfold">
|
||||
@@ -69,11 +77,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</update>
|
||||
|
||||
<delete id="deleteDaSheepfoldById" parameterType="Long">
|
||||
delete from da_sheepfold where id = #{id}
|
||||
delete
|
||||
from da_sheepfold
|
||||
where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteDaSheepfoldByIds" parameterType="String">
|
||||
delete from da_sheepfold where id in
|
||||
delete from da_sheepfold where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
|
||||
Reference in New Issue
Block a user