|
@@ -0,0 +1,123 @@
|
|
|
|
+<?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">
|
|
|
|
+<!-- namespace必须指向DAO接口 -->
|
|
|
|
+<mapper namespace="com.jpsoft.smart.modules.base.dao.EmployeeInfoDAO">
|
|
|
|
+ <resultMap id="EmployeeInfoMap" type="com.jpsoft.smart.modules.base.entity.EmployeeInfo">
|
|
|
|
+ <id property="id" column="id_"/>
|
|
|
|
+ <result property="name" column="name_"/>
|
|
|
|
+ <result property="companyId" column="company_id"/>
|
|
|
|
+ <result property="photo" column="photo_"/>
|
|
|
|
+ <result property="no" column="no_"/>
|
|
|
|
+ <result property="createBy" column="create_by"/>
|
|
|
|
+ <result property="createTime" column="create_time"/>
|
|
|
|
+ <result property="updateBy" column="update_by"/>
|
|
|
|
+ <result property="updateTime" column="update_time"/>
|
|
|
|
+ <result property="delFlag" column="del_flag"/>
|
|
|
|
+ <result property="sortNo" column="sort_no"/>
|
|
|
|
+ <result property="openId" column="open_id"/>
|
|
|
|
+ </resultMap>
|
|
|
|
+ <insert id="insert" parameterType="com.jpsoft.smart.modules.base.entity.EmployeeInfo">
|
|
|
|
+ <!--
|
|
|
|
+ <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
|
|
|
|
+ select sys_guid() from dual
|
|
|
|
+ </selectKey>
|
|
|
|
+ -->
|
|
|
|
+ <![CDATA[
|
|
|
|
+ insert into base_employee_info
|
|
|
|
+ (name_,company_id,photo_,no_,create_by,create_time,
|
|
|
|
+ update_by,update_time,del_flag,sort_no,open_id)
|
|
|
|
+ values
|
|
|
|
+ (
|
|
|
|
+ #{name,jdbcType=VARCHAR}
|
|
|
|
+ ,#{companyId,jdbcType=VARCHAR}
|
|
|
|
+ ,#{photo,jdbcType=VARCHAR}
|
|
|
|
+ ,#{no,jdbcType=VARCHAR}
|
|
|
|
+ ,#{createBy,jdbcType=VARCHAR}
|
|
|
|
+ ,#{createTime,jdbcType= TIMESTAMP }
|
|
|
|
+ ,#{updateBy,jdbcType=VARCHAR}
|
|
|
|
+ ,#{updateTime,jdbcType= TIMESTAMP }
|
|
|
|
+ ,#{delFlag,jdbcType= NUMERIC }
|
|
|
|
+ ,#{sortNo,jdbcType= NUMERIC }
|
|
|
|
+ ,#{openId,jdbcType=VARCHAR}
|
|
|
|
+ )
|
|
|
|
+ ]]>
|
|
|
|
+ </insert>
|
|
|
|
+ <delete id="delete" parameterType="string">
|
|
|
|
+ delete from base_employee_info where id_=#{id,jdbcType=NUMERIC}
|
|
|
|
+ </delete>
|
|
|
|
+ <update id="update" parameterType="com.jpsoft.smart.modules.base.entity.EmployeeInfo">
|
|
|
|
+ update base_employee_info
|
|
|
|
+ <set>
|
|
|
|
+ <if test="name!=null">
|
|
|
|
+ name_=#{name,jdbcType=VARCHAR},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="companyId!=null">
|
|
|
|
+ company_id=#{companyId,jdbcType=VARCHAR},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="photo!=null">
|
|
|
|
+ photo_=#{photo,jdbcType=VARCHAR},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="no!=null">
|
|
|
|
+ no_=#{no,jdbcType=VARCHAR},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="createBy!=null">
|
|
|
|
+ create_by=#{createBy,jdbcType=VARCHAR},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="createTime!=null">
|
|
|
|
+ create_time=#{createTime,jdbcType= TIMESTAMP },
|
|
|
|
+ </if>
|
|
|
|
+ <if test="updateBy!=null">
|
|
|
|
+ update_by=#{updateBy,jdbcType=VARCHAR},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="updateTime!=null">
|
|
|
|
+ update_time=#{updateTime,jdbcType= TIMESTAMP },
|
|
|
|
+ </if>
|
|
|
|
+ <if test="delFlag!=null">
|
|
|
|
+ del_flag=#{delFlag,jdbcType= NUMERIC },
|
|
|
|
+ </if>
|
|
|
|
+ <if test="sortNo!=null">
|
|
|
|
+ sort_no=#{sortNo,jdbcType= NUMERIC },
|
|
|
|
+ </if>
|
|
|
|
+ <if test="openId!=null">
|
|
|
|
+ open_id=#{openId,jdbcType= VARCHAR },
|
|
|
|
+ </if>
|
|
|
|
+ </set>
|
|
|
|
+ where id_=#{id}
|
|
|
|
+ </update>
|
|
|
|
+ <select id="get" parameterType="long" resultMap="EmployeeInfoMap">
|
|
|
|
+ select * from base_employee_info where id_=#{0}
|
|
|
|
+ </select>
|
|
|
|
+ <select id="exist" parameterType="string" resultType="int">
|
|
|
|
+ select count(*) from base_employee_info where id_=#{0}
|
|
|
|
+ </select>
|
|
|
|
+ <select id="list" resultMap="EmployeeInfoMap">
|
|
|
|
+ select * from base_employee_info
|
|
|
|
+ </select>
|
|
|
|
+ <select id="search" parameterType="hashmap" resultMap="EmployeeInfoMap">
|
|
|
|
+ <![CDATA[
|
|
|
|
+ select * from base_employee_info e,base_company_info c
|
|
|
|
+ ]]>
|
|
|
|
+ <where>
|
|
|
|
+ e.company_id = c.id_ and c.del_flag=0
|
|
|
|
+ <if test="searchParams.employeeName != null">
|
|
|
|
+ and e.name_ like #{searchParams.employeeName}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="searchParams.companyId != null">
|
|
|
|
+ and e.company_id = #{searchParams.companyId}
|
|
|
|
+ </if>
|
|
|
|
+ </where>
|
|
|
|
+ <foreach item="sort" collection="sortList" open="order by" separator=",">
|
|
|
|
+ ${sort.name} ${sort.order}
|
|
|
|
+ </foreach>
|
|
|
|
+ </select>
|
|
|
|
+ <select id="findByArray" resultMap="EmployeeInfoMap">
|
|
|
|
+ select * from base_employee_info where id_ in
|
|
|
|
+ <foreach item="item" collection="array" open="(" separator="," close=")">
|
|
|
|
+ ${item}
|
|
|
|
+ </foreach>
|
|
|
|
+ </select>
|
|
|
|
+ <select id="findByOpenId" resultMap="EmployeeInfoMap" parameterType="string">
|
|
|
|
+ select * from base_employee_info where open_id=#{openId}
|
|
|
|
+ </select>
|
|
|
|
+</mapper>
|