<?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="cn.ezhizao.project.business.mapper.BizProductionPlanDetailSubDetailEquipmentUserMapper">

    <resultMap type="cn.ezhizao.project.business.domain.BizProductionPlanDetailSubDetailEquipmentUser" id="BizProductionPlanDetailSubDetailEquipmentUserResult">
        <id column="id" property="id"/>
    </resultMap>


    <select id="getList" parameterType="BizProductionPlanDetailSubDetailEquipmentUser" resultMap="BizProductionPlanDetailSubDetailEquipmentUserResult">
        SELECT *
        FROM biz_production_plan_detail_sub_detail_equipment_user
        <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
            deleted = 0
            <if test="productionPlanDetailSubDetailEquipmentId != null and productionPlanDetailSubDetailEquipmentId !=''">and production_plan_detail_sub_detail_equipment_id = #{productionPlanDetailSubDetailEquipmentId}</if>
            <if test="equipmentDetailId != null and equipmentDetailId !=''"> AND equipment_detail_id = #{equipmentDetailId}</if>
            <if test="equipmentDetailCode != null  and equipmentDetailCode != ''"> AND equipment_detail_code = #{equipmentDetailCode}</if>
            <if test="userName != null  and userName != ''"> AND user_name like concat('%', #{userName}, '%')</if>
            <if test="nickName != null  and nickName != ''"> AND nick_name like concat('%', #{nickName}, '%')</if>
        </trim>
    </select>

    <delete id="physicalDelete">
        DELETE FROM biz_production_plan_detail_sub_detail_equipment_user
        <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
            <if test="id != null">
                id = #{id} AND
            </if>
       <!-- 删除条件为其他外键可以在这里加 -->
        </trim>
    </delete>
</mapper>
