|
|
@@ -0,0 +1,204 @@
|
|
|
+<?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.usoftchina.saas.document.mapper.EmployeeMapper">
|
|
|
+ <resultMap id="BaseResultMap" type="com.usoftchina.saas.document.entities.Employee">
|
|
|
+ <id column="em_id" jdbcType="INTEGER" property="id" />
|
|
|
+ <result column="em_code" jdbcType="VARCHAR" property="em_code" />
|
|
|
+ <result column="em_name" jdbcType="VARCHAR" property="em_name" />
|
|
|
+ <result column="em_password" jdbcType="VARCHAR" property="em_password" />
|
|
|
+ <result column="em_class" jdbcType="VARCHAR" property="em_class" />
|
|
|
+ <result column="em_mobile" jdbcType="VARCHAR" property="em_mobile" />
|
|
|
+ <result column="em_email" jdbcType="VARCHAR" property="em_email" />
|
|
|
+ <result column="companyId" jdbcType="INTEGER" property="companyId" />
|
|
|
+ <result column="updaterId" jdbcType="INTEGER" property="updaterId" />
|
|
|
+ <result column="updateTime" jdbcType="TIMESTAMP" property="updateTime" />
|
|
|
+ <result column="em_text1" jdbcType="VARCHAR" property="em_text1" />
|
|
|
+ <result column="em_text2" jdbcType="VARCHAR" property="em_text2" />
|
|
|
+ <result column="em_text3" jdbcType="VARCHAR" property="em_text3" />
|
|
|
+ <result column="em_text4" jdbcType="VARCHAR" property="em_text4" />
|
|
|
+ <result column="em_text5" jdbcType="VARCHAR" property="em_text5" />
|
|
|
+ </resultMap>
|
|
|
+ <sql id="Base_Column_List">
|
|
|
+ em_id, em_code, em_name, em_password, em_class, em_mobile, em_email, companyId, updaterId,
|
|
|
+ updateTime, em_text1, em_text2, em_text3, em_text4, em_text5
|
|
|
+ </sql>
|
|
|
+ <select id="selectByPrimaryKey" parameterType="long" resultMap="BaseResultMap">
|
|
|
+ select
|
|
|
+ <include refid="Base_Column_List" />
|
|
|
+ from employee
|
|
|
+ where em_id = #{em_id,jdbcType=INTEGER}
|
|
|
+ </select>
|
|
|
+ <delete id="deleteByPrimaryKey" parameterType="long">
|
|
|
+ delete from employee
|
|
|
+ where em_id = #{em_id,jdbcType=INTEGER}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <insert id="insertSelective" parameterType="com.usoftchina.saas.document.entities.Employee">
|
|
|
+ <selectKey resultType="java.lang.Long" keyProperty="id">
|
|
|
+ SELECT LAST_INSERT_ID() AS ID
|
|
|
+ </selectKey>
|
|
|
+ insert into employee
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+
|
|
|
+ <if test="em_code != null">
|
|
|
+ em_code,
|
|
|
+ </if>
|
|
|
+ <if test="em_name != null">
|
|
|
+ em_name,
|
|
|
+ </if>
|
|
|
+ <if test="em_password != null">
|
|
|
+ em_password,
|
|
|
+ </if>
|
|
|
+ <if test="em_class != null">
|
|
|
+ em_class,
|
|
|
+ </if>
|
|
|
+ <if test="em_mobile != null">
|
|
|
+ em_mobile,
|
|
|
+ </if>
|
|
|
+ <if test="em_email != null">
|
|
|
+ em_email,
|
|
|
+ </if>
|
|
|
+ <if test="companyId != null">
|
|
|
+ companyId,
|
|
|
+ </if>
|
|
|
+ <if test="updaterId != null">
|
|
|
+ updaterId,
|
|
|
+ </if>
|
|
|
+ <if test="updateTime != null">
|
|
|
+ updateTime,
|
|
|
+ </if>
|
|
|
+ <if test="em_text1 != null">
|
|
|
+ em_text1,
|
|
|
+ </if>
|
|
|
+ <if test="em_text2 != null">
|
|
|
+ em_text2,
|
|
|
+ </if>
|
|
|
+ <if test="em_text3 != null">
|
|
|
+ em_text3,
|
|
|
+ </if>
|
|
|
+ <if test="em_text4 != null">
|
|
|
+ em_text4,
|
|
|
+ </if>
|
|
|
+ <if test="em_text5 != null">
|
|
|
+ em_text5,
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+
|
|
|
+ <if test="em_code != null">
|
|
|
+ #{em_code,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="em_name != null">
|
|
|
+ #{em_name,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="em_password != null">
|
|
|
+ #{em_password,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="em_class != null">
|
|
|
+ #{em_class,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="em_mobile != null">
|
|
|
+ #{em_mobile,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="em_email != null">
|
|
|
+ #{em_email,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="companyId != null">
|
|
|
+ #{companyId,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="updaterId != null">
|
|
|
+ #{updaterId,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="updateTime != null">
|
|
|
+ #{updateTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="em_text1 != null">
|
|
|
+ #{em_text1,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="em_text2 != null">
|
|
|
+ #{em_text2,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="em_text3 != null">
|
|
|
+ #{em_text3,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="em_text4 != null">
|
|
|
+ #{em_text4,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="em_text5 != null">
|
|
|
+ #{em_text5,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+ <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.document.entities.Employee">
|
|
|
+ update employee
|
|
|
+ <set>
|
|
|
+ <if test="em_code != null">
|
|
|
+ em_code = #{em_code,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="em_name != null">
|
|
|
+ em_name = #{em_name,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="em_password != null">
|
|
|
+ em_password = #{em_password,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="em_class != null">
|
|
|
+ em_class = #{em_class,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="em_mobile != null">
|
|
|
+ em_mobile = #{em_mobile,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="em_email != null">
|
|
|
+ em_email = #{em_email,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="companyId != null">
|
|
|
+ companyId = #{companyId,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="updaterId != null">
|
|
|
+ updaterId = #{updaterId,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="updateTime != null">
|
|
|
+ updateTime = #{updateTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="em_text1 != null">
|
|
|
+ em_text1 = #{em_text1,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="em_text2 != null">
|
|
|
+ em_text2 = #{em_text2,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="em_text3 != null">
|
|
|
+ em_text3 = #{em_text3,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="em_text4 != null">
|
|
|
+ em_text4 = #{em_text4,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="em_text5 != null">
|
|
|
+ em_text5 = #{em_text5,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ where em_id = #{id,jdbcType=INTEGER}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <!--查询所有物料信息-->
|
|
|
+ <select id="selectEmployeeListByCondition" resultMap="BaseResultMap" parameterType="com.usoftchina.saas.commons.dto.DocReqDTO">
|
|
|
+ SELECT * FROM Employee
|
|
|
+ <where>
|
|
|
+ <if test="con != null">
|
|
|
+ ${con}
|
|
|
+ </if>
|
|
|
+ <if test="companyId != null">
|
|
|
+ and companyid = #{companyId}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ ORDER BY em_ID DESC
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
+ <select id="validateCodeWhenInsert" resultType="int">
|
|
|
+ select count(*) from Employee where em_code = #{code} and companyId =#{companyId}
|
|
|
+ </select>
|
|
|
+ <select id="validateCodeWhenUpdate" resultType="int" >
|
|
|
+ select count(*) from Employee where em_code = #{code} and em_id != #{id} and companyId =#{companyId}
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
+</mapper>
|