SopTplMapper.xml 2.01 KB
<?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="cn.com.glsx.process.modules.mapper.SopTplMapper">
  <resultMap id="BaseResultMap" type="cn.com.glsx.process.modules.entity.SopTpl">
    <!--
      WARNING - @mbg.generated
    -->
    <id column="tpl_id" jdbcType="VARCHAR" property="tplId" />
    <result column="tpl_name" jdbcType="VARCHAR" property="tplName" />
    <result column="tpl_cron" jdbcType="VARCHAR" property="tplCron" />
    <result column="tpl_remark" jdbcType="VARCHAR" property="tplRemark" />
    <result column="tpl_status" jdbcType="TINYINT" property="tplStatus" />
    <result column="tpl_param_def" jdbcType="VARCHAR" property="tplParamDef" />
    <result column="tpl_result_def" jdbcType="VARCHAR" property="tplResultDef" />
    <result column="tpl_singleton" jdbcType="TINYINT" property="tplSingleton" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
    <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
  </resultMap>
  <resultMap id="BaseResultDTOMap" extends="BaseResultMap" type="cn.com.glsx.process.modules.model.SopTplDTO">
    <association column="tpl_id" jdbcType="INTEGER" property="grantCount" select="cn.com.glsx.process.modules.mapper.SopTplGrantMapper.countByTplId" />
  </resultMap>
  <sql id="Base_Column_List">
    <!--
      WARNING - @mbg.generated
    -->
    tpl_id, tpl_name, tpl_cron, tpl_remark, tpl_status, tpl_param_def, tpl_result_def, 
    tpl_singleton, create_time, update_time
  </sql>

  <select id="page" resultMap="BaseResultDTOMap">
    select
        <include refid="Base_Column_List" />
    from sop_tpl
    <where>
      <if test="id != null and id !=''">
        and tpl_id = #{id}
      </if>
      <if test="name != null and name !=''">
        and tpl_name = #{name}
      </if>
      <if test="status != null">
        and tpl_status = #{status}
      </if>
    </where>
    order by update_time desc
  </select>

</mapper>