forked from kidgrow-microservices-platform

zhaoxiaohao
2020-11-16 f30a977b18541d2f1b9a7863b1377e5f366df9dc
kidgrow-business/kidgrow-usercenter/kidgrow-usercenter-biz/src/main/resources/mapper/SysDepartmentMapper.xml
@@ -15,9 +15,6 @@
            <if test="p.id != null and p.id !=''">
                and id = #{p.id}
            </if>
            <if test="p.hospitalId != null and p.hospitalId !=''">
                and hospital_id = #{p.hospitalId}
            </if>
            <if test="p.departmentName != null and p.departmentName !=''">
                and department_name = #{p.departmentName}
            </if>
@@ -54,6 +51,9 @@
            <if test="p.updateTime != null and p.updateTime !=''">
                and update_time = #{p.updateTime}
            </if>
            <if test="p.accountsCount != null and p.accountsCount !=''">
                and accounts_count = #{p.accountsCount}
            </if>
        </where>
    </sql>
@@ -75,4 +75,14 @@
        <include refid="where"/>
        order by id desc
    </select>
    <select id="checkDepartmentName" resultType="string">
        SELECT org_name FROM sys_organization
WHERE org_parent_id =( SELECT org_id FROM sys_hospital WHERE id = #{hosId} )
AND org_name = #{departmentName} AND is_del=0 and enabled=1
    </select>
    <select id="updatePay" resultType="boolean">
        UPDATE sys_department
        set is_pay=#{isPay}
        where id=#{departmentId}
    </select>
</mapper>