SmsTemplateConfigRltParkingSMapper.xml 5.93 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="com.zteits.park.mapper.smapper.SmsTemplateConfigRltParkingSMapper">
  <resultMap id="BaseResultMap" type="com.zteits.park.domain.SmsTemplateConfigRltParking">
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="sms_id" jdbcType="VARCHAR" property="smsId" />
    <result column="pl_no" jdbcType="VARCHAR" property="plNo" />
    <result column="pl_name" jdbcType="VARCHAR" property="plName" />
    <result column="pl_type" jdbcType="INTEGER" property="plType" />
    <result column="pl_busi_type" jdbcType="VARCHAR" property="plBusiType" />
    <result column="source_type" jdbcType="INTEGER" property="sourceType" />
    <result column="org_id" jdbcType="BIGINT" property="orgId" />
    <result column="data_status" jdbcType="INTEGER" property="dataStatus" />
    <result column="create_empid" jdbcType="VARCHAR" property="createEmpid" />
    <result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
    <result column="modfiy_empid" jdbcType="VARCHAR" property="modfiyEmpid" />
    <result column="modfiy_date" jdbcType="TIMESTAMP" property="modfiyDate" />
    <result column="park_num" jdbcType="INTEGER" property="parkNum" />
<!--    <result column="template_id" jdbcType="VARCHAR" property="templateId" />-->
<!--    <result column="template_name" jdbcType="VARCHAR" property="templateName" />-->
<!--    <result column="template_content" jdbcType="VARCHAR" property="templateContent" />-->
<!--    <result column="template_type" jdbcType="INTEGER" property="templateType" />-->
  </resultMap>

  <resultMap id="BaseResultSMap" type="com.zteits.clouds.api.dto.park.dto.SmsTemplateConfigRltParkingDTO">
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="sms_id" jdbcType="VARCHAR" property="smsId" />
    <result column="pl_no" jdbcType="VARCHAR" property="plNo" />
    <result column="pl_name" jdbcType="VARCHAR" property="plName" />
    <result column="pl_type" jdbcType="INTEGER" property="plType" />
    <result column="pl_busi_type" jdbcType="VARCHAR" property="plBusiType" />
    <result column="source_type" jdbcType="INTEGER" property="sourceType" />
    <result column="org_id" jdbcType="BIGINT" property="orgId" />
    <result column="data_status" jdbcType="INTEGER" property="dataStatus" />
    <result column="create_empid" jdbcType="VARCHAR" property="createEmpid" />
    <result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
    <result column="modfiy_empid" jdbcType="VARCHAR" property="modfiyEmpid" />
    <result column="modfiy_date" jdbcType="TIMESTAMP" property="modfiyDate" />
    <result column="park_num" jdbcType="INTEGER" property="parkNum" />
    <result column="template_id" jdbcType="VARCHAR" property="templateId" />
    <result column="template_name" jdbcType="VARCHAR" property="templateName" />
    <result column="template_content" jdbcType="VARCHAR" property="templateContent" />
  </resultMap>
  <sql id="Example_Where_Clause">
    <where>
      <foreach collection="oredCriteria" item="criteria" separator="or">
        <if test="criteria.valid">
          <trim prefix="(" prefixOverrides="and" suffix=")">
            <foreach collection="criteria.criteria" item="criterion">
              <choose>
                <when test="criterion.noValue">
                  and ${criterion.condition}
                </when>
                <when test="criterion.singleValue">
                  and ${criterion.condition} #{criterion.value}
                </when>
                <when test="criterion.betweenValue">
                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
                </when>
                <when test="criterion.listValue">
                  and ${criterion.condition}
                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
                    #{listItem}
                  </foreach>
                </when>
              </choose>
            </foreach>
          </trim>
        </if>
      </foreach>
    </where>
  </sql>
  <sql id="Update_By_Example_Where_Clause">
    <where>
      <foreach collection="example.oredCriteria" item="criteria" separator="or">
        <if test="criteria.valid">
          <trim prefix="(" prefixOverrides="and" suffix=")">
            <foreach collection="criteria.criteria" item="criterion">
              <choose>
                <when test="criterion.noValue">
                  and ${criterion.condition}
                </when>
                <when test="criterion.singleValue">
                  and ${criterion.condition} #{criterion.value}
                </when>
                <when test="criterion.betweenValue">
                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
                </when>
                <when test="criterion.listValue">
                  and ${criterion.condition}
                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
                    #{listItem}
                  </foreach>
                </when>
              </choose>
            </foreach>
          </trim>
        </if>
      </foreach>
    </where>
  </sql>
  <sql id="Base_Column_List">
    id, sms_id, pl_no, pl_name, pl_type, pl_busi_type, source_type, org_id, data_status, 
    create_empid, create_date, modfiy_empid, modfiy_date, park_num
  </sql>

  <select id="selectByPlNo" parameterType="com.zteits.clouds.api.dto.park.param.SmsTemplateConfigRltParkingRequest" resultMap="BaseResultSMap">
    select r.sms_id, r.pl_no, c.template_id
      from sms_template_config_rlt_parking r,
           sms_template_config c
      where r.sms_id = c.sms_id
        and r.pl_no =  #{plNo,jdbcType=VARCHAR}
        and c.data_status = 1
    <if test="orgId != null and orgId != ''">
      AND c.org_id = #{orgId}
    </if>
    limit 1
  </select>
</mapper>