<?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.ssm.manage.mapper.WorkShopMapper">

    <resultMap id="BaseResultMap" type="com.ssm.manage.entity.WorkShop">
        <result property="id" column="id"/>
        <result property="workShopNum" column="work_shop_num"/>
        <result property="wordShopName" column="word_shop_name"/>
        <result property="workShopAddress" column="work_shop_address"/>
        <result property="regionId" column="region_id"/>
        <result property="regionName" column="region_name"/>
        <result property="state" column="state"/>
        <result property="manageId" column="manage_id"/>
        <result property="manageNum" column="manage_num"/>
        <result property="manageName" column="manage_name"/>
        <result property="inputId" column="input_id"/>
        <result property="inputName" column="input_name"/>
        <result property="inputDate" column="input_date"/>
        <result property="updateId" column="update_id"/>
        <result property="updateName" column="update_name"/>
        <result property="updateDate" column="update_date"/>
    </resultMap>

    <sql id="Base_Column_List">
        id
        , work_shop_num, word_shop_name, work_shop_address, region_id, region_name, state, manage_id, manage_num, manage_name, input_id, input_name, input_date, update_id, update_name, update_date
    </sql>

    <select id="queryAll" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"></include>
        from work_shop
        <where>
            <if test="id != null">
                and id = #{id}
            </if>
            <if test="workShopNum != null and workShopNum != ''">
                and work_shop_num = #{workShopNum}
            </if>
            <if test="wordShopName != null and wordShopName != ''">
                and word_shop_name = #{wordShopName}
            </if>
            <if test="workShopAddress != null and workShopAddress != ''">
                and work_shop_address = #{workShopAddress}
            </if>
            <if test="regionId != null">
                and region_id = #{regionId}
            </if>
            <if test="regionName != null and regionName != ''">
                and region_name = #{regionName}
            </if>
            <if test="state != null">
                and state = #{state}
            </if>
            <if test="manageId != null">
                and manage_id = #{manageId}
            </if>
            <if test="manageNum != null and manageNum != ''">
                and manage_num = #{manageNum}
            </if>
            <if test="manageName != null and manageName != ''">
                and manage_name = #{manageName}
            </if>
            <if test="inputId != null">
                and input_id = #{inputId}
            </if>
            <if test="inputName != null and inputName != ''">
                and input_name = #{inputName}
            </if>
            <if test="inputDate != null">
                and input_date = #{inputDate}
            </if>
            <if test="updateId != null">
                and update_id = #{updateId}
            </if>
            <if test="updateName != null and updateName != ''">
                and update_name = #{updateName}
            </if>
            <if test="updateDate != null">
                and update_date = #{updateDate}
            </if>
        </where>
    </select>


</mapper>
