123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102 |
- <?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.zhyc.xps.sys.mapper.AppPermitMapper">
- <resultMap id="AppPermitDtoMap" type="com.zhyc.xps.sys.dto.AppPermitDto" >
- <result column="oc_id" property="ocId" jdbcType="BIGINT" /><!--OC ID-->
- <result column="app_id" property="appId" jdbcType="BIGINT" /><!--App ID-->
- <result column="app_cat_title" property="appCatTitle" jdbcType="VARCHAR"/>
- <result column="app_cat_id" property="appCatId" jdbcType="BIGINT" />
- <result column="app_title" property="appTitle" jdbcType="VARCHAR"/>
- <result column="app_desc" property="appDesc" jdbcType="VARCHAR"/>
- <result column="app_logo" property="appLogo" jdbcType="VARCHAR"/>
- <result column="app_url" property="appUrl" jdbcType="VARCHAR"/>
- <result column="app_param" property="appParam" jdbcType="VARCHAR"/>
- <result column="app_desc" property="appDesc" jdbcType="VARCHAR"/>
- </resultMap>
- <sql id="AppPermitDto_Cols">
- A.app_id,
- A.oc_id,
- B.app_cat_id,
- C.app_cat_title,
- B.app_title,
- B.app_url,
- B.app_param,
- B.app_logo,
- B.app_desc
- </sql>
- <!--基于ID查询-->
- <select id="getById" resultMap="AppPermitDtoMap">
- SELECT
- <include refid="AppPermitDto_Cols"/>
- FROM app_permit AS A
- LEFT JOIN app AS B ON (A.app_id = B.app_id)
- LEFT JOIN app_cat AS C ON (B.app_cat_id = C.app_cat_id)
- WHERE A.oc_id = #{ocId ,jdbcType=BIGINT} AND A.app_id = #{appId ,jdbcType=BIGINT}
- </select>
- <!--列表查询-->
- <select id="getByList" resultMap="AppPermitDtoMap" parameterType="java.util.Map">
- SELECT
- <include refid="AppPermitDto_Cols"/>
- FROM app_permit AS A
- LEFT JOIN app AS B ON (A.app_id = B.app_id)
- LEFT JOIN app_cat AS C ON (B.app_cat_id = C.app_cat_id)
- WHERE A.oc_id = #{ocId ,jdbcType=BIGINT}
- <if test="keywords != null and keywords != ''">
- AND B.app_title like "%"#{keywords}"%"
- </if>
- <if test="appCatId != null">
- AND B.app_cat_id = #{appCatId ,jdbcType=BIGINT}
- </if>
- ORDER BY A.app_id ASC
- </select>
-
- <!--分页查询-->
- <select id="getByPage" resultMap="AppPermitDtoMap" parameterType="java.util.Map">
- SELECT
- <include refid="AppPermitDto_Cols"/>
- FROM app_permit AS A
- LEFT JOIN app AS B ON (A.app_id = B.app_id)
- LEFT JOIN app_cat AS C ON (B.app_cat_id = C.app_cat_id)
- WHERE A.oc_id = #{ocId ,jdbcType=BIGINT}
- <if test="keywords != null and keywords != ''">
- AND B.app_title like "%"#{keyword}"%"
- </if>
- <if test="appCatId != null">
- AND B.app_cat_id = #{appCatId ,jdbcType=BIGINT}
- </if>
- ORDER BY A.app_id ASC
- </select>
- <!--新增-->
- <insert id="create" parameterType="com.zhyc.xps.sys.entity.AppPermit" keyProperty="appId">
- INSERT INTO app_permit
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="appId != null">
- app_id,
- </if>
- <if test="ocId != null">
- oc_id,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="appId != null">
- #{appId ,jdbcType=BIGINT},
- </if>
- <if test="ocId != null">
- #{ocId ,jdbcType=BIGINT},
- </if>
- </trim>
- </insert>
- <!--删除 -->
- <delete id="delete" parameterType="java.util.Map">
- DELETE from app_permit
- WHERE oc_id = #{ocId, jdbcType=BIGINT} AND app_id = #{appId ,jdbcType=BIGINT}
- </delete>
- </mapper>
|