<?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.cf.imes.module.system.dal.mysql.process.ProcessGroupMapper">

    <select id="selectOneById" resultType="com.cf.imes.module.system.dal.dataobject.process.ProcessGroupDO">
        select
            p.id,
            p.organ_id,
            p.name,
            p.is_default,
            p.sort,
            p.items,
            p.description,
            p.creator,
            p.create_time,
            p.updater,
            p.update_time,
            p.deleted
        from process_group p
        where p.id = #{id} and p.organ_id = #{organId} and p.deleted = 0
    </select>

    <update id="updateIsDefault" >
        UPDATE process_group SET is_default = 0 WHERE organ_id = #{organId} AND id != #{processGroupId}
    </update>
</mapper>
