<?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.gk.firework.Mapper.EnterpriseDocumentMapper" >
|
<resultMap id="BaseResultMap" type="com.gk.firework.Domain.EnterpriseDocument" >
|
<!-- -->
|
<id column="id" property="id" jdbcType="BIGINT" />
|
<result column="name" property="name" jdbcType="VARCHAR" />
|
<result column="createby" property="createby" jdbcType="BIGINT" />
|
<result column="createbyname" property="createbyname" jdbcType="VARCHAR" />
|
<result column="updateby" property="updateby" jdbcType="BIGINT" />
|
<result column="updatebyname" property="updatebyname" jdbcType="VARCHAR" />
|
<result column="createtime" property="createtime" jdbcType="TIMESTAMP" />
|
<result column="updatetime" property="updatetime" jdbcType="TIMESTAMP" />
|
<result column="validflag" property="validflag" jdbcType="BIT" />
|
<result column="memo" property="memo" jdbcType="VARCHAR" />
|
<result column="type" property="type" jdbcType="VARCHAR" />
|
<result column="settime" property="settime" jdbcType="TIMESTAMP" />
|
<collection property="enterpriseResources"
|
javaType="java.util.List"
|
ofType="com.gk.firework.Domain.EnterpriseResource"
|
column="{edid=id,tabletype=tabletype}"
|
select="selectInner">
|
</collection>
|
</resultMap>
|
|
<sql id="Base_Column_List" >
|
<!-- -->
|
id, name, createby, createbyname, updateby, updatebyname, createtime, updatetime,
|
validflag, memo, type
|
</sql>
|
|
<select id="selectInner" parameterType = "java.util.Map" resultType="com.gk.firework.Domain.EnterpriseResource">
|
select er.id id, er.url,er.filename,er.tabletype
|
from enterpriseresource er
|
where er.validflag = 1
|
and tabletype = #{tabletype}
|
and belongid = #{edid}
|
</select>
|
|
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
|
<!-- -->
|
select
|
<include refid="Base_Column_List" />
|
from enterprisedocument
|
where id = #{id,jdbcType=BIGINT}
|
</select>
|
<select id="selectPages" parameterType = "java.util.Map" resultMap="BaseResultMap">
|
select ed.*,
|
#{params.tabletype} tabletype
|
from enterprisedocument ed
|
where ed.validflag = 1
|
and ed.enterpriseid = #{params.id}
|
and ed.type = #{params.type}
|
order by ed.createtime desc
|
</select>
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
|
<!-- -->
|
delete from enterprisedocument
|
where id = #{id,jdbcType=BIGINT}
|
</delete>
|
|
<insert id="insertSelective" parameterType="com.gk.firework.Domain.EnterpriseDocument" >
|
<!-- -->
|
insert into enterprisedocument
|
<trim prefix="(" suffix=")" suffixOverrides="," >
|
<if test="id != null" >
|
id,
|
</if>
|
<if test="name != null" >
|
name,
|
</if>
|
<if test="createby != null" >
|
createby,
|
</if>
|
<if test="createbyname != null" >
|
createbyname,
|
</if>
|
<if test="updateby != null" >
|
updateby,
|
</if>
|
<if test="updatebyname != null" >
|
updatebyname,
|
</if>
|
<if test="createtime != null" >
|
createtime,
|
</if>
|
<if test="updatetime != null" >
|
updatetime,
|
</if>
|
<if test="validflag != null" >
|
validflag,
|
</if>
|
<if test="memo != null" >
|
memo,
|
</if>
|
<if test="type != null" >
|
type,
|
</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides="," >
|
<if test="id != null" >
|
#{id,jdbcType=BIGINT},
|
</if>
|
<if test="name != null" >
|
#{name,jdbcType=VARCHAR},
|
</if>
|
<if test="createby != null" >
|
#{createby,jdbcType=BIGINT},
|
</if>
|
<if test="createbyname != null" >
|
#{createbyname,jdbcType=VARCHAR},
|
</if>
|
<if test="updateby != null" >
|
#{updateby,jdbcType=BIGINT},
|
</if>
|
<if test="updatebyname != null" >
|
#{updatebyname,jdbcType=VARCHAR},
|
</if>
|
<if test="createtime != null" >
|
#{createtime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="updatetime != null" >
|
#{updatetime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="validflag != null" >
|
#{validflag,jdbcType=BIT},
|
</if>
|
<if test="memo != null" >
|
#{memo,jdbcType=VARCHAR},
|
</if>
|
<if test="type != null" >
|
#{type,jdbcType=VARCHAR},
|
</if>
|
</trim>
|
</insert>
|
<update id="updateByPrimaryKeySelective" parameterType="com.gk.firework.Domain.EnterpriseDocument" >
|
<!-- -->
|
update enterprisedocument
|
<set >
|
<if test="name != null" >
|
name = #{name,jdbcType=VARCHAR},
|
</if>
|
<if test="createby != null" >
|
createby = #{createby,jdbcType=BIGINT},
|
</if>
|
<if test="createbyname != null" >
|
createbyname = #{createbyname,jdbcType=VARCHAR},
|
</if>
|
<if test="updateby != null" >
|
updateby = #{updateby,jdbcType=BIGINT},
|
</if>
|
<if test="updatebyname != null" >
|
updatebyname = #{updatebyname,jdbcType=VARCHAR},
|
</if>
|
<if test="createtime != null" >
|
createtime = #{createtime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="updatetime != null" >
|
updatetime = #{updatetime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="validflag != null" >
|
validflag = #{validflag,jdbcType=BIT},
|
</if>
|
<if test="memo != null" >
|
memo = #{memo,jdbcType=VARCHAR},
|
</if>
|
<if test="type != null" >
|
type = #{type,jdbcType=VARCHAR},
|
</if>
|
</set>
|
where id = #{id,jdbcType=BIGINT}
|
</update>
|
<update id="updateByPrimaryKey" parameterType="com.gk.firework.Domain.EnterpriseDocument" >
|
<!-- -->
|
update enterprisedocument
|
set name = #{name,jdbcType=VARCHAR},
|
createby = #{createby,jdbcType=BIGINT},
|
createbyname = #{createbyname,jdbcType=VARCHAR},
|
updateby = #{updateby,jdbcType=BIGINT},
|
updatebyname = #{updatebyname,jdbcType=VARCHAR},
|
createtime = #{createtime,jdbcType=TIMESTAMP},
|
updatetime = #{updatetime,jdbcType=TIMESTAMP},
|
validflag = #{validflag,jdbcType=BIT},
|
memo = #{memo,jdbcType=VARCHAR},
|
type = #{type,jdbcType=VARCHAR}
|
where id = #{id,jdbcType=BIGINT}
|
</update>
|
</mapper>
|