Blame view

parking-module-system/src/main/resources/mybatis/smapper/SysCodeDefSMapper.xml 1.91 KB
55f68655   王彪总   新项目
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
  <?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.sys.mapper.smapper.SysCodeDefSMapper">
    <resultMap id="BaseResultMap" type="com.zteits.sys.domain.SysCodeDef">
      <id column="id" jdbcType="BIGINT" property="id" />
      <result column="code_kind" jdbcType="VARCHAR" property="codeKind" />
      <result column="code_name" jdbcType="VARCHAR" property="codeName" />
      <result column="code_desc" jdbcType="VARCHAR" property="codeDesc" />
      <result column="data_state" jdbcType="INTEGER" property="dataState" />
      <result column="creator" jdbcType="BIGINT" property="creator" />
      <result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
      <result column="modifier" jdbcType="BIGINT" property="modifier" />
      <result column="modify_date" jdbcType="TIMESTAMP" property="modifyDate" />
    </resultMap>
    <sql id="Base_Column_List">
      id, code_kind, code_name, code_desc, data_state, creator, create_date, modifier, 
      modify_date
    </sql>
    <!-- 查询字典表 -->
    <select id="querySysCodeDef" parameterType="com.zteits.sys.domain.SysCodeDef" resultMap="BaseResultMap">
      select 
      <include refid="Base_Column_List" />
      from sys_code_def
      <where>
      	<choose>
      		<when test="dataState!=null">
      			and data_state = #{dataState,jdbcType=INTEGER}
      		</when>
      		<otherwise>
      			and data_state=1
      		</otherwise>
      	</choose>
      </where> 
    </select>
    <!-- 查询满足条件个数 -->
    <select id="queryCount" parameterType="com.zteits.sys.domain.SysCodeDef" resultType="long">
      select 
      count(1)
      from sys_code_def
      <where>
      	<choose>
      		<when test="dataState!=null">
      			and data_state = #{dataState,jdbcType=INTEGER}
      		</when>
      		<otherwise>
      			and data_state=1
      		</otherwise>
      	</choose>
      </where> 
    </select>
  </mapper>