<?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.gkhy.hazmat.system.mapper.SysConfigMapper">
|
|
<resultMap type="com.gkhy.hazmat.system.domain.SysConfig" id="SysConfigResult">
|
<id property="id" column="id" />
|
<result property="logoPath" column="logo_path" />
|
<result property="useProd" column="use_prod" />
|
<result property="companyId" column="company_id" />
|
<result property="createBy" column="create_by" />
|
<result property="createTime" column="create_time" />
|
<result property="updateBy" column="update_by" />
|
<result property="updateTime" column="update_time" />
|
<result property="companyName" column="company_name" />
|
</resultMap>
|
|
<sql id="selectConfigVo">
|
select a.id, a.logo_path, a.use_prod, a.company_id, a.create_by, a.create_time, a.update_by, a.update_time,b.name as company_name
|
from sys_config a
|
left join sys_company b on b.id=a.company_id
|
</sql>
|
|
<!-- 查询条件 -->
|
<sql id="sqlwhereSearch">
|
<where>
|
<if test="id !=null">
|
and a.id = #{id}
|
</if>
|
<if test="companyId !=null">
|
and a.company_id = #{companyId}
|
</if>
|
</where>
|
</sql>
|
|
<select id="getConfig" resultMap="SysConfigResult">
|
<include refid="selectConfigVo"></include>
|
<include refid="sqlwhereSearch"></include>
|
</select>
|
|
<select id="selectConfigList" resultMap="SysConfigResult">
|
<include refid="selectConfigVo"/>
|
<where>
|
<if test="companyId !=null">
|
and a.company_id = #{companyId}
|
</if>
|
</where>
|
</select>
|
|
<select id="getConfigByCompanyId" resultType="com.gkhy.hazmat.system.domain.SysConfig"
|
parameterType="java.lang.Long">
|
select * from sys_config where company_id=#{companyId}
|
</select>
|
</mapper>
|