Blame view

src/main/resources/mybatis/smapper/AsraOpSmapper.xml 2.84 KB
1b9e8898   王富生   提交
1
2
3
4
5
6
7
8
9
10
11
12
  <?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.zteits.oa.report.mapper.smapper.AsraOpSmapper">
    <resultMap id="BaseResultMap" type="com.zteits.oa.report.domain.AsraOp">
      <id column="id" jdbcType="BIGINT" property="id" />
      <result column="login_code" jdbcType="VARCHAR" property="loginCode" />
      <result column="login_password" jdbcType="VARCHAR" property="loginPassword" />
      <result column="op_name" jdbcType="VARCHAR" property="opName" />
      <result column="email" jdbcType="VARCHAR" property="email" />
      <result column="role_id" jdbcType="BIGINT" property="roleId" />
      <result column="city_id" jdbcType="BIGINT" property="cityId" />
      <result column="city_name" jdbcType="VARCHAR" property="cityName" />
1b9e8898   王富生   提交
13
14
15
16
17
18
19
20
21
22
23
      <result column="is_remind_email" jdbcType="INTEGER" property="isRemindEmail" />
      <result column="data_state" jdbcType="INTEGER" property="dataState" />
      <result column="create_empid" jdbcType="VARCHAR" property="createEmpid" />
      <result column="create_emp_name" jdbcType="VARCHAR" property="createEmpName" />
      <result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
      <result column="modfiy_empid" jdbcType="VARCHAR" property="modfiyEmpid" />
      <result column="modfiy_emp_name" jdbcType="VARCHAR" property="modfiyEmpName" />
      <result column="modfiy_date" jdbcType="TIMESTAMP" property="modfiyDate" />
      <result column="remark" jdbcType="VARCHAR" property="remark" />
    </resultMap>
    <sql id="Base_Column_List">
900781d3   王富生   提交
24
      id, login_code, login_password, op_name, email, role_id, city_id, city_name, 
1b9e8898   王富生   提交
25
26
27
28
29
      is_remind_email, data_state, create_empid, create_emp_name, create_date, modfiy_empid, 
      modfiy_emp_name, modfiy_date, remark
    </sql>
    
    <select id="queryAsraOpForList" parameterType="com.zteits.oa.api.dto.asraop.param.AsraOpQueryReq" resultMap="BaseResultMap">
9dc8e4e6   xiejianpeng   员工管理
30
31
32
33
34
35
36
37
38
39
40
41
42
43
      select
      ap.id id,
      ap.login_code loginCode,
      ap.op_name opName,
      ap.email email,
      ap.role_id roleId,
      ap.city_id cityId,
      ap.city_name cityName,
      ap.is_remind_email isRemindEmail
      from asra_op ap,asra_op_relations apr
      where 1=1 and ap.id = apr.op_id
        <if test="id != null ">
          and apr.parent_id = #{id} or ap.id = #{id}
        </if>
2f6df64b   xiejianpeng   员工管理
44
        <if test="loginCode != null and loginCode !=''">
9dc8e4e6   xiejianpeng   员工管理
45
          and ap.login_code = #{loginCode,jdbcType=VARCHAR}
1b9e8898   王富生   提交
46
47
        </if>
        <if test="opName != null and opName != ''">
9dc8e4e6   xiejianpeng   员工管理
48
          and ap.op_name ike concat('${opName}','%')
1b9e8898   王富生   提交
49
50
        </if>
        <if test="email != null and email != ''">
9dc8e4e6   xiejianpeng   员工管理
51
          and ap.email = #{email,jdbcType=VARCHAR}
1b9e8898   王富生   提交
52
        </if>
9dc8e4e6   xiejianpeng   员工管理
53
54
        <if test="opIdLists != null">
          and ap.id in
2f6df64b   xiejianpeng   员工管理
55
56
57
58
          <foreach collection="opIdLists" item="opId"  open="(" close=")" separator="," >
            #{opId}
          </foreach>
        </if>
1b9e8898   王富生   提交
59
60
61
    </select>
   
    </mapper>