SELECT t.*, bv.variety AS varietyName, CASE t.trans_type WHEN 0 THEN '内部转场' WHEN 1 THEN '跨场转场' WHEN 2 THEN '销售转场' ELSE '未知' END AS trans_type_text FROM sc_transition_info t LEFT JOIN bas_sheep_variety bv ON t.variety_id = bv.id insert into sc_transition_info sheep_id, variety_id, trans_to, trans_from, trans_type, technician, status, comment, create_by, create_time, #{sheepId}, #{varietyId}, #{transTo}, #{transFrom}, #{transType}, #{technician}, #{status}, #{comment}, #{createBy}, #{createTime}, update sc_transition_info sheep_id = #{sheepId}, variety_id = #{varietyId}, trans_to = #{transTo}, trans_from = #{transFrom}, trans_type = #{transType}, technician = #{technician}, status = #{status}, comment = #{comment}, create_by = #{createBy}, create_time = #{createTime}, where id = #{id} delete from sc_transition_info where id = #{id} delete from sc_transition_info where id in #{id}