<?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.wisenergy.mapper.WorkTypeMapper">
    <update id="updateIsStatusById">
        update work_type
        <set>
            <if test="null != status">
                status = #{status},
            </if>
        </set>
        <where>
            <if test="null != id">
                id = #{id}
            </if>
        </where>

    </update>


    <select id="getAll" resultType="cn.wisenergy.model.app.WorkType">
        SELECT  id,`name`,reviewer,status,sort
        FROM work_type
    </select>

    <select id="getIdByReviewer" resultType="java.lang.Integer">
          SELECT  id
          FROM work_type
          WHERE reviewer = #{reviewer}
    </select>
    <select id="getByIsStatus" resultType="cn.wisenergy.model.app.WorkType">
        SELECT  id,name,reviewer,status,sort
        FROM work_type
        <where>
            <if test="null != status">
                status = #{status}
            </if>
        </where>

    </select>

</mapper>