<?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.yeejoin.equipmanage.mapper.ManufacturerInfoMapper">
    <select id="finduseManufacturer" resultType="int">
        select sum(count) from
                    (
                    select
                    count(1) as count
                    from
                    wl_car a
                    where a.manufacturer_id =#{id}
                    union
                    select
                    count(1) as count
                    from
                    wl_equipment_detail a
                    where a.manufacturer_id =#{id}
                     )data
    </select>
    <select id="checkName" resultType="int">
         select count(1) from wl_manufacturer_info
         where name = #{name}
         <if test="id != null and id != ''">
             and id != #{id}
         </if>
     </select>

    <select id="checkDelete" resultType="string">
        select name from wl_equipment_detail where equipment_id  = #{id}
        union
        select name from wl_car where equipment_id = #{id}
    </select>
</mapper>
