<?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.tofly.xrtygis.mapper.RxsmstxlxMapper">

    <resultMap id="rxsmstxlxMap" type="com.tofly.xrtygis.entity.Rxsmstxlx">
        <id property="id" column="ID"/>
        <result property="txbm" column="TXBM"/>
        <result property="txmc" column="TXMC"/>
        <result property="dxnrgs" column="DXNRGS"/>
        <result property="yxbz" column="YXBZ"/>
        <result property="dxnrzs" column="DXNRZS"/>
        <result property="sql" column="SQL"/>
    </resultMap>


    <select id="getBook" resultType="java.util.Map">
        select ID USERID , REAL_NAME USERNAME , PHONE ,DEPARTMENT_ID from TF_SMPN_USER_X
        where ENABLE_FLAG = 1
        <if test="book.deptId != null and book.deptId != '' ">
            and DEPARTMENT_ID = #{book.deptId}
        </if>
        <if test="book.inputContent != null and book.inputContent != '' ">
            and REAL_NAME || PHONE LIKE '%' || #{book.inputContent,jdbcType=VARCHAR} || '%'
        </if>
    </select>

    <update id="updateBook">
        update TF_SMPN_USER_X
        set PHONE = #{phone}
        where ID = #{userId}
    </update>
</mapper>
