first commit
This commit is contained in:
@@ -0,0 +1,117 @@
|
||||
<?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.mhd.system.mapper.SysAccountingRulesMapper">
|
||||
|
||||
<resultMap type="com.mhd.system.domain.vo.SysAccountingRulesVO" id="SysAccountingRulesResult">
|
||||
<result property="accountingId" column="accounting_id"/>
|
||||
<result property="accountingName" column="accounting_name"/>
|
||||
<result property="unitPrice" column="unit_price"/>
|
||||
<result property="unit" column="unit"/>
|
||||
<result property="money" column="money"/>
|
||||
<result property="remark" column="remark"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<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="productId" column="product_id"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSysAccountingRulesVo">
|
||||
SELECT
|
||||
a.accounting_id,
|
||||
a.accounting_name,
|
||||
a.unit_price,
|
||||
a.unit,
|
||||
a.money,
|
||||
a.product_id,
|
||||
a.remark,
|
||||
a.del_flag,
|
||||
a.create_by,
|
||||
a.create_time,
|
||||
a.update_by,
|
||||
a.update_time,
|
||||
b.product_name productName
|
||||
FROM
|
||||
sys_accounting_rules a
|
||||
LEFT JOIN sys_product b on a.product_id = b.product_id
|
||||
</sql>
|
||||
|
||||
<select id="selectSysAccountingRulesList" parameterType="com.mhd.system.domain.dto.SysAccountingRulesDTO"
|
||||
resultMap="SysAccountingRulesResult">
|
||||
<include refid="selectSysAccountingRulesVo"/>
|
||||
WHERE
|
||||
a.del_flag = 0
|
||||
<if test="accountingName != null and accountingName != ''">and a.accounting_name like concat('%' , #{accountingName} , '%')
|
||||
</if>
|
||||
<if test="productId != null">and b.product_id = #{productId}</if>
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectSysAccountingRulesByAccountingId" parameterType="Long" resultMap="SysAccountingRulesResult">
|
||||
<include refid="selectSysAccountingRulesVo"/>
|
||||
where accounting_id = #{accountingId}
|
||||
</select>
|
||||
|
||||
<insert id="insertSysAccountingRules" parameterType="com.mhd.system.domain.dto.SysAccountingRulesDTO"
|
||||
useGeneratedKeys="true" keyProperty="accountingId">
|
||||
insert into sys_accounting_rules
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="accountingName != null and accountingName != ''">accounting_name,</if>
|
||||
<if test="unitPrice != null">unit_price,</if>
|
||||
<if test="unit != null and unit != ''">unit,</if>
|
||||
<if test="money != null">money,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="productId != null">product_id,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="accountingName != null and accountingName != ''">#{accountingName},</if>
|
||||
<if test="unitPrice != null">#{unitPrice},</if>
|
||||
<if test="unit != null and unit != ''">#{unit},</if>
|
||||
<if test="money != null">#{money},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="productId != null">#{productId},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateSysAccountingRules" parameterType="SysAccountingRules">
|
||||
update sys_accounting_rules
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="accountingName != null and accountingName != ''">accounting_name = #{accountingName},</if>
|
||||
<if test="unitPrice != null">unit_price = #{unitPrice},</if>
|
||||
<if test="unit != null and unit != ''">unit = #{unit},</if>
|
||||
<if test="money != null">money = #{money},</if>
|
||||
<if test="productId != null">product_id = #{productId},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where accounting_id = #{accountingId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteSysAccountingRulesByAccountingId" parameterType="Long">
|
||||
update sys_accounting_rules set del_flag = 1 where accounting_id = #{accountingId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSysAccountingRulesByAccountingIds" parameterType="String">
|
||||
update sys_accounting_rules set del_flag = 1 where accounting_id in
|
||||
<foreach item="accountingId" collection="array" open="(" separator="," close=")">
|
||||
#{accountingId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -0,0 +1,80 @@
|
||||
<?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.mhd.system.mapper.SysCompanyAgreementMapper">
|
||||
|
||||
<resultMap type="SysCompanyAgreement" id="SysCompanyAgreementResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="agreementName" column="agreement_name" />
|
||||
<result property="agreementCont" column="agreement_cont" />
|
||||
<result property="type" column="type" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="statusFlag" column="status_flag" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSysCompanyAgreementVo">
|
||||
select id, agreement_name, agreement_cont, type, create_time, status_flag, del_flag from sys_company_agreement
|
||||
</sql>
|
||||
|
||||
<select id="selectSysCompanyAgreementList" parameterType="SysCompanyAgreement" resultMap="SysCompanyAgreementResult">
|
||||
<include refid="selectSysCompanyAgreementVo"/>
|
||||
<where>
|
||||
<if test="agreementName != null and agreementName != ''"> and agreement_name like concat('%', #{agreementName}, '%')</if>
|
||||
<if test="agreementCont != null and agreementCont != ''"> and agreement_cont = #{agreementCont}</if>
|
||||
<if test="type != null and type != ''"> and type = #{type}</if>
|
||||
<if test="statusFlag != null "> and status_flag = #{statusFlag}</if>
|
||||
and del_flag = 0
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectSysCompanyAgreementById" parameterType="Long" resultMap="SysCompanyAgreementResult">
|
||||
<include refid="selectSysCompanyAgreementVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertSysCompanyAgreement" parameterType="SysCompanyAgreement" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into sys_company_agreement
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="agreementName != null">agreement_name,</if>
|
||||
<if test="agreementCont != null">agreement_cont,</if>
|
||||
<if test="type != null">type,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="statusFlag != null">status_flag,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="agreementName != null">#{agreementName},</if>
|
||||
<if test="agreementCont != null">#{agreementCont},</if>
|
||||
<if test="type != null">#{type},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="statusFlag != null">#{statusFlag},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateSysCompanyAgreement" parameterType="SysCompanyAgreement">
|
||||
update sys_company_agreement
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="agreementName != null">agreement_name = #{agreementName},</if>
|
||||
<if test="agreementCont != null">agreement_cont = #{agreementCont},</if>
|
||||
<if test="type != null">type = #{type},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="statusFlag != null">status_flag = #{statusFlag},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteSysCompanyAgreementById" parameterType="Long">
|
||||
delete from sys_company_agreement where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSysCompanyAgreementByIds" parameterType="String">
|
||||
delete from sys_company_agreement where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -0,0 +1,95 @@
|
||||
<?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.mhd.system.mapper.SysCompanyAppMapper">
|
||||
|
||||
<resultMap type="SysCompanyApp" id="SysCompanyAppResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="appName" column="app_name" />
|
||||
<result property="appDownload" column="app_download" />
|
||||
<result property="banner" column="banner" />
|
||||
<result property="masterColor" column="master_color" />
|
||||
<result property="appVersion" column="app_version" />
|
||||
<result property="createDatetime" column="create_datetime" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="statusFlag" column="status_flag" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSysCompanyAppVo">
|
||||
select id, app_name, app_download, banner, master_color, app_version, create_datetime, update_time, status_flag, del_flag from sys_company_app
|
||||
</sql>
|
||||
|
||||
<select id="selectSysCompanyAppList" parameterType="SysCompanyApp" resultMap="SysCompanyAppResult">
|
||||
<include refid="selectSysCompanyAppVo"/>
|
||||
<where>
|
||||
<if test="appName != null and appName != ''"> and app_name like concat('%', #{appName}, '%')</if>
|
||||
<if test="appDownload != null and appDownload != ''"> and app_download = #{appDownload}</if>
|
||||
<if test="banner != null and banner != ''"> and banner = #{banner}</if>
|
||||
<if test="masterColor != null and masterColor != ''"> and master_color = #{masterColor}</if>
|
||||
<if test="appVersion != null and appVersion != ''"> and app_version = #{appVersion}</if>
|
||||
<if test="createDatetime != null "> and create_datetime = #{createDatetime}</if>
|
||||
<if test="statusFlag != null "> and status_flag = #{statusFlag}</if>
|
||||
and del_flag = 0
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectSysCompanyAppById" parameterType="Long" resultMap="SysCompanyAppResult">
|
||||
<include refid="selectSysCompanyAppVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertSysCompanyApp" parameterType="SysCompanyApp" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into sys_company_app
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="appName != null">app_name,</if>
|
||||
<if test="appDownload != null">app_download,</if>
|
||||
<if test="banner != null">banner,</if>
|
||||
<if test="masterColor != null">master_color,</if>
|
||||
<if test="appVersion != null">app_version,</if>
|
||||
<if test="createDatetime != null">create_datetime,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="statusFlag != null">status_flag,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="appName != null">#{appName},</if>
|
||||
<if test="appDownload != null">#{appDownload},</if>
|
||||
<if test="banner != null">#{banner},</if>
|
||||
<if test="masterColor != null">#{masterColor},</if>
|
||||
<if test="appVersion != null">#{appVersion},</if>
|
||||
<if test="createDatetime != null">#{createDatetime},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="statusFlag != null">#{statusFlag},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateSysCompanyApp" parameterType="SysCompanyApp">
|
||||
update sys_company_app
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="appName != null">app_name = #{appName},</if>
|
||||
<if test="appDownload != null">app_download = #{appDownload},</if>
|
||||
<if test="banner != null">banner = #{banner},</if>
|
||||
<if test="masterColor != null">master_color = #{masterColor},</if>
|
||||
<if test="appVersion != null">app_version = #{appVersion},</if>
|
||||
<if test="createDatetime != null">create_datetime = #{createDatetime},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="statusFlag != null">status_flag = #{statusFlag},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteSysCompanyAppById" parameterType="Long">
|
||||
delete from sys_company_app where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSysCompanyAppByIds" parameterType="String">
|
||||
delete from sys_company_app where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -0,0 +1,92 @@
|
||||
<?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.mhd.system.mapper.SysCompanyBasicsMapper">
|
||||
|
||||
<resultMap type="SysCompanyBasics" id="SysCompanyBasicsResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="companyName" column="company_name" />
|
||||
<result property="telphone" column="telphone" />
|
||||
<result property="companyAddress" column="company_address" />
|
||||
<result property="companyHttp" column="company_http" />
|
||||
<result property="companyInfo" column="company_info" />
|
||||
<result property="companyLogo" column="company_logo" />
|
||||
<result property="statusFlag" column="status_flag" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSysCompanyBasicsVo">
|
||||
select id, company_name, telphone, company_address, company_http, company_info, company_logo, status_flag, del_flag from sys_company_basics
|
||||
</sql>
|
||||
|
||||
<select id="selectSysCompanyBasicsList" parameterType="SysCompanyBasics" resultMap="SysCompanyBasicsResult">
|
||||
<include refid="selectSysCompanyBasicsVo"/>
|
||||
<where>
|
||||
<if test="companyName != null and companyName != ''"> and company_name like concat('%', #{companyName}, '%')</if>
|
||||
<if test="telphone != null and telphone != ''"> and telphone = #{telphone}</if>
|
||||
<if test="companyAddress != null and companyAddress != ''"> and company_address = #{companyAddress}</if>
|
||||
<if test="companyHttp != null and companyHttp != ''"> and company_http = #{companyHttp}</if>
|
||||
<if test="companyInfo != null and companyInfo != ''"> and company_info = #{companyInfo}</if>
|
||||
<if test="companyLogo != null and companyLogo != ''"> and company_logo = #{companyLogo}</if>
|
||||
<if test="statusFlag != null "> and status_flag = #{statusFlag}</if>
|
||||
and del_flag = 0
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectSysCompanyBasicsById" parameterType="Long" resultMap="SysCompanyBasicsResult">
|
||||
<include refid="selectSysCompanyBasicsVo"/>
|
||||
where id = #{id} and del_flag = 0
|
||||
</select>
|
||||
|
||||
<insert id="insertSysCompanyBasics" parameterType="SysCompanyBasics" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into sys_company_basics
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="companyName != null">company_name,</if>
|
||||
<if test="telphone != null">telphone,</if>
|
||||
<if test="companyAddress != null">company_address,</if>
|
||||
<if test="companyHttp != null">company_http,</if>
|
||||
<if test="companyInfo != null">company_info,</if>
|
||||
<if test="companyLogo != null">company_logo,</if>
|
||||
<if test="statusFlag != null">status_flag,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="companyName != null">#{companyName},</if>
|
||||
<if test="telphone != null">#{telphone},</if>
|
||||
<if test="companyAddress != null">#{companyAddress},</if>
|
||||
<if test="companyHttp != null">#{companyHttp},</if>
|
||||
<if test="companyInfo != null">#{companyInfo},</if>
|
||||
<if test="companyLogo != null">#{companyLogo},</if>
|
||||
<if test="statusFlag != null">#{statusFlag},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateSysCompanyBasics" parameterType="SysCompanyBasics">
|
||||
update sys_company_basics
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="companyName != null">company_name = #{companyName},</if>
|
||||
<if test="telphone != null">telphone = #{telphone},</if>
|
||||
<if test="companyAddress != null">company_address = #{companyAddress},</if>
|
||||
<if test="companyHttp != null">company_http = #{companyHttp},</if>
|
||||
<if test="companyInfo != null">company_info = #{companyInfo},</if>
|
||||
<if test="companyLogo != null">company_logo = #{companyLogo},</if>
|
||||
<if test="statusFlag != null">status_flag = #{statusFlag},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="deleteSysCompanyBasicsById" parameterType="Long">
|
||||
update sys_company_basics set del_flag = 1 where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="deleteSysCompanyBasicsByIds" parameterType="String">
|
||||
update sys_company_basics set del_flag = 1 where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,157 @@
|
||||
<?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.mhd.system.mapper.SysCompanyMapper">
|
||||
|
||||
<resultMap type="com.mhd.system.domain.SysCompany" id="SysCompanyResult">
|
||||
<result property="companyId" column="company_id" />
|
||||
<result property="parentCompanyId" column="parent_company_id" />
|
||||
<result property="companyName" column="company_name" />
|
||||
<result property="companyAddress" column="company_address" />
|
||||
<result property="phone" column="phone" />
|
||||
<result property="isDisable" column="is_disable" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<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="level" column="level" />
|
||||
<result property="userId" column="user_id" />
|
||||
<result property="userName" column="user_name" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSysCompanyVo">
|
||||
select a.company_id,
|
||||
a.parent_company_id,
|
||||
a.company_name,
|
||||
a.company_address,
|
||||
a.phone,
|
||||
a.is_disable,
|
||||
a.del_flag,
|
||||
a.create_by,
|
||||
a.create_time,
|
||||
a.update_by,
|
||||
a.update_time,
|
||||
a.level,
|
||||
a.user_id,
|
||||
a.user_name
|
||||
from sys_company a
|
||||
</sql>
|
||||
|
||||
<select id="selectSysCompanyList" parameterType="com.mhd.system.domain.SysCompany" resultMap="SysCompanyResult">
|
||||
<include refid="selectSysCompanyVo"/>
|
||||
<where>
|
||||
a.del_flag=0
|
||||
<if test="companyId != null "> and (company_id= #{companyId} or parent_company_id = #{companyId})</if>
|
||||
<if test="parentCompanyId != null "> and parent_company_id = #{parentCompanyId}</if>
|
||||
<if test="companyName != null and companyName != ''"> and company_name like concat('%', #{companyName}, '%')</if>
|
||||
<if test="companyAddress != null and companyAddress != ''"> and company_address like concat('%', #{companyAddress}, '%')</if>
|
||||
<if test="phone != null and phone != ''"> and phone like concat('%', #{phone}, '%')</if>
|
||||
<if test="isDisable != null "> and is_disable = #{isDisable}</if>
|
||||
</where>
|
||||
order by a.create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectSysCompanyById" parameterType="java.lang.Long" resultMap="SysCompanyResult">
|
||||
<include refid="selectSysCompanyVo"/>
|
||||
where company_id = #{id} and del_flag=0
|
||||
</select>
|
||||
<select id="selectSysCompanyByUserId" parameterType="java.lang.Long" resultMap="SysCompanyResult">
|
||||
<include refid="selectSysCompanyVo"/>
|
||||
where user_id = #{userId} and del_flag=0
|
||||
</select>
|
||||
<select id="selectSysCompanyByUserName" parameterType="java.lang.String" resultMap="SysCompanyResult">
|
||||
<include refid="selectSysCompanyVo"/>
|
||||
where user_name = #{userName} and del_flag=0
|
||||
</select>
|
||||
|
||||
<insert id="insertSysCompany" parameterType="com.mhd.system.domain.SysCompany" useGeneratedKeys="true" keyProperty="companyId">
|
||||
insert into sys_company
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="parentCompanyId != null">parent_company_id,</if>
|
||||
<if test="companyName != null">company_name,</if>
|
||||
<if test="companyAddress != null">company_address,</if>
|
||||
<if test="phone != null">phone,</if>
|
||||
<if test="isDisable != null">is_disable,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="userName != null">user_name,</if>
|
||||
<if test="userId != null">user_id,</if>
|
||||
<if test="level != null">level,</if>
|
||||
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="parentCompanyId != null">#{parentCompanyId},</if>
|
||||
<if test="companyName != null">#{companyName},</if>
|
||||
<if test="companyAddress != null">#{companyAddress},</if>
|
||||
<if test="phone != null">#{phone},</if>
|
||||
<if test="isDisable != null">#{isDisable},</if>
|
||||
<if test="delFlag != null">#{del_flag},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="userName != null">#{userName},</if>
|
||||
<if test="userId != null">#{userId},</if>
|
||||
<if test="level != null">#{level},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateSysCompany" parameterType="com.mhd.system.domain.SysCompany">
|
||||
update sys_company
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="parentCompanyId != null">parent_company_id = #{parentCompanyId},</if>
|
||||
<if test="companyName != null">company_name = #{companyName},</if>
|
||||
<if test="companyAddress != null">company_address = #{companyAddress},</if>
|
||||
<if test="phone != null">phone = #{phone},</if>
|
||||
<if test="isDisable != null">is_disable = #{isDisable},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="userName != null">user_name = #{userName},</if>
|
||||
<if test="userId != null">user_id = #{userId},</if>
|
||||
<if test="level != null">level = #{level},</if>
|
||||
</trim>
|
||||
where company_id = #{companyId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteSysCompanyById" parameterType="java.lang.Long">
|
||||
update sys_company set del_flag=1 where company_id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSysCompanyByIds" parameterType="java.lang.String">
|
||||
update sys_company set del_flag=1 where company_id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="selectCompanyList" parameterType="com.mhd.system.domain.SysCompany" resultMap="SysCompanyResult">
|
||||
<include refid="selectSysCompanyVo"/>
|
||||
where del_flag = '0'
|
||||
<if test="companyId != null and companyId != 0">
|
||||
AND company_id = #{companyId}
|
||||
</if>
|
||||
<if test="parentCompanyId != null and parentCompanyId != 0">
|
||||
AND parent_company_id = #{parentCompanyId}
|
||||
</if>
|
||||
<if test="companyName != null and companyName != ''">
|
||||
AND company_name like concat('%', #{companyName}, '%')
|
||||
</if>
|
||||
<if test="level != null and level==1">
|
||||
and level in(0)
|
||||
</if>
|
||||
<if test="level != null and level==2">
|
||||
and level in(0,1)
|
||||
</if>
|
||||
<!-- 数据范围过滤 -->
|
||||
${params.dataScope}
|
||||
order by parent_company_id
|
||||
</select>
|
||||
</mapper>
|
||||
+110
@@ -0,0 +1,110 @@
|
||||
<?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.mhd.system.mapper.SysComplaintfeedbackMapper">
|
||||
|
||||
<resultMap type="com.mhd.system.domain.SysComplaintfeedback" id="SysComplaintfeedbackResult">
|
||||
<result property="feedbackId" column="feedback_id" />
|
||||
<result property="creadBy" column="cread_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="title" column="title" />
|
||||
<result property="messageSource" column="message_source" />
|
||||
<result property="messageStatus" column="message_status" />
|
||||
<result property="replyContent" column="reply_content" />
|
||||
<result property="waybillId" column="waybill_id" />
|
||||
<result property="problemContent" column="problem_content" />
|
||||
<result property="problemScreenshotsAddress" column="problem_screenshots_address" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSysComplaintfeedbackVo">
|
||||
select feedback_id, cread_by, create_time, title, message_source, message_status, reply_content, waybill_id, problem_content, problem_screenshots_address from sys_complaintfeedback
|
||||
</sql>
|
||||
|
||||
<select id="selectSysComplaintfeedbackList" parameterType="com.mhd.system.domain.SysComplaintfeedback" resultMap="SysComplaintfeedbackResult">
|
||||
<include refid="selectSysComplaintfeedbackVo"/>
|
||||
where del_flag = 0
|
||||
<if test="creadBy != null and creadBy != ''"> and cread_by = #{creadBy}</if>
|
||||
<if test="messageSource != null "> and message_source = #{messageSource}</if>
|
||||
<if test="messageStatus != null "> and message_status = #{messageStatus}</if>
|
||||
<if test="waybillId != null and waybillId != ''"> and waybill_id = #{waybillId}</if>
|
||||
order by create_time DESC
|
||||
</select>
|
||||
|
||||
<select id="selectSysComplaintfeedbackByFeedbackId" parameterType="String" resultMap="SysComplaintfeedbackResult">
|
||||
<include refid="selectSysComplaintfeedbackVo"/>
|
||||
where feedback_id in
|
||||
<foreach item="feedbackId" collection="array" open="(" separator="," close=")">
|
||||
feedback_id = #{feedbackId}
|
||||
</foreach> and del_flag = 0
|
||||
</select>
|
||||
|
||||
<insert id="insertSysComplaintfeedback" parameterType="com.mhd.system.domain.SysComplaintfeedback" useGeneratedKeys="true" keyProperty="feedbackId">
|
||||
insert into sys_complaintfeedback
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="creadBy != null">cread_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="title != null">title,</if>
|
||||
<if test="messageSource != null">message_source,</if>
|
||||
<if test="messageStatus != null">message_status,</if>
|
||||
<if test="replyContent != null">reply_content,</if>
|
||||
<if test="waybillId != null">waybill_id,</if>
|
||||
<if test="problemContent != null">problem_content,</if>
|
||||
<if test="problemScreenshotsAddress != null">problem_screenshots_address,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="creadBy != null">#{creadBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="title != null">#{title},</if>
|
||||
<if test="messageSource != null">#{messageSource},</if>
|
||||
<if test="messageStatus != null">#{messageStatus},</if>
|
||||
<if test="replyContent != null">#{replyContent},</if>
|
||||
<if test="waybillId != null">#{waybillId},</if>
|
||||
<if test="problemContent != null">#{problemContent},</if>
|
||||
<if test="problemScreenshotsAddress != null">#{problemScreenshotsAddress},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateSysComplaintfeedback" parameterType="com.mhd.system.domain.SysComplaintfeedback">
|
||||
update sys_complaintfeedback
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="creadBy != null">cread_by = #{creadBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="title != null">title = #{title},</if>
|
||||
<if test="messageSource != null">message_source = #{messageSource},</if>
|
||||
<if test="messageStatus != null">message_status = 2,</if>
|
||||
<if test="replyContent != null">reply_content = #{replyContent},</if>
|
||||
<if test="waybillId != null">waybill_id = #{waybillId},</if>
|
||||
<if test="problemContent != null">problem_content = #{problemContent},</if>
|
||||
<if test="problemScreenshotsAddress != null">problem_screenshots_address = #{problemScreenshotsAddress},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
</trim>
|
||||
where feedback_id = #{feedbackId}
|
||||
</update>
|
||||
|
||||
<update id="deleteSysComplaintfeedbackByFeedbackId" parameterType="Long">
|
||||
update sys_complaintfeedback set del_flag = 1
|
||||
</update>
|
||||
|
||||
<update id="deleteSysComplaintfeedbackByFeedbackIds" parameterType="String">
|
||||
update sys_complaintfeedback set del_flag = 1
|
||||
where feedback_id in
|
||||
<foreach item="feedbackId" collection="array" open="(" separator="," close=")">
|
||||
#{feedbackId}
|
||||
</foreach>
|
||||
</update>
|
||||
<update id="updateStatus" parameterType="String">
|
||||
update sys_complaintfeedback set message_status = 1
|
||||
Where feedback_id in
|
||||
<foreach item="feedbackId" collection="array" open="(" separator="," close=")">
|
||||
#{feedbackId}
|
||||
</foreach> and message_status != 2
|
||||
</update>
|
||||
<select id="unReadSum" parameterType="Long">
|
||||
select feedback_id from sys_complaintfeedback where message_status = 0
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,112 @@
|
||||
<?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.mhd.system.mapper.SysConfigMapper">
|
||||
|
||||
<resultMap type="SysConfig" id="SysConfigResult">
|
||||
<id property="configId" column="config_id" />
|
||||
<result property="configName" column="config_name" />
|
||||
<result property="configKey" column="config_key" />
|
||||
<result property="configValue" column="config_value" />
|
||||
<result property="configType" column="config_type" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectConfigVo">
|
||||
select config_id, config_name, config_key, config_value, config_type, create_by, create_time, update_by, update_time, remark
|
||||
from sys_config
|
||||
</sql>
|
||||
|
||||
<!-- 查询条件 -->
|
||||
<sql id="sqlwhereSearch">
|
||||
<where>
|
||||
<if test="configId !=null">
|
||||
and config_id = #{configId}
|
||||
</if>
|
||||
<if test="configKey !=null and configKey != ''">
|
||||
and config_key = #{configKey}
|
||||
</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<select id="selectConfig" parameterType="SysConfig" resultMap="SysConfigResult">
|
||||
<include refid="selectConfigVo"/>
|
||||
<include refid="sqlwhereSearch"/>
|
||||
</select>
|
||||
|
||||
<select id="selectConfigList" parameterType="SysConfig" resultMap="SysConfigResult">
|
||||
<include refid="selectConfigVo"/>
|
||||
<where>
|
||||
<if test="configName != null and configName != ''">
|
||||
AND config_name like concat('%', #{configName}, '%')
|
||||
</if>
|
||||
<if test="configType != null and configType != ''">
|
||||
AND config_type = #{configType}
|
||||
</if>
|
||||
<if test="configKey != null and configKey != ''">
|
||||
AND config_key like concat('%', #{configKey}, '%')
|
||||
</if>
|
||||
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
|
||||
and date_format(create_time,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d')
|
||||
</if>
|
||||
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
|
||||
and date_format(create_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d')
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="checkConfigKeyUnique" parameterType="String" resultMap="SysConfigResult">
|
||||
<include refid="selectConfigVo"/>
|
||||
where config_key = #{configKey} limit 1
|
||||
</select>
|
||||
|
||||
<insert id="insertConfig" parameterType="SysConfig">
|
||||
insert into sys_config (
|
||||
<if test="configName != null and configName != '' ">config_name,</if>
|
||||
<if test="configKey != null and configKey != '' ">config_key,</if>
|
||||
<if test="configValue != null and configValue != '' ">config_value,</if>
|
||||
<if test="configType != null and configType != '' ">config_type,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
<if test="remark != null and remark != ''">remark,</if>
|
||||
create_time
|
||||
)values(
|
||||
<if test="configName != null and configName != ''">#{configName},</if>
|
||||
<if test="configKey != null and configKey != ''">#{configKey},</if>
|
||||
<if test="configValue != null and configValue != ''">#{configValue},</if>
|
||||
<if test="configType != null and configType != ''">#{configType},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
<if test="remark != null and remark != ''">#{remark},</if>
|
||||
sysdate()
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="updateConfig" parameterType="SysConfig">
|
||||
update sys_config
|
||||
<set>
|
||||
<if test="configName != null and configName != ''">config_name = #{configName},</if>
|
||||
<if test="configKey != null and configKey != ''">config_key = #{configKey},</if>
|
||||
<if test="configValue != null and configValue != ''">config_value = #{configValue},</if>
|
||||
<if test="configType != null and configType != ''">config_type = #{configType},</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
update_time = sysdate()
|
||||
</set>
|
||||
where config_id = #{configId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteConfigById" parameterType="Long">
|
||||
delete from sys_config where config_id = #{configId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteConfigByIds" parameterType="Long">
|
||||
delete from sys_config where config_id in
|
||||
<foreach item="configId" collection="array" open="(" separator="," close=")">
|
||||
#{configId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
+97
@@ -0,0 +1,97 @@
|
||||
<?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.mhd.system.mapper.SysDepartInterfaceInfoMapper">
|
||||
|
||||
<resultMap type="SysDepartInterfaceInfo" id="SysDepartInterfaceInfoResult">
|
||||
<result property="departInfoId" column="depart_info_id" />
|
||||
<result property="interfaceType" column="interface_type" />
|
||||
<result property="interfaceTypeKey" column="interface_type_key" />
|
||||
<result property="interfaceTypeValue" column="interface_type_value" />
|
||||
<result property="interfaceTypeName" column="interface_type_name" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="updateCount" column="update_count" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSysDepartInterfaceInfoVo">
|
||||
select depart_info_id, interface_type, interface_type_key, interface_type_value, interface_type_name, create_time, create_by, update_time, update_by, del_flag, update_count from sys_depart_interface_info
|
||||
</sql>
|
||||
|
||||
<select id="selectSysDepartInterfaceInfoList" parameterType="SysDepartInterfaceInfo" resultMap="SysDepartInterfaceInfoResult">
|
||||
<include refid="selectSysDepartInterfaceInfoVo"/>
|
||||
where del_flag = 0
|
||||
<where>
|
||||
<if test="interfaceType != null and interfaceType != ''"> and interface_type = #{interfaceType}</if>
|
||||
<if test="interfaceTypeKey != null and interfaceTypeKey != ''"> and interface_type_key = #{interfaceTypeKey}</if>
|
||||
<if test="interfaceTypeValue != null and interfaceTypeValue != ''"> and interface_type_value = #{interfaceTypeValue}</if>
|
||||
<if test="interfaceTypeName != null and interfaceTypeName != ''"> and interface_type_name like concat('%', #{interfaceTypeName}, '%')</if>
|
||||
<if test="updateCount != null "> and update_count = #{updateCount}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectSysDepartInterfaceInfoByDepartInfoId" parameterType="Long" resultMap="SysDepartInterfaceInfoResult">
|
||||
<include refid="selectSysDepartInterfaceInfoVo"/>
|
||||
where depart_info_id = #{departInfoId}
|
||||
</select>
|
||||
|
||||
<insert id="insertSysDepartInterfaceInfo" parameterType="SysDepartInterfaceInfo" useGeneratedKeys="true" keyProperty="departInfoId">
|
||||
insert into sys_depart_interface_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="interfaceType != null">interface_type,</if>
|
||||
<if test="interfaceTypeKey != null">interface_type_key,</if>
|
||||
<if test="interfaceTypeValue != null">interface_type_value,</if>
|
||||
<if test="interfaceTypeName != null">interface_type_name,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
<if test="updateCount != null">update_count,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="interfaceType != null">#{interfaceType},</if>
|
||||
<if test="interfaceTypeKey != null">#{interfaceTypeKey},</if>
|
||||
<if test="interfaceTypeValue != null">#{interfaceTypeValue},</if>
|
||||
<if test="interfaceTypeName != null">#{interfaceTypeName},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
<if test="updateCount != null">#{updateCount},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateSysDepartInterfaceInfo" parameterType="SysDepartInterfaceInfo">
|
||||
update sys_depart_interface_info
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="interfaceType != null">interface_type = #{interfaceType},</if>
|
||||
<if test="interfaceTypeKey != null">interface_type_key = #{interfaceTypeKey},</if>
|
||||
<if test="interfaceTypeValue != null">interface_type_value = #{interfaceTypeValue},</if>
|
||||
<if test="interfaceTypeName != null">interface_type_name = #{interfaceTypeName},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="updateCount != null">update_count = #{updateCount},</if>
|
||||
</trim>
|
||||
where depart_info_id = #{departInfoId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteSysDepartInterfaceInfoByDepartInfoId" parameterType="Long">
|
||||
update sys_depart_interface_info set del_flag=1 where depart_info_id = #{departInfoId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSysDepartInterfaceInfoByDepartInfoIds" parameterType="String">
|
||||
update sys_depart_interface_info set del_flag=1 where id in
|
||||
<foreach item="departInfoId" collection="array" open="(" separator="," close=")">
|
||||
#{departInfoId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -0,0 +1,157 @@
|
||||
<?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.mhd.system.mapper.SysDeptMapper">
|
||||
|
||||
<resultMap type="SysDept" id="SysDeptResult">
|
||||
<id property="deptId" column="dept_id" />
|
||||
<result property="parentId" column="parent_id" />
|
||||
<result property="ancestors" column="ancestors" />
|
||||
<result property="deptName" column="dept_name" />
|
||||
<result property="orderNum" column="order_num" />
|
||||
<result property="leader" column="leader" />
|
||||
<result property="phone" column="phone" />
|
||||
<result property="email" column="email" />
|
||||
<result property="status" column="status" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="parentName" column="parent_name" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectDeptVo">
|
||||
select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status, d.del_flag, d.create_by, d.create_time
|
||||
from sys_dept d
|
||||
</sql>
|
||||
|
||||
<select id="selectDeptList" parameterType="SysDept" resultMap="SysDeptResult">
|
||||
<include refid="selectDeptVo"/>
|
||||
where d.del_flag = '0'
|
||||
<if test="deptId != null and deptId != 0">
|
||||
AND dept_id = #{deptId}
|
||||
</if>
|
||||
<if test="parentId != null and parentId != 0">
|
||||
AND parent_id = #{parentId}
|
||||
</if>
|
||||
<if test="deptName != null and deptName != ''">
|
||||
AND dept_name like concat('%', #{deptName}, '%')
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
AND status = #{status}
|
||||
</if>
|
||||
<!-- 数据范围过滤 -->
|
||||
${params.dataScope}
|
||||
order by d.parent_id, d.order_num
|
||||
</select>
|
||||
|
||||
<select id="selectDeptListByRoleId" resultType="Long">
|
||||
select d.dept_id
|
||||
from sys_dept d
|
||||
left join sys_role_dept rd on d.dept_id = rd.dept_id
|
||||
where rd.role_id = #{roleId}
|
||||
<if test="deptCheckStrictly">
|
||||
and d.dept_id not in (select d.parent_id from sys_dept d inner join sys_role_dept rd on d.dept_id = rd.dept_id and rd.role_id = #{roleId})
|
||||
</if>
|
||||
order by d.parent_id, d.order_num
|
||||
</select>
|
||||
|
||||
<select id="selectDeptById" parameterType="Long" resultMap="SysDeptResult">
|
||||
<include refid="selectDeptVo"/>
|
||||
where dept_id = #{deptId}
|
||||
</select>
|
||||
|
||||
<select id="checkDeptExistUser" parameterType="Long" resultType="int">
|
||||
select count(1) from sys_user where dept_id = #{deptId} and del_flag = '0'
|
||||
</select>
|
||||
|
||||
<select id="hasChildByDeptId" parameterType="Long" resultType="int">
|
||||
select count(1) from sys_dept
|
||||
where del_flag = '0' and parent_id = #{deptId} limit 1
|
||||
</select>
|
||||
|
||||
<select id="selectChildrenDeptById" parameterType="Long" resultMap="SysDeptResult">
|
||||
select * from sys_dept where find_in_set(#{deptId}, ancestors)
|
||||
</select>
|
||||
|
||||
<select id="selectNormalChildrenDeptById" parameterType="Long" resultType="int">
|
||||
select count(*) from sys_dept where status = 0 and del_flag = '0' and find_in_set(#{deptId}, ancestors)
|
||||
</select>
|
||||
|
||||
<select id="checkDeptNameUnique" resultMap="SysDeptResult">
|
||||
<include refid="selectDeptVo"/>
|
||||
where dept_name=#{deptName} and parent_id = #{parentId} limit 1
|
||||
</select>
|
||||
|
||||
<insert id="insertDept" parameterType="SysDept">
|
||||
insert into sys_dept(
|
||||
<if test="deptId != null and deptId != 0">dept_id,</if>
|
||||
<if test="parentId != null and parentId != 0">parent_id,</if>
|
||||
<if test="deptName != null and deptName != ''">dept_name,</if>
|
||||
<if test="ancestors != null and ancestors != ''">ancestors,</if>
|
||||
<if test="orderNum != null">order_num,</if>
|
||||
<if test="leader != null and leader != ''">leader,</if>
|
||||
<if test="phone != null and phone != ''">phone,</if>
|
||||
<if test="email != null and email != ''">email,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
create_time
|
||||
)values(
|
||||
<if test="deptId != null and deptId != 0">#{deptId},</if>
|
||||
<if test="parentId != null and parentId != 0">#{parentId},</if>
|
||||
<if test="deptName != null and deptName != ''">#{deptName},</if>
|
||||
<if test="ancestors != null and ancestors != ''">#{ancestors},</if>
|
||||
<if test="orderNum != null">#{orderNum},</if>
|
||||
<if test="leader != null and leader != ''">#{leader},</if>
|
||||
<if test="phone != null and phone != ''">#{phone},</if>
|
||||
<if test="email != null and email != ''">#{email},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
sysdate()
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="updateDept" parameterType="SysDept">
|
||||
update sys_dept
|
||||
<set>
|
||||
<if test="parentId != null and parentId != 0">parent_id = #{parentId},</if>
|
||||
<if test="deptName != null and deptName != ''">dept_name = #{deptName},</if>
|
||||
<if test="ancestors != null and ancestors != ''">ancestors = #{ancestors},</if>
|
||||
<if test="orderNum != null">order_num = #{orderNum},</if>
|
||||
<if test="leader != null">leader = #{leader},</if>
|
||||
<if test="phone != null">phone = #{phone},</if>
|
||||
<if test="email != null">email = #{email},</if>
|
||||
<if test="status != null and status != ''">status = #{status},</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
update_time = sysdate()
|
||||
</set>
|
||||
where dept_id = #{deptId}
|
||||
</update>
|
||||
|
||||
<update id="updateDeptChildren" parameterType="java.util.List">
|
||||
update sys_dept set ancestors =
|
||||
<foreach collection="depts" item="item" index="index"
|
||||
separator=" " open="case dept_id" close="end">
|
||||
when #{item.deptId} then #{item.ancestors}
|
||||
</foreach>
|
||||
where dept_id in
|
||||
<foreach collection="depts" item="item" index="index"
|
||||
separator="," open="(" close=")">
|
||||
#{item.deptId}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<update id="updateDeptStatusNormal" parameterType="Long">
|
||||
update sys_dept set status = '0' where dept_id in
|
||||
<foreach collection="array" item="deptId" open="(" separator="," close=")">
|
||||
#{deptId}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<delete id="deleteDeptById" parameterType="Long">
|
||||
update sys_dept set del_flag = '2' where dept_id = #{deptId}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,149 @@
|
||||
<?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.mhd.system.mapper.SysDictDataMapper">
|
||||
|
||||
<resultMap type="SysDictData" id="SysDictDataResult">
|
||||
<id property="dictCode" column="dict_code" />
|
||||
<result property="dictSort" column="dict_sort" />
|
||||
<result property="dictLabel" column="dict_label" />
|
||||
<result property="dictValue" column="dict_value" />
|
||||
<result property="dictType" column="dict_type" />
|
||||
<result property="cssClass" column="css_class" />
|
||||
<result property="listClass" column="list_class" />
|
||||
<result property="isDefault" column="is_default" />
|
||||
<result property="status" column="status" />
|
||||
<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="organizationId" column="organization_id" />
|
||||
<result property="organizationName" column="organization_name" />
|
||||
<result property="topOrganizationId" column="top_organization_id" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectDictDataVo">
|
||||
select dict_code, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, remark,organization_id,organization_name,top_organization_id
|
||||
from sys_dict_data
|
||||
</sql>
|
||||
|
||||
<select id="selectDictDataList" parameterType="SysDictData" resultMap="SysDictDataResult">
|
||||
<include refid="selectDictDataVo"/>
|
||||
<where>
|
||||
<if test="dictType != null and dictType != ''">
|
||||
AND dict_type = #{dictType}
|
||||
</if>
|
||||
<if test="dictValue != null and dictValue != ''">
|
||||
AND dict_value = #{dictValue}
|
||||
</if>
|
||||
<if test="dictLabel != null and dictLabel != ''">
|
||||
AND dict_label like concat('%', #{dictLabel}, '%')
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
AND status = #{status}
|
||||
</if>
|
||||
<if test="topOrganizationId != null">
|
||||
AND (top_organization_id = #{topOrganizationId} OR is_default = 'Y')
|
||||
</if>
|
||||
</where>
|
||||
order by dict_sort asc
|
||||
</select>
|
||||
|
||||
<select id="selectDictDataByType" parameterType="SysDictData" resultMap="SysDictDataResult">
|
||||
<include refid="selectDictDataVo"/>
|
||||
<where>
|
||||
status = '0'
|
||||
and dict_type = #{dictType}
|
||||
<if test="topOrganizationId != null">
|
||||
and (top_organization_id = #{topOrganizationId} OR is_default = 'Y')
|
||||
</if>
|
||||
</where>
|
||||
order by dict_sort asc
|
||||
</select>
|
||||
|
||||
<select id="selectDictLabel" resultType="String">
|
||||
select dict_label from sys_dict_data
|
||||
where dict_type = #{dictType} and dict_value = #{dictValue}
|
||||
</select>
|
||||
|
||||
<select id="selectDictDataById" parameterType="Long" resultMap="SysDictDataResult">
|
||||
<include refid="selectDictDataVo"/>
|
||||
where dict_code = #{dictCode}
|
||||
</select>
|
||||
|
||||
<select id="countDictDataByType" resultType="Integer">
|
||||
select count(1) from sys_dict_data where dict_type=#{dictType}
|
||||
</select>
|
||||
|
||||
<delete id="deleteDictDataById" parameterType="Long">
|
||||
delete from sys_dict_data where dict_code = #{dictCode}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteDictDataByIds" parameterType="Long">
|
||||
delete from sys_dict_data where dict_code in
|
||||
<foreach collection="array" item="dictCode" open="(" separator="," close=")">
|
||||
#{dictCode}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<update id="updateDictData" parameterType="SysDictData">
|
||||
update sys_dict_data
|
||||
<set>
|
||||
<if test="dictSort != null">dict_sort = #{dictSort},</if>
|
||||
<if test="dictLabel != null and dictLabel != ''">dict_label = #{dictLabel},</if>
|
||||
<if test="dictValue != null and dictValue != ''">dict_value = #{dictValue},</if>
|
||||
<if test="dictType != null and dictType != ''">dict_type = #{dictType},</if>
|
||||
<if test="cssClass != null">css_class = #{cssClass},</if>
|
||||
<if test="listClass != null">list_class = #{listClass},</if>
|
||||
<if test="isDefault != null and isDefault != ''">is_default = #{isDefault},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
<if test="organizationId != null and organizationId != ''">organization_id = #{organizationId},</if>
|
||||
<if test="organizationName != null and organizationName != ''">organization_name = #{organizationName},</if>
|
||||
<if test="topOrganizationId != null and topOrganizationId != ''">top_organization_id = #{topOrganizationId},</if>
|
||||
update_time = sysdate()
|
||||
</set>
|
||||
where dict_code = #{dictCode}
|
||||
</update>
|
||||
|
||||
<update id="updateDictDataType" parameterType="String">
|
||||
update sys_dict_data set dict_type = #{newDictType} where dict_type = #{oldDictType}
|
||||
</update>
|
||||
|
||||
<insert id="insertDictData" parameterType="SysDictData">
|
||||
insert into sys_dict_data(
|
||||
<if test="dictSort != null">dict_sort,</if>
|
||||
<if test="dictLabel != null and dictLabel != ''">dict_label,</if>
|
||||
<if test="dictValue != null and dictValue != ''">dict_value,</if>
|
||||
<if test="dictType != null and dictType != ''">dict_type,</if>
|
||||
<if test="cssClass != null and cssClass != ''">css_class,</if>
|
||||
<if test="listClass != null and listClass != ''">list_class,</if>
|
||||
<if test="isDefault != null and isDefault != ''">is_default,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="remark != null and remark != ''">remark,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
<if test="organizationId != null and organizationId != ''">organization_id,</if>
|
||||
<if test="organizationName != null and organizationName != ''">organization_name,</if>
|
||||
<if test="topOrganizationId != null and topOrganizationId != ''">top_organization_id,</if>
|
||||
create_time
|
||||
)values(
|
||||
<if test="dictSort != null">#{dictSort},</if>
|
||||
<if test="dictLabel != null and dictLabel != ''">#{dictLabel},</if>
|
||||
<if test="dictValue != null and dictValue != ''">#{dictValue},</if>
|
||||
<if test="dictType != null and dictType != ''">#{dictType},</if>
|
||||
<if test="cssClass != null and cssClass != ''">#{cssClass},</if>
|
||||
<if test="listClass != null and listClass != ''">#{listClass},</if>
|
||||
<if test="isDefault != null and isDefault != ''">#{isDefault},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="remark != null and remark != ''">#{remark},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
<if test="organizationId != null and organizationId != ''">#{organizationId},</if>
|
||||
<if test="organizationName != null and organizationName != ''">#{organizationName},</if>
|
||||
<if test="topOrganizationId != null and topOrganizationId != ''">#{topOrganizationId},</if>
|
||||
sysdate()
|
||||
)
|
||||
</insert>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,105 @@
|
||||
<?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.mhd.system.mapper.SysDictTypeMapper">
|
||||
|
||||
<resultMap type="SysDictType" id="SysDictTypeResult">
|
||||
<id property="dictId" column="dict_id" />
|
||||
<result property="dictName" column="dict_name" />
|
||||
<result property="dictType" column="dict_type" />
|
||||
<result property="status" column="status" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectDictTypeVo">
|
||||
select dict_id, dict_name, dict_type, status, create_by, create_time, remark
|
||||
from sys_dict_type
|
||||
</sql>
|
||||
|
||||
<select id="selectDictTypeList" parameterType="SysDictType" resultMap="SysDictTypeResult">
|
||||
<include refid="selectDictTypeVo"/>
|
||||
<where>
|
||||
<if test="dictName != null and dictName != ''">
|
||||
AND dict_name like concat('%', #{dictName}, '%')
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
AND status = #{status}
|
||||
</if>
|
||||
<if test="dictType != null and dictType != ''">
|
||||
AND dict_type like concat('%', #{dictType}, '%')
|
||||
</if>
|
||||
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
|
||||
and date_format(create_time,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d')
|
||||
</if>
|
||||
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
|
||||
and date_format(create_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d')
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectDictTypeAll" resultMap="SysDictTypeResult">
|
||||
<include refid="selectDictTypeVo"/>
|
||||
</select>
|
||||
|
||||
<select id="selectDictTypeById" parameterType="Long" resultMap="SysDictTypeResult">
|
||||
<include refid="selectDictTypeVo"/>
|
||||
where dict_id = #{dictId}
|
||||
</select>
|
||||
|
||||
<select id="selectDictTypeByType" parameterType="String" resultMap="SysDictTypeResult">
|
||||
<include refid="selectDictTypeVo"/>
|
||||
where dict_type = #{dictType}
|
||||
</select>
|
||||
|
||||
<select id="checkDictTypeUnique" parameterType="String" resultMap="SysDictTypeResult">
|
||||
<include refid="selectDictTypeVo"/>
|
||||
where dict_type = #{dictType} limit 1
|
||||
</select>
|
||||
|
||||
<delete id="deleteDictTypeById" parameterType="Long">
|
||||
delete from sys_dict_type where dict_id = #{dictId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteDictTypeByIds" parameterType="Long">
|
||||
delete from sys_dict_type where dict_id in
|
||||
<foreach collection="array" item="dictId" open="(" separator="," close=")">
|
||||
#{dictId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<update id="updateDictType" parameterType="SysDictType">
|
||||
update sys_dict_type
|
||||
<set>
|
||||
<if test="dictName != null and dictName != ''">dict_name = #{dictName},</if>
|
||||
<if test="dictType != null and dictType != ''">dict_type = #{dictType},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
update_time = sysdate()
|
||||
</set>
|
||||
where dict_id = #{dictId}
|
||||
</update>
|
||||
|
||||
<insert id="insertDictType" parameterType="SysDictType">
|
||||
insert into sys_dict_type(
|
||||
<if test="dictName != null and dictName != ''">dict_name,</if>
|
||||
<if test="dictType != null and dictType != ''">dict_type,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="remark != null and remark != ''">remark,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
create_time
|
||||
)values(
|
||||
<if test="dictName != null and dictName != ''">#{dictName},</if>
|
||||
<if test="dictType != null and dictType != ''">#{dictType},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="remark != null and remark != ''">#{remark},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
sysdate()
|
||||
)
|
||||
</insert>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,105 @@
|
||||
<?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.mhd.system.mapper.SysEquipmentGpsMapper">
|
||||
|
||||
<resultMap type="SysEquipmentGps" id="SysEquipmentGpsResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="equipmentName" column="equipment_name" />
|
||||
<result property="productModel" column="product_model" />
|
||||
<result property="productTips" column="product_tips" />
|
||||
<result property="productType" column="product_type" />
|
||||
<result property="statusFlag" column="status_flag" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="createDatetime" column="create_datetime" />
|
||||
<result property="updateDatetime" column="update_datetime" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSysEquipmentGpsVo">
|
||||
select id, equipment_name, product_model, product_tips, product_type, status_flag, del_flag, create_datetime, update_datetime from sys_equipment_gps
|
||||
</sql>
|
||||
|
||||
<select id="selectSysEquipmentGpsList" parameterType="SysEquipmentGps" resultMap="SysEquipmentGpsResult">
|
||||
<include refid="selectSysEquipmentGpsVo"/>
|
||||
<where>
|
||||
<if test="equipmentName != null and equipmentName != ''"> and equipment_name like concat('%', #{equipmentName}, '%')</if>
|
||||
<if test="productModel != null and productModel != ''"> and product_model = #{productModel}</if>
|
||||
<if test="productTips != null and productTips != ''"> and product_tips = #{productTips}</if>
|
||||
<if test="productType != null and productType != ''"> and product_type = #{productType}</if>
|
||||
<if test="statusFlag != null "> and status_flag = #{statusFlag}</if>
|
||||
<if test="createDatetime != null "> and create_datetime = #{createDatetime}</if>
|
||||
<if test="updateDatetime != null "> and update_datetime = #{updateDatetime}</if>
|
||||
and del_flag = 0
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectSysEquipmentGpsById" parameterType="Long" resultMap="SysEquipmentGpsResult">
|
||||
<include refid="selectSysEquipmentGpsVo"/>
|
||||
where id = #{id} and del_flag = 0
|
||||
</select>
|
||||
|
||||
<insert id="insertSysEquipmentGps" parameterType="SysEquipmentGps">
|
||||
insert into sys_equipment_gps
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="equipmentName != null">equipment_name,</if>
|
||||
<if test="productModel != null">product_model,</if>
|
||||
<if test="productTips != null">product_tips,</if>
|
||||
<if test="productType != null">product_type,</if>
|
||||
<if test="statusFlag != null">status_flag,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
<if test="createDatetime != null">create_datetime,</if>
|
||||
<if test="updateDatetime != null">update_datetime,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="equipmentName != null">#{equipmentName},</if>
|
||||
<if test="productModel != null">#{productModel},</if>
|
||||
<if test="productTips != null">#{productTips},</if>
|
||||
<if test="productType != null">#{productType},</if>
|
||||
<if test="statusFlag != null">#{statusFlag},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
<if test="createDatetime != null">#{createDatetime},</if>
|
||||
<if test="updateDatetime != null">#{updateDatetime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateSysEquipmentGps" parameterType="SysEquipmentGps">
|
||||
update sys_equipment_gps
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="equipmentName != null">equipment_name = #{equipmentName},</if>
|
||||
<if test="productModel != null">product_model = #{productModel},</if>
|
||||
<if test="productTips != null">product_tips = #{productTips},</if>
|
||||
<if test="productType != null">product_type = #{productType},</if>
|
||||
<if test="statusFlag != null">status_flag = #{statusFlag},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="createDatetime != null">create_datetime = #{createDatetime},</if>
|
||||
<if test="updateDatetime != null">update_datetime = #{updateDatetime},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="deleteSysEquipmentGpsById" parameterType="Long">
|
||||
update sys_equipment_gps set del_flag = 1 where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="deleteSysEquipmentGpsByIds" parameterType="String">
|
||||
update sys_equipment_gps set del_flag where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<!--
|
||||
<delete id="deleteSysEquipmentGpsById" parameterType="Long">
|
||||
delete from sys_equipment_gps where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSysEquipmentGpsByIds" parameterType="String">
|
||||
delete from sys_equipment_gps where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>-->
|
||||
</mapper>
|
||||
+103
@@ -0,0 +1,103 @@
|
||||
<?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.mhd.system.mapper.SysEquipmentPrinterMapper">
|
||||
|
||||
<resultMap type="SysEquipmentPrinter" id="SysEquipmentPrinterResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="printerName" column="printer_name" />
|
||||
<result property="printerType" column="printer_type" />
|
||||
<result property="printerPid" column="printer_pid" />
|
||||
<result property="company" column="company" />
|
||||
<result property="statusFlag" column="status_flag" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="createDate" column="create_date" />
|
||||
<result property="updateDate" column="update_date" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSysEquipmentPrinterVo">
|
||||
select id, printer_name, printer_type, printer_pid, company, status_flag, del_flag, create_date, update_date from sys_equipment_printer
|
||||
</sql>
|
||||
|
||||
<select id="selectSysEquipmentPrinterList" parameterType="SysEquipmentPrinter" resultMap="SysEquipmentPrinterResult">
|
||||
<include refid="selectSysEquipmentPrinterVo"/>
|
||||
<where>
|
||||
<if test="printerName != null and printerName != ''"> and printer_name like concat('%', #{printerName}, '%')</if>
|
||||
<if test="printerType != null and printerType != ''"> and printer_type = #{printerType}</if>
|
||||
<if test="printerPid != null and printerPid != ''"> and printer_pid = #{printerPid}</if>
|
||||
<if test="company != null and company != ''"> and company = #{company}</if>
|
||||
<if test="statusFlag != null "> and status_flag = #{statusFlag}</if>
|
||||
<if test="createDate != null "> and create_date = #{createDate}</if>
|
||||
<if test="updateDate != null "> and update_date = #{updateDate}</if>
|
||||
and del_flag = 0
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectSysEquipmentPrinterById" parameterType="Long" resultMap="SysEquipmentPrinterResult">
|
||||
<include refid="selectSysEquipmentPrinterVo"/>
|
||||
where id = #{id} and del_flag = 0
|
||||
</select>
|
||||
|
||||
<insert id="insertSysEquipmentPrinter" parameterType="SysEquipmentPrinter" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into sys_equipment_printer
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="printerName != null">printer_name,</if>
|
||||
<if test="printerType != null">printer_type,</if>
|
||||
<if test="printerPid != null">printer_pid,</if>
|
||||
<if test="company != null">company,</if>
|
||||
<if test="statusFlag != null">status_flag,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
<if test="createDate != null">create_date,</if>
|
||||
<if test="updateDate != null">update_date,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="printerName != null">#{printerName},</if>
|
||||
<if test="printerType != null">#{printerType},</if>
|
||||
<if test="printerPid != null">#{printerPid},</if>
|
||||
<if test="company != null">#{company},</if>
|
||||
<if test="statusFlag != null">#{statusFlag},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
<if test="createDate != null">#{createDate},</if>
|
||||
<if test="updateDate != null">#{updateDate},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateSysEquipmentPrinter" parameterType="SysEquipmentPrinter">
|
||||
update sys_equipment_printer
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="printerName != null">printer_name = #{printerName},</if>
|
||||
<if test="printerType != null">printer_type = #{printerType},</if>
|
||||
<if test="printerPid != null">printer_pid = #{printerPid},</if>
|
||||
<if test="company != null">company = #{company},</if>
|
||||
<if test="statusFlag != null">status_flag = #{statusFlag},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="createDate != null">create_date = #{createDate},</if>
|
||||
<if test="updateDate != null">update_date = #{updateDate},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
|
||||
<update id="deleteSysEquipmentPrinterById" parameterType="Long">
|
||||
update sys_equipment_printer set del_flag = 1 where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="deleteSysEquipmentPrinterByIds" parameterType="String">
|
||||
update sys_equipment_printer set del_flag where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</update>
|
||||
<!--
|
||||
<delete id="deleteSysEquipmentPrinterById" parameterType="Long">
|
||||
delete from sys_equipment_printer where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSysEquipmentPrinterByIds" parameterType="String">
|
||||
delete from sys_equipment_printer where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>-->
|
||||
</mapper>
|
||||
+96
@@ -0,0 +1,96 @@
|
||||
<?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.mhd.system.mapper.SysEquipmentTemplateMapper">
|
||||
|
||||
<resultMap type="SysEquipmentTemplate" id="SysEquipmentTemplateResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="templateName" column="template_name" />
|
||||
<result property="templateCont" column="template_cont" />
|
||||
<result property="remarks" column="remarks" />
|
||||
<result property="des" column="des" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="statusFlag" column="status_flag" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSysEquipmentTemplateVo">
|
||||
select id, template_name, template_cont, remarks, des, create_time, update_time, status_flag, del_flag from sys_equipment_template
|
||||
</sql>
|
||||
|
||||
<select id="selectSysEquipmentTemplateList" parameterType="SysEquipmentTemplate" resultMap="SysEquipmentTemplateResult">
|
||||
<include refid="selectSysEquipmentTemplateVo"/>
|
||||
<where>
|
||||
<if test="templateName != null and templateName != ''"> and template_name like concat('%', #{templateName}, '%')</if>
|
||||
and del_flag = 0 and del_flag = 0
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectSysEquipmentTemplateById" parameterType="Long" resultMap="SysEquipmentTemplateResult">
|
||||
<include refid="selectSysEquipmentTemplateVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertSysEquipmentTemplate" parameterType="SysEquipmentTemplate" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into sys_equipment_template
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="templateName != null">template_name,</if>
|
||||
<if test="templateCont != null">template_cont,</if>
|
||||
<if test="remarks != null">remarks,</if>
|
||||
<if test="des != null">des,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="statusFlag != null">status_flag,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="templateName != null">#{templateName},</if>
|
||||
<if test="templateCont != null">#{templateCont},</if>
|
||||
<if test="remarks != null">#{remarks},</if>
|
||||
<if test="des != null">#{des},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="statusFlag != null">#{statusFlag},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateSysEquipmentTemplate" parameterType="SysEquipmentTemplate">
|
||||
update sys_equipment_template
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="templateName != null">template_name = #{templateName},</if>
|
||||
<if test="templateCont != null">template_cont = #{templateCont},</if>
|
||||
<if test="remarks != null">remarks = #{remarks},</if>
|
||||
<if test="des != null">des = #{des},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="statusFlag != null">status_flag = #{statusFlag},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="deleteSysEquipmentTemplateById" parameterType="Long">
|
||||
update sys_equipment_template set del_flag = 1 where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="deleteSysEquipmentTemplateByIds" parameterType="String">
|
||||
update sys_equipment_template set del_flag where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</update>
|
||||
<!--
|
||||
<delete id="deleteSysEquipmentTemplateById" parameterType="Long">
|
||||
delete from sys_equipment_template where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSysEquipmentTemplateByIds" parameterType="String">
|
||||
delete from sys_equipment_template where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>-->
|
||||
</mapper>
|
||||
@@ -0,0 +1,37 @@
|
||||
<?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.mhd.system.mapper.SysLogininforMapper">
|
||||
|
||||
<select id="selectLogininforList" parameterType="com.mhd.system.domain.dto.SysLogininforDTO" resultType="com.mhd.system.api.domain.SysLogininforPo">
|
||||
select * from sys_logininfor
|
||||
<where>
|
||||
<if test="userAccount != null and userAccount != ''">
|
||||
AND user_account like concat('%', #{userAccount}, '%')
|
||||
</if>
|
||||
<if test="organizationName != null and organizationName != ''">
|
||||
AND organization_name like concat('%', #{organizationName}, '%')
|
||||
</if>
|
||||
<if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
|
||||
and date_format(access_time,'%y%m%d') >= date_format(#{beginTime},'%y%m%d')
|
||||
</if>
|
||||
<if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
|
||||
and date_format(access_time,'%y%m%d') <= date_format(#{endTime},'%y%m%d')
|
||||
</if>
|
||||
<if test="organizationId != null ">
|
||||
and organization_id = #{organizationId}
|
||||
</if>
|
||||
<if test="topOrganizationId != null ">
|
||||
and top_organization_id = #{topOrganizationId}
|
||||
</if>
|
||||
</where>
|
||||
order by access_time desc
|
||||
</select>
|
||||
|
||||
|
||||
<update id="cleanLogininfor">
|
||||
truncate table sys_logininfor
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,213 @@
|
||||
<?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.mhd.system.mapper.SysMenuMapper">
|
||||
|
||||
<resultMap type="SysMenu" id="SysMenuResult">
|
||||
<id property="menuId" column="menu_id" />
|
||||
<result property="menuName" column="menu_name" />
|
||||
<result property="parentName" column="parent_name" />
|
||||
<result property="parentId" column="parent_id" />
|
||||
<result property="orderNum" column="order_num" />
|
||||
<result property="path" column="path" />
|
||||
<result property="component" column="component" />
|
||||
<result property="query" column="query" />
|
||||
<result property="isFrame" column="is_frame" />
|
||||
<result property="isCache" column="is_cache" />
|
||||
<result property="menuType" column="menu_type" />
|
||||
<result property="visible" column="visible" />
|
||||
<result property="status" column="status" />
|
||||
<result property="perms" column="perms" />
|
||||
<result property="icon" column="icon" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="sysType" column="sys_type" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectMenuVo">
|
||||
select menu_id, menu_name, parent_id, order_num, path, component, `query`, is_frame, is_cache, menu_type, visible,sys_type, status, ifnull(perms,'') as perms, icon, create_time
|
||||
from sys_menu
|
||||
</sql>
|
||||
|
||||
<select id="selectMenuList" parameterType="SysMenu" resultMap="SysMenuResult">
|
||||
<include refid="selectMenuVo"/>
|
||||
<where>
|
||||
<if test="menuName != null and menuName != ''">
|
||||
AND menu_name like concat('%', #{menuName}, '%')
|
||||
</if>
|
||||
<if test="visible != null and visible != ''">
|
||||
AND visible = #{visible}
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
AND status = #{status}
|
||||
</if>
|
||||
|
||||
<if test="sysType != null and sysType != ''">
|
||||
AND sys_type = #{sysType}
|
||||
</if>
|
||||
</where>
|
||||
order by parent_id, order_num
|
||||
</select>
|
||||
|
||||
<select id="selectMenuTreeAll" resultMap="SysMenuResult">
|
||||
select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.`query`, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time
|
||||
from sys_menu m where m.menu_type in ('M', 'C') and m.status = 0
|
||||
order by m.parent_id, m.order_num
|
||||
</select>
|
||||
|
||||
<select id="selectMenuListByUserId" parameterType="SysMenu" resultMap="SysMenuResult">
|
||||
select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.`query`, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type,m.sys_type, m.icon, m.order_num, m.create_time
|
||||
from sys_menu m
|
||||
left join sys_role_menu rm on m.menu_id = rm.menu_id
|
||||
left join sys_user_role ur on rm.role_id = ur.role_id
|
||||
left join sys_role ro on ur.role_id = ro.role_id
|
||||
where ur.user_id = #{params.userId}
|
||||
<if test="menuName != null and menuName != ''">
|
||||
AND m.menu_name like concat('%', #{menuName}, '%')
|
||||
</if>
|
||||
<if test="visible != null and visible != ''">
|
||||
AND m.visible = #{visible}
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
AND m.status = #{status}
|
||||
</if>
|
||||
<!-- <if test="sysType != null and sysType != ''">-->
|
||||
<!-- AND m.sys_type = #{sysType}-->
|
||||
<!-- </if>-->
|
||||
order by m.parent_id, m.order_num
|
||||
</select>
|
||||
|
||||
<select id="selectMenuTreeByUserId" parameterType="Long" resultMap="SysMenuResult">
|
||||
select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.`query`, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time
|
||||
from sys_menu m
|
||||
left join sys_role_menu rm on m.menu_id = rm.menu_id
|
||||
left join sys_user_role ur on rm.role_id = ur.role_id
|
||||
left join sys_role ro on ur.role_id = ro.role_id
|
||||
left join sys_user u on ur.user_id = u.user_id
|
||||
where u.user_id = #{userId} and m.menu_type in ('M', 'C') and m.status = 0 AND ro.status = 0
|
||||
order by m.parent_id, m.order_num
|
||||
</select>
|
||||
|
||||
<select id="selectMenuListByRoleId" resultType="Long">
|
||||
select m.menu_id
|
||||
from sys_menu m
|
||||
left join sys_role_menu rm on m.menu_id = rm.menu_id
|
||||
where rm.role_id = #{roleId}
|
||||
<if test="menuCheckStrictly">
|
||||
and m.menu_id not in (select m.parent_id from sys_menu m inner join sys_role_menu rm on m.menu_id = rm.menu_id and rm.role_id = #{roleId})
|
||||
</if>
|
||||
order by m.parent_id, m.order_num
|
||||
</select>
|
||||
<select id="selectMenuListByProductId" resultType="Long">
|
||||
select m.menu_id
|
||||
from sys_menu m
|
||||
left join sys_product_menu pm on m.menu_id = pm.menu_id
|
||||
where pm.product_id = #{productId}
|
||||
<if test="menuCheckStrictly">
|
||||
and m.menu_id not in (select m.parent_id from sys_menu m inner join sys_product_menu pm on m.menu_id = pm.menu_id and pm.product_id = #{productId})
|
||||
</if>
|
||||
order by m.parent_id, m.order_num
|
||||
</select>
|
||||
|
||||
<select id="selectMenuPerms" resultType="String">
|
||||
select distinct m.perms
|
||||
from sys_menu m
|
||||
left join sys_role_menu rm on m.menu_id = rm.menu_id
|
||||
left join sys_user_role ur on rm.role_id = ur.role_id
|
||||
</select>
|
||||
|
||||
<select id="selectMenuPermsByUserId" parameterType="Long" resultType="String">
|
||||
select distinct m.perms
|
||||
from sys_menu m
|
||||
left join sys_role_menu rm on m.menu_id = rm.menu_id
|
||||
left join sys_user_role ur on rm.role_id = ur.role_id
|
||||
left join sys_role r on r.role_id = ur.role_id
|
||||
where m.status = '0' and r.status = '0' and ur.user_id = #{userId}
|
||||
</select>
|
||||
|
||||
<select id="selectMenuById" parameterType="Long" resultMap="SysMenuResult">
|
||||
<include refid="selectMenuVo"/>
|
||||
where menu_id = #{menuId}
|
||||
</select>
|
||||
|
||||
<select id="hasChildByMenuId" resultType="Integer">
|
||||
select count(1) from sys_menu where parent_id = #{menuId}
|
||||
</select>
|
||||
|
||||
<select id="checkMenuNameUnique" parameterType="SysMenu" resultMap="SysMenuResult">
|
||||
<include refid="selectMenuVo"/>
|
||||
where menu_name=#{menuName} and parent_id = #{parentId} limit 1
|
||||
</select>
|
||||
|
||||
<update id="updateMenu" parameterType="SysMenu">
|
||||
update sys_menu
|
||||
<set>
|
||||
<if test="menuName != null and menuName != ''">menu_name = #{menuName},</if>
|
||||
<if test="parentId != null">parent_id = #{parentId},</if>
|
||||
<if test="orderNum != null">order_num = #{orderNum},</if>
|
||||
<if test="path != null and path != ''">path = #{path},</if>
|
||||
<if test="component != null">component = #{component},</if>
|
||||
<if test="query != null">`query` = #{query},</if>
|
||||
<if test="isFrame != null and isFrame != ''">is_frame = #{isFrame},</if>
|
||||
<if test="isCache != null and isCache != ''">is_cache = #{isCache},</if>
|
||||
<if test="menuType != null and menuType != ''">menu_type = #{menuType},</if>
|
||||
<if test="visible != null">visible = #{visible},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="perms !=null">perms = #{perms},</if>
|
||||
<if test="icon !=null and icon != ''">icon = #{icon},</if>
|
||||
<if test="remark != null and remark != ''">remark = #{remark},</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
update_time = sysdate()
|
||||
</set>
|
||||
where menu_id = #{menuId}
|
||||
</update>
|
||||
|
||||
<insert id="insertMenu" parameterType="SysMenu">
|
||||
insert into sys_menu(
|
||||
<if test="menuId != null and menuId != 0">menu_id,</if>
|
||||
<if test="parentId != null and parentId != 0">parent_id,</if>
|
||||
<if test="menuName != null and menuName != ''">menu_name,</if>
|
||||
<if test="orderNum != null">order_num,</if>
|
||||
<if test="path != null and path != ''">path,</if>
|
||||
<if test="component != null and component != ''">component,</if>
|
||||
<if test="query != null and query != ''">`query`,</if>
|
||||
<if test="isFrame != null and isFrame != ''">is_frame,</if>
|
||||
<if test="isCache != null and isCache != ''">is_cache,</if>
|
||||
<if test="menuType != null and menuType != ''">menu_type,</if>
|
||||
<if test="visible != null">visible,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="perms !=null and perms != ''">perms,</if>
|
||||
<if test="icon != null and icon != ''">icon,</if>
|
||||
<if test="remark != null and remark != ''">remark,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
create_time
|
||||
)values(
|
||||
<if test="menuId != null and menuId != 0">#{menuId},</if>
|
||||
<if test="parentId != null and parentId != 0">#{parentId},</if>
|
||||
<if test="menuName != null and menuName != ''">#{menuName},</if>
|
||||
<if test="orderNum != null">#{orderNum},</if>
|
||||
<if test="path != null and path != ''">#{path},</if>
|
||||
<if test="component != null and component != ''">#{component},</if>
|
||||
<if test="query != null and query != ''">#{query},</if>
|
||||
<if test="isFrame != null and isFrame != ''">#{isFrame},</if>
|
||||
<if test="isCache != null and isCache != ''">#{isCache},</if>
|
||||
<if test="menuType != null and menuType != ''">#{menuType},</if>
|
||||
<if test="visible != null">#{visible},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="perms !=null and perms != ''">#{perms},</if>
|
||||
<if test="icon != null and icon != ''">#{icon},</if>
|
||||
<if test="remark != null and remark != ''">#{remark},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
sysdate()
|
||||
)
|
||||
</insert>
|
||||
|
||||
<delete id="deleteMenuById" parameterType="Long">
|
||||
delete from sys_menu where menu_id = #{menuId}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,82 @@
|
||||
<?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.mhd.system.mapper.SysMsgCenterMapper">
|
||||
|
||||
<resultMap type="SysMsgCenter" id="SysMsgCenterResult">
|
||||
<result property="msgCenterId" column="msg_center_id" />
|
||||
<result property="title" column="title" />
|
||||
<result property="content" column="content" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="msgStatus" column="msg_status" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="msgType" column="msg_type" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSysMsgCenterVo">
|
||||
select msg_center_id, title, content, create_time, msg_status, del_flag, msg_type from sys_msg_center
|
||||
</sql>
|
||||
|
||||
<select id="selectSysMsgCenterList" parameterType="com.mhd.system.domain.SysMsgCenter" resultMap="SysMsgCenterResult">
|
||||
<include refid="selectSysMsgCenterVo"/>
|
||||
<where>
|
||||
del_flag = 0
|
||||
<if test="title != null and title != ''"> and title like concat('%',#{title},'%')</if>
|
||||
<if test="content != null and content != ''"> and content = #{content}</if>
|
||||
<if test="msgStatus != null and msgStatus != ''"> and msg_status = #{msgStatus}</if>
|
||||
<if test="msgType != null and msgType != ''"> and msg_type like concat('%',#{msgType},'%')</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectSysMsgCenterByMsgCenterId" parameterType="Long" resultMap="SysMsgCenterResult">
|
||||
<include refid="selectSysMsgCenterVo"/>
|
||||
where msg_center_id = #{msgCenterId}
|
||||
</select>
|
||||
|
||||
<insert id="insertSysMsgCenter" parameterType="com.mhd.system.domain.SysMsgCenter" useGeneratedKeys="true" keyProperty="msgCenterId">
|
||||
insert into sys_msg_center
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="title != null">title,</if>
|
||||
<if test="content != null">content,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="msgStatus != null">msg_status,</if>
|
||||
<if test="msgType != null">msg_type</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="title != null">#{title},</if>
|
||||
<if test="content != null">#{content},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="msgStatus != null">#{msgStatus},</if>
|
||||
<if test="msgType != null">#{msgType},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateSysMsgCenter" parameterType="com.mhd.system.domain.SysMsgCenter">
|
||||
update sys_msg_center
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="title != null">title = #{title},</if>
|
||||
<if test="content != null">content = #{content},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="msgStatus != null">msg_status = #{msgStatus},</if>
|
||||
<if test="msgType != null">msg_type = #{msgType}</if>
|
||||
</trim>
|
||||
where msg_center_id = #{msgCenterId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteSysMsgCenterByMsgCenterId" parameterType="Long">
|
||||
delete from sys_msg_center where msg_center_id = #{msgCenterId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSysMsgCenterByMsgCenterIds" parameterType="String">
|
||||
delete from sys_msg_center where msg_center_id in
|
||||
<foreach item="msgCenterId" collection="array" open="(" separator="," close=")">
|
||||
#{msgCenterId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -0,0 +1,81 @@
|
||||
<?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.mhd.system.mapper.SysMsgPushMapper">
|
||||
|
||||
<resultMap type="com.mhd.system.domain.SysMsgPush" id="SysMsgPushResult">
|
||||
<id property="msgPushId" column="msg_push_id" />
|
||||
<result property="title" column="title" />
|
||||
<result property="content" column="content" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSysMsgPushVo">
|
||||
select msg_push_id, title, content,create_by, create_time, update_by, update_time from sys_msg_push
|
||||
</sql>
|
||||
|
||||
<select id="selectSysMsgPushList" parameterType="com.mhd.system.domain.dto.SysMsgPushDTO" resultMap="SysMsgPushResult">
|
||||
<include refid="selectSysMsgPushVo"/>
|
||||
<where>
|
||||
del_flag = 0
|
||||
<if test="title != null and title != ''"> and title like concat('%', #{title} , '%') </if>
|
||||
<if test="content != null and content != ''"> and content = #{content}</if>
|
||||
<if test="createBy != null and createBy != ''"> and create_by like concat('%', #{createBy} , '%')</if>
|
||||
<if test="params.begincreateTime != null and params.begincreateTime != ''">
|
||||
AND date_format(create_time,'%y%m%d') >= date_format(#{params.begincreateTime},'%y%m%d')
|
||||
</if>
|
||||
<if test="params.endcreateTime != null and params.endcreateTime != ''"><!-- 结束时间检索 -->
|
||||
AND date_format(create_time,'%y%m%d') <= date_format(#{params.endcreateTime},'%y%m%d')
|
||||
</if>
|
||||
|
||||
</where>
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectSysMsgPushByMsgPushId" parameterType="Long" resultMap="SysMsgPushResult">
|
||||
<include refid="selectSysMsgPushVo"/>
|
||||
where msg_push_id = #{msgPushId}
|
||||
</select>
|
||||
|
||||
<insert id="insertSysMsgPush" parameterType="com.mhd.system.domain.SysMsgPush" useGeneratedKeys="true" keyProperty="msgPushId">
|
||||
insert into sys_msg_push
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="title != null">title,</if>
|
||||
<if test="content != null">content,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="title != null">#{title},</if>
|
||||
<if test="content != null">#{content},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateSysMsgPush" parameterType="com.mhd.system.domain.SysMsgPush">
|
||||
update sys_msg_push
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="title != null">title = #{title},</if>
|
||||
<if test="content != null">content = #{content},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where msg_push_id = #{msgPushId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteSysMsgPushByMsgId" parameterType="Long">
|
||||
delete from sys_msg_push where msg_push_id = #{msgPushId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSysMsgPushByMsgIds" parameterType="String">
|
||||
delete from sys_msg_push where msg_push_id in
|
||||
<foreach item="msgPushId" collection="array" open="(" separator="," close=")">
|
||||
#{msgPushId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -0,0 +1,89 @@
|
||||
<?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.mhd.system.mapper.SysNoticeMapper">
|
||||
|
||||
<resultMap type="SysNotice" id="SysNoticeResult">
|
||||
<result property="noticeId" column="notice_id" />
|
||||
<result property="noticeTitle" column="notice_title" />
|
||||
<result property="noticeType" column="notice_type" />
|
||||
<result property="noticeContent" column="notice_content" />
|
||||
<result property="status" column="status" />
|
||||
<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="remark" column="remark" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectNoticeVo">
|
||||
select notice_id, notice_title, notice_type, cast(notice_content as char) as notice_content, status, create_by, create_time, update_by, update_time, remark
|
||||
from sys_notice
|
||||
</sql>
|
||||
|
||||
<select id="selectNoticeById" parameterType="Long" resultMap="SysNoticeResult">
|
||||
<include refid="selectNoticeVo"/>
|
||||
where notice_id = #{noticeId}
|
||||
</select>
|
||||
|
||||
<select id="selectNoticeList" parameterType="SysNotice" resultMap="SysNoticeResult">
|
||||
<include refid="selectNoticeVo"/>
|
||||
<where>
|
||||
<if test="noticeTitle != null and noticeTitle != ''">
|
||||
AND notice_title like concat('%', #{noticeTitle}, '%')
|
||||
</if>
|
||||
<if test="noticeType != null and noticeType != ''">
|
||||
AND notice_type = #{noticeType}
|
||||
</if>
|
||||
<if test="createBy != null and createBy != ''">
|
||||
AND create_by like concat('%', #{createBy}, '%')
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<insert id="insertNotice" parameterType="SysNotice">
|
||||
insert into sys_notice (
|
||||
<if test="noticeTitle != null and noticeTitle != '' ">notice_title, </if>
|
||||
<if test="noticeType != null and noticeType != '' ">notice_type, </if>
|
||||
<if test="noticeContent != null and noticeContent != '' ">notice_content, </if>
|
||||
<if test="status != null and status != '' ">status, </if>
|
||||
<if test="remark != null and remark != ''">remark,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
create_time
|
||||
)values(
|
||||
<if test="noticeTitle != null and noticeTitle != ''">#{noticeTitle}, </if>
|
||||
<if test="noticeType != null and noticeType != ''">#{noticeType}, </if>
|
||||
<if test="noticeContent != null and noticeContent != ''">#{noticeContent}, </if>
|
||||
<if test="status != null and status != ''">#{status}, </if>
|
||||
<if test="remark != null and remark != ''">#{remark},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
sysdate()
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="updateNotice" parameterType="SysNotice">
|
||||
update sys_notice
|
||||
<set>
|
||||
<if test="noticeTitle != null and noticeTitle != ''">notice_title = #{noticeTitle}, </if>
|
||||
<if test="noticeType != null and noticeType != ''">notice_type = #{noticeType}, </if>
|
||||
<if test="noticeContent != null">notice_content = #{noticeContent}, </if>
|
||||
<if test="status != null and status != ''">status = #{status}, </if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
update_time = sysdate()
|
||||
</set>
|
||||
where notice_id = #{noticeId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteNoticeById" parameterType="Long">
|
||||
delete from sys_notice where notice_id = #{noticeId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteNoticeByIds" parameterType="Long">
|
||||
delete from sys_notice where notice_id in
|
||||
<foreach item="noticeId" collection="array" open="(" separator="," close=")">
|
||||
#{noticeId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,50 @@
|
||||
<?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.mhd.system.mapper.SysOperLogMapper">
|
||||
|
||||
<sql id="selectOperLogVo">
|
||||
select *
|
||||
from sys_oper_log
|
||||
</sql>
|
||||
|
||||
<select id="selectOperLogList" parameterType="com.mhd.system.domain.dto.SysOperLogDTO" resultType="com.mhd.system.api.domain.SysOperLogPo">
|
||||
<include refid="selectOperLogVo"/>
|
||||
<where>
|
||||
<if test="businessType != null">
|
||||
AND business_type = #{businessType}
|
||||
</if>
|
||||
<if test="description != null and description != ''">
|
||||
AND description like concat('%', #{description}, '%')
|
||||
</if>
|
||||
<if test="userName != null and userName != ''">
|
||||
AND user_name like concat('%', #{userName}, '%')
|
||||
</if>
|
||||
<if test="userAccount != null and userAccount != ''">
|
||||
AND user_account like concat('%', #{userAccount}, '%')
|
||||
</if>
|
||||
<if test="organizationName != null and organizationName != ''">
|
||||
AND organization_name like concat('%', #{organizationName}, '%')
|
||||
</if>
|
||||
<if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
|
||||
and date_format(oper_time,'%y%m%d') >= date_format(#{beginTime},'%y%m%d')
|
||||
</if>
|
||||
<if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
|
||||
and date_format(oper_time,'%y%m%d') <= date_format(#{endTime},'%y%m%d')
|
||||
</if>
|
||||
<if test="organizationId != null ">
|
||||
and organization_id = #{organizationId}
|
||||
</if>
|
||||
<if test="topOrganizationId != null ">
|
||||
and top_organization_id = #{topOrganizationId}
|
||||
</if>
|
||||
</where>
|
||||
order by oper_time desc
|
||||
</select>
|
||||
|
||||
<update id="cleanOperLog">
|
||||
truncate table sys_oper_log
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,86 @@
|
||||
<?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.mhd.system.mapper.SysPlatCompanyMapper">
|
||||
|
||||
<resultMap type="SysPlatCompany" id="SysPlatCompanyResult">
|
||||
<result property="sysPlatId" column="sys_plat_id" />
|
||||
<result property="companyId" column="company_id" />
|
||||
<result property="productId" column="product_id" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
</resultMap>
|
||||
<resultMap type="SysPlatCompanyVO" id="SysPlatCompanyVOResult">
|
||||
<result property="sysPlatId" column="sys_plat_id" />
|
||||
<result property="companyId" column="company_id" />
|
||||
<result property="productId" column="product_id" />
|
||||
<result property="companyName" column="company_name" />
|
||||
<result property="companyPhone" column="companyPhone" />
|
||||
<result property="productName" column="product_name" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSysPlatCompanyVO">
|
||||
SELECT
|
||||
a.sys_plat_id,
|
||||
a.company_id,
|
||||
a.product_id,
|
||||
a.del_flag,
|
||||
b.company_name,
|
||||
b.user_name as companyPhone,
|
||||
c.product_name
|
||||
FROM
|
||||
sys_plat_company a
|
||||
LEFT JOIN sys_company b ON a.company_id = b.company_id
|
||||
LEFT JOIN sys_product c ON a.product_id = c.product_id
|
||||
</sql>
|
||||
|
||||
<select id="selectSysPlatCompanyList" parameterType="sysPlatCompanyDTO" resultMap="SysPlatCompanyVOResult">
|
||||
<include refid="selectSysPlatCompanyVO"/>
|
||||
<where>
|
||||
<if test="companyId != null "> and a.company_id = #{companyId}</if>
|
||||
<if test="productId != null "> and a.product_id = #{productId}</if>
|
||||
<if test="companyName != null and companyName != ''"> and b.company_name like concat('%', #{companyName}, '%')</if>
|
||||
<if test="productName != null and productName != ''"> and c.product_ame like concat('%', #{productName}, '%')</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectSysPlatCompanyBySysPlatId" parameterType="Long" resultMap="SysPlatCompanyResult">
|
||||
<include refid="selectSysPlatCompanyVO"/>
|
||||
where sys_plat_id = #{sysPlatId}
|
||||
</select>
|
||||
|
||||
<insert id="insertSysPlatCompany" parameterType="SysPlatCompany" useGeneratedKeys="true" keyProperty="sysPlatId">
|
||||
insert into sys_plat_company
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="companyId != null">company_id,</if>
|
||||
<if test="productId != null">product_id,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="companyId != null">#{companyId},</if>
|
||||
<if test="productId != null">#{productId},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateSysPlatCompany" parameterType="SysPlatCompany">
|
||||
update sys_plat_company
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="companyId != null">company_id = #{companyId},</if>
|
||||
<if test="productId != null">product_id = #{productId},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
</trim>
|
||||
where sys_plat_id = #{sysPlatId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteSysPlatCompanyBySysPlatId" parameterType="Long">
|
||||
delete from sys_plat_company where sys_plat_id = #{sysPlatId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSysPlatCompanyBySysPlatIds" parameterType="String">
|
||||
delete from sys_plat_company where sys_plat_id in
|
||||
<foreach item="sysPlatId" collection="array" open="(" separator="," close=")">
|
||||
#{sysPlatId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -0,0 +1,122 @@
|
||||
<?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.mhd.system.mapper.SysPostMapper">
|
||||
|
||||
<resultMap type="SysPost" id="SysPostResult">
|
||||
<id property="postId" column="post_id" />
|
||||
<result property="postCode" column="post_code" />
|
||||
<result property="postName" column="post_name" />
|
||||
<result property="postSort" column="post_sort" />
|
||||
<result property="status" column="status" />
|
||||
<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="remark" column="remark" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectPostVo">
|
||||
select post_id, post_code, post_name, post_sort, status, create_by, create_time, remark
|
||||
from sys_post
|
||||
</sql>
|
||||
|
||||
<select id="selectPostList" parameterType="SysPost" resultMap="SysPostResult">
|
||||
<include refid="selectPostVo"/>
|
||||
<where>
|
||||
<if test="postCode != null and postCode != ''">
|
||||
AND post_code like concat('%', #{postCode}, '%')
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
AND status = #{status}
|
||||
</if>
|
||||
<if test="postName != null and postName != ''">
|
||||
AND post_name like concat('%', #{postName}, '%')
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectPostAll" resultMap="SysPostResult">
|
||||
<include refid="selectPostVo"/>
|
||||
</select>
|
||||
|
||||
<select id="selectPostById" parameterType="Long" resultMap="SysPostResult">
|
||||
<include refid="selectPostVo"/>
|
||||
where post_id = #{postId}
|
||||
</select>
|
||||
|
||||
<select id="selectPostListByUserId" parameterType="Long" resultType="Long">
|
||||
select p.post_id
|
||||
from sys_post p
|
||||
left join sys_user_post up on up.post_id = p.post_id
|
||||
left join sys_user u on u.user_id = up.user_id
|
||||
where u.user_id = #{userId}
|
||||
</select>
|
||||
|
||||
<select id="selectPostsByUserName" parameterType="String" resultMap="SysPostResult">
|
||||
select p.post_id, p.post_name, p.post_code
|
||||
from sys_post p
|
||||
left join sys_user_post up on up.post_id = p.post_id
|
||||
left join sys_user u on u.user_id = up.user_id
|
||||
where u.user_name = #{userName}
|
||||
</select>
|
||||
|
||||
<select id="checkPostNameUnique" parameterType="String" resultMap="SysPostResult">
|
||||
<include refid="selectPostVo"/>
|
||||
where post_name=#{postName} limit 1
|
||||
</select>
|
||||
|
||||
<select id="checkPostCodeUnique" parameterType="String" resultMap="SysPostResult">
|
||||
<include refid="selectPostVo"/>
|
||||
where post_code=#{postCode} limit 1
|
||||
</select>
|
||||
|
||||
<update id="updatePost" parameterType="SysPost">
|
||||
update sys_post
|
||||
<set>
|
||||
<if test="postCode != null and postCode != ''">post_code = #{postCode},</if>
|
||||
<if test="postName != null and postName != ''">post_name = #{postName},</if>
|
||||
<if test="postSort != null and postSort != ''">post_sort = #{postSort},</if>
|
||||
<if test="status != null and status != ''">status = #{status},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
update_time = sysdate()
|
||||
</set>
|
||||
where post_id = #{postId}
|
||||
</update>
|
||||
|
||||
<insert id="insertPost" parameterType="SysPost" useGeneratedKeys="true" keyProperty="postId">
|
||||
insert into sys_post(
|
||||
<if test="postId != null and postId != 0">post_id,</if>
|
||||
<if test="postCode != null and postCode != ''">post_code,</if>
|
||||
<if test="postName != null and postName != ''">post_name,</if>
|
||||
<if test="postSort != null and postSort != ''">post_sort,</if>
|
||||
<if test="status != null and status != ''">status,</if>
|
||||
<if test="remark != null and remark != ''">remark,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
create_time
|
||||
)values(
|
||||
<if test="postId != null and postId != 0">#{postId},</if>
|
||||
<if test="postCode != null and postCode != ''">#{postCode},</if>
|
||||
<if test="postName != null and postName != ''">#{postName},</if>
|
||||
<if test="postSort != null and postSort != ''">#{postSort},</if>
|
||||
<if test="status != null and status != ''">#{status},</if>
|
||||
<if test="remark != null and remark != ''">#{remark},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
sysdate()
|
||||
)
|
||||
</insert>
|
||||
|
||||
<delete id="deletePostById" parameterType="Long">
|
||||
delete from sys_post where post_id = #{postId}
|
||||
</delete>
|
||||
|
||||
<delete id="deletePostByIds" parameterType="Long">
|
||||
delete from sys_post where post_id in
|
||||
<foreach collection="array" item="postId" open="(" separator="," close=")">
|
||||
#{postId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,85 @@
|
||||
<?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.mhd.system.mapper.SysProductMapper">
|
||||
|
||||
<resultMap type="com.mhd.system.domain.SysProduct" id="SysProductResult">
|
||||
<result property="productId" column="product_id" />
|
||||
<result property="productName" column="product_name" />
|
||||
<result property="productVersion" column="product_version" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="menuCheckStrictly" column="menu_check_strictly" />
|
||||
</resultMap>
|
||||
<resultMap type="com.mhd.system.domain.vo.SysProductVO" id="SysProductVOResult">
|
||||
<result property="productId" column="product_id" />
|
||||
<result property="productName" column="product_name" />
|
||||
<result property="productVersion" column="product_version" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="menuCheckStrictly" column="menu_check_strictly" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSysProductVo">
|
||||
select product_id, product_name, del_flag, menu_check_strictly,product_version from sys_product
|
||||
</sql>
|
||||
|
||||
<select id="selectSysProductList" parameterType="com.mhd.system.domain.SysProduct" resultMap="SysProductResult">
|
||||
<include refid="selectSysProductVo"/>
|
||||
<where>
|
||||
<if test="productName != null and productName != ''"> and product_name like concat('%', #{productName}, '%')</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectSysProductByProductId" parameterType="java.lang.Long" resultMap="SysProductResult">
|
||||
<include refid="selectSysProductVo"/>
|
||||
where product_id = #{productId}
|
||||
</select>
|
||||
|
||||
<insert id="insertSysProduct" parameterType="com.mhd.system.domain.SysProduct">
|
||||
insert into sys_product
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="productName != null">product_name,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
<if test="productVersion != null">product_version,</if>
|
||||
<if test="menuCheckStrictly != null">menu_check_strictly,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="productName != null">#{productName},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
<if test="productVersion != null">#{productVersion},</if>
|
||||
<if test="menuCheckStrictly != null">#{menuCheckStrictly},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateSysProduct" parameterType="com.mhd.system.domain.SysProduct">
|
||||
update sys_product
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="productName != null">product_name = #{productName},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="menuCheckStrictly != null">menu_check_strictly = #{menuCheckStrictly},</if>
|
||||
</trim>
|
||||
where product_id = #{productId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteSysProductByProductId" parameterType="java.lang.Long">
|
||||
delete from sys_product where product_id = #{productId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSysProductByProductIds" parameterType="java.lang.String">
|
||||
delete from sys_product where product_id in
|
||||
<foreach item="productId" collection="array" open="(" separator="," close=")">
|
||||
#{productId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
|
||||
<select id="selectProductById" parameterType="java.lang.Long" resultMap="SysProductResult">
|
||||
<include refid="selectSysProductVo"/>
|
||||
where product_id = #{productId}
|
||||
</select>
|
||||
|
||||
<select id="selectProductByProductName" parameterType="com.mhd.system.domain.dto.SysProductDTO" resultMap="SysProductResult">
|
||||
<include refid="selectSysProductVo"/>
|
||||
where product_name = #{productName} and del_flag = 0
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,71 @@
|
||||
<?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.mhd.system.mapper.SysProductMenuMapper">
|
||||
|
||||
<resultMap type="SysProductMenu" id="SysProductMenuResult">
|
||||
<result property="productId" column="product_id" />
|
||||
<result property="menuId" column="menu_id" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSysProductMenuVo">
|
||||
select product_id, menu_id, del_flag from sys_product_menu
|
||||
</sql>
|
||||
|
||||
<select id="selectSysProductMenuList" parameterType="SysProductMenu" resultMap="SysProductMenuResult">
|
||||
<include refid="selectSysProductMenuVo"/>
|
||||
<where>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectSysProductMenuByProductId" parameterType="Long" resultMap="SysProductMenuResult">
|
||||
<include refid="selectSysProductMenuVo"/>
|
||||
where product_id = #{productId}
|
||||
</select>
|
||||
|
||||
<insert id="insertSysProductMenu" parameterType="SysProductMenu">
|
||||
insert into sys_product_menu
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="productId != null">product_id,</if>
|
||||
<if test="menuId != null">menu_id,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="productId != null">#{productId},</if>
|
||||
<if test="menuId != null">#{menuId},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateSysProductMenu" parameterType="SysProductMenu">
|
||||
update sys_product_menu
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="menuId != null">menu_id = #{menuId},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
</trim>
|
||||
where product_id = #{productId}
|
||||
</update>
|
||||
|
||||
<!-- 根据产品ID删除产品与菜单ID关联-->
|
||||
<delete id="deleteSysProductMenuByProductId" parameterType="Long">
|
||||
delete from sys_product_menu where product_id = #{productId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSysProductMenuByProductIds" parameterType="String">
|
||||
delete from sys_product_menu where product_id in
|
||||
<foreach item="productId" collection="array" open="(" separator="," close=")">
|
||||
#{productId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<!-- 插入产品ID与菜单ID -->
|
||||
<insert id="batchProductMenu">
|
||||
insert into sys_product_menu(product_id, menu_id) values
|
||||
<foreach item="item" index="index" collection="list" separator=",">
|
||||
(#{item.productId},#{item.menuId})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,34 @@
|
||||
<?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.mhd.system.mapper.SysRoleDeptMapper">
|
||||
|
||||
<resultMap type="SysRoleDept" id="SysRoleDeptResult">
|
||||
<result property="roleId" column="role_id" />
|
||||
<result property="deptId" column="dept_id" />
|
||||
</resultMap>
|
||||
|
||||
<delete id="deleteRoleDeptByRoleId" parameterType="Long">
|
||||
delete from sys_role_dept where role_id=#{roleId}
|
||||
</delete>
|
||||
|
||||
<select id="selectCountRoleDeptByDeptId" resultType="Integer">
|
||||
select count(1) from sys_role_dept where dept_id=#{deptId}
|
||||
</select>
|
||||
|
||||
<delete id="deleteRoleDept" parameterType="Long">
|
||||
delete from sys_role_dept where role_id in
|
||||
<foreach collection="array" item="roleId" open="(" separator="," close=")">
|
||||
#{roleId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<insert id="batchRoleDept">
|
||||
insert into sys_role_dept(role_id, dept_id) values
|
||||
<foreach item="item" index="index" collection="list" separator=",">
|
||||
(#{item.roleId},#{item.deptId})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,174 @@
|
||||
<?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.mhd.system.mapper.SysRoleMapper">
|
||||
|
||||
<resultMap type="SysRole" id="SysRoleResult">
|
||||
<id property="roleId" column="role_id" />
|
||||
<result property="roleName" column="role_name" />
|
||||
<result property="roleKey" column="role_key" />
|
||||
<result property="roleSort" column="role_sort" />
|
||||
<result property="dataScope" column="data_scope" />
|
||||
<result property="menuCheckStrictly" column="menu_check_strictly" />
|
||||
<result property="deptCheckStrictly" column="dept_check_strictly" />
|
||||
<result property="status" column="status" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<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="remark" column="remark" />
|
||||
<result property="roleType" column="role_type" />
|
||||
<result property="companyId" column="company_id" />
|
||||
<result property="companyName" column="company_name" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectRoleVo">
|
||||
select distinct r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.menu_check_strictly, r.dept_check_strictly,
|
||||
r.status, r.del_flag, r.create_time, r.remark ,r.role_type,r.company_id,c.company_name
|
||||
from sys_role r
|
||||
left join sys_user_role ur on ur.role_id = r.role_id
|
||||
left join sys_user u on u.user_id = ur.user_id
|
||||
left join sys_dept d on u.dept_id = d.dept_id
|
||||
left join sys_company c on r.company_id = c.company_id
|
||||
</sql>
|
||||
|
||||
<select id="selectRoleList" parameterType="SysRole" resultMap="SysRoleResult">
|
||||
<include refid="selectRoleVo"/>
|
||||
where r.del_flag = '0'
|
||||
<if test="roleId != null and roleId != 0">
|
||||
AND r.role_id = #{roleId}
|
||||
</if>
|
||||
<if test="roleName != null and roleName != ''">
|
||||
AND r.role_name like concat('%', #{roleName}, '%')
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
AND r.status = #{status}
|
||||
</if>
|
||||
<if test="roleKey != null and roleKey != ''">
|
||||
AND r.role_key like concat('%', #{roleKey}, '%')
|
||||
</if>
|
||||
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
|
||||
and date_format(r.create_time,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d')
|
||||
</if>
|
||||
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
|
||||
and date_format(r.create_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d')
|
||||
</if>
|
||||
<if test="roleType != null and roleType != ''">
|
||||
AND r.role_type = #{roleType}
|
||||
</if>
|
||||
<if test="companyId != null and companyId != ''">
|
||||
AND r.company_id = #{companyId}
|
||||
</if>
|
||||
<if test="createBy != null and createBy != ''">
|
||||
AND r.create_by = #{createBy}
|
||||
</if>
|
||||
<!-- 数据范围过滤 -->
|
||||
${params.dataScope}
|
||||
order by r.role_sort
|
||||
</select>
|
||||
|
||||
<select id="selectRolePermissionByUserId" parameterType="Long" resultMap="SysRoleResult">
|
||||
<include refid="selectRoleVo"/>
|
||||
WHERE r.del_flag = '0' and ur.user_id = #{userId}
|
||||
</select>
|
||||
|
||||
<select id="selectRoleAll" resultMap="SysRoleResult">
|
||||
<include refid="selectRoleVo"/>
|
||||
</select>
|
||||
|
||||
<select id="selectRoleListByUserId" parameterType="Long" resultType="Long">
|
||||
select r.role_id
|
||||
from sys_role r
|
||||
left join sys_user_role ur on ur.role_id = r.role_id
|
||||
left join sys_user u on u.user_id = ur.user_id
|
||||
where u.user_id = #{userId}
|
||||
</select>
|
||||
|
||||
<select id="selectRoleById" parameterType="Long" resultMap="SysRoleResult">
|
||||
<include refid="selectRoleVo"/>
|
||||
where r.role_id = #{roleId}
|
||||
</select>
|
||||
<select id="selectRoleByRoleKey" parameterType="String" resultMap="SysRoleResult">
|
||||
<include refid="selectRoleVo"/>
|
||||
where r.role_key = #{roleKey}
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectRolesByUserName" parameterType="String" resultMap="SysRoleResult">
|
||||
<include refid="selectRoleVo"/>
|
||||
WHERE r.del_flag = '0' and u.user_name = #{userName}
|
||||
</select>
|
||||
|
||||
<select id="checkRoleNameUnique" parameterType="String" resultMap="SysRoleResult">
|
||||
<include refid="selectRoleVo"/>
|
||||
where r.role_name=#{roleName} limit 1
|
||||
</select>
|
||||
|
||||
<select id="checkRoleKeyUnique" parameterType="String" resultMap="SysRoleResult">
|
||||
<include refid="selectRoleVo"/>
|
||||
where r.role_key=#{roleKey} limit 1
|
||||
</select>
|
||||
|
||||
<insert id="insertRole" parameterType="SysRole" useGeneratedKeys="true" keyProperty="roleId">
|
||||
insert into sys_role(
|
||||
<if test="roleId != null and roleId != 0">role_id,</if>
|
||||
<if test="roleName != null and roleName != ''">role_name,</if>
|
||||
<if test="roleKey != null and roleKey != ''">role_key,</if>
|
||||
<if test="roleSort != null and roleSort != ''">role_sort,</if>
|
||||
<if test="dataScope != null and dataScope != ''">data_scope,</if>
|
||||
<if test="menuCheckStrictly != null">menu_check_strictly,</if>
|
||||
<if test="deptCheckStrictly != null">dept_check_strictly,</if>
|
||||
<if test="status != null and status != ''">status,</if>
|
||||
<if test="remark != null and remark != ''">remark,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
<if test="roleType != null and roleType != ''">role_type,</if>
|
||||
<if test="companyId != null and companyId != ''">company_id,</if>
|
||||
create_time
|
||||
)values(
|
||||
<if test="roleId != null and roleId != 0">#{roleId},</if>
|
||||
<if test="roleName != null and roleName != ''">#{roleName},</if>
|
||||
<if test="roleKey != null and roleKey != ''">#{roleKey},</if>
|
||||
<if test="roleSort != null and roleSort != ''">#{roleSort},</if>
|
||||
<if test="dataScope != null and dataScope != ''">#{dataScope},</if>
|
||||
<if test="menuCheckStrictly != null">#{menuCheckStrictly},</if>
|
||||
<if test="deptCheckStrictly != null">#{deptCheckStrictly},</if>
|
||||
<if test="status != null and status != ''">#{status},</if>
|
||||
<if test="remark != null and remark != ''">#{remark},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
<if test="roleType != null and roleType != ''">#{roleType},</if>
|
||||
<if test="companyId != null and companyId != ''">#{companyId},</if>
|
||||
sysdate()
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="updateRole" parameterType="SysRole">
|
||||
update sys_role
|
||||
<set>
|
||||
<if test="roleName != null and roleName != ''">role_name = #{roleName},</if>
|
||||
<if test="roleKey != null and roleKey != ''">role_key = #{roleKey},</if>
|
||||
<if test="roleSort != null and roleSort != ''">role_sort = #{roleSort},</if>
|
||||
<if test="dataScope != null and dataScope != ''">data_scope = #{dataScope},</if>
|
||||
<if test="menuCheckStrictly != null">menu_check_strictly = #{menuCheckStrictly},</if>
|
||||
<if test="deptCheckStrictly != null">dept_check_strictly = #{deptCheckStrictly},</if>
|
||||
<if test="status != null and status != ''">status = #{status},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
update_time = sysdate()
|
||||
</set>
|
||||
where role_id = #{roleId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteRoleById" parameterType="Long">
|
||||
update sys_role set del_flag = '2' where role_id = #{roleId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteRoleByIds" parameterType="Long">
|
||||
update sys_role set del_flag = '2' where role_id in
|
||||
<foreach collection="array" item="roleId" open="(" separator="," close=")">
|
||||
#{roleId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,34 @@
|
||||
<?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.mhd.system.mapper.SysRoleMenuMapper">
|
||||
|
||||
<resultMap type="SysRoleMenu" id="SysRoleMenuResult">
|
||||
<result property="roleId" column="role_id" />
|
||||
<result property="menuId" column="menu_id" />
|
||||
</resultMap>
|
||||
|
||||
<select id="checkMenuExistRole" resultType="Integer">
|
||||
select count(1) from sys_role_menu where menu_id = #{menuId}
|
||||
</select>
|
||||
|
||||
<delete id="deleteRoleMenuByRoleId" parameterType="Long">
|
||||
delete from sys_role_menu where role_id=#{roleId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteRoleMenu" parameterType="Long">
|
||||
delete from sys_role_menu where role_id in
|
||||
<foreach collection="array" item="roleId" open="(" separator="," close=")">
|
||||
#{roleId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<insert id="batchRoleMenu">
|
||||
insert into sys_role_menu(role_id, menu_id) values
|
||||
<foreach item="item" index="index" collection="list" separator=",">
|
||||
(#{item.roleId},#{item.menuId})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
</mapper>
|
||||
+123
@@ -0,0 +1,123 @@
|
||||
<?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.mhd.system.mapper.SysTenantManagementMapper">
|
||||
|
||||
<resultMap type="com.mhd.system.domain.vo.SysTenantManagementVO" id="SysTenantManagementResult">
|
||||
<result property="tenantId" column="tenant_id" />
|
||||
<result property="productId" column="product_id" />
|
||||
<result property="companyId" column="company_id" />
|
||||
<result property="accountingId" column="accounting_id" />
|
||||
<result property="chargeAmount" column="charge_amount" />
|
||||
<result property="tenantPhone" column="tenant_phone" />
|
||||
<result property="status" column="status" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<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="accountingDetail" column="accounting_detail" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSysTenantManagementVo">
|
||||
SELECT
|
||||
a.tenant_id,
|
||||
a.product_id,
|
||||
a.company_id,
|
||||
a.accounting_id,
|
||||
a.charge_amount,
|
||||
a.tenant_phone,
|
||||
a.`status`,
|
||||
a.del_flag,
|
||||
a.create_by,
|
||||
a.create_time,
|
||||
a.update_by,
|
||||
a.update_time ,
|
||||
a.accounting_detail ,
|
||||
c.company_name companyName,
|
||||
d.product_name productName
|
||||
FROM
|
||||
sys_tenant_management a
|
||||
LEFT JOIN sys_accounting_rules b on a.accounting_id = b.accounting_id
|
||||
LEFT JOIN sys_company c on a.company_id = c.company_id
|
||||
LEFT JOIN sys_product d on a.product_id = d.product_id
|
||||
</sql>
|
||||
|
||||
<select id="selectSysTenantManagementList" parameterType="com.mhd.system.domain.dto.SysTenantManagementDTO" resultMap="SysTenantManagementResult">
|
||||
<include refid="selectSysTenantManagementVo"/>
|
||||
where a.del_flag = 0
|
||||
<if test="productName != null and productName != ''"> and product_name = #{productName}</if>
|
||||
<if test="companyName != null and companyName != ''"> and company_name = #{companyName}</if>
|
||||
<if test="tenantPhone != null and tenantPhone != ''"> and tenant_phone like concat('%', #{tenantPhone}, '%')</if>
|
||||
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||
order by a.create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectSysTenantManagementByTenantId" parameterType="Long" resultMap="SysTenantManagementResult">
|
||||
<include refid="selectSysTenantManagementVo"/>
|
||||
where a.tenant_id = #{tenantId}
|
||||
</select>
|
||||
|
||||
<insert id="insertSysTenantManagement" parameterType="SysTenantManagement" useGeneratedKeys="true" keyProperty="tenantId">
|
||||
insert into sys_tenant_management
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="productId != null">product_id,</if>
|
||||
<if test="companyId != null">company_id,</if>
|
||||
<if test="accountingId != null">accounting_id,</if>
|
||||
<if test="chargeAmount != null">charge_amount,</if>
|
||||
<if test="tenantPhone != null and tenantPhone != ''">tenant_phone,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="accountingDetail != null and accountingDetail != ''">accounting_detail,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="productId != null">#{productId},</if>
|
||||
<if test="companyId != null">#{companyId},</if>
|
||||
<if test="accountingId != null">#{accountingId},</if>
|
||||
<if test="chargeAmount != null">#{chargeAmount},</if>
|
||||
<if test="tenantPhone != null and tenantPhone != ''">#{tenantPhone},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="accountingDetail != null and accountingDetail != ''">#{accountingDetail},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateSysTenantManagement" parameterType="SysTenantManagement">
|
||||
update sys_tenant_management
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="productId != null">product_id = #{productId},</if>
|
||||
<if test="companyId != null">company_id = #{companyId},</if>
|
||||
<if test="accountingId != null">accounting_id = #{accountingId},</if>
|
||||
<if test="chargeAmount != null">charge_amount = #{chargeAmount},</if>
|
||||
<if test="tenantPhone != null and tenantPhone != ''">tenant_phone = #{tenantPhone},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="accountingDetail != null and accountingDetail != ''">accounting_detail = #{accountingDetail},</if>
|
||||
</trim>
|
||||
where tenant_id = #{tenantId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteSysTenantManagementByTenantId" parameterType="Long">
|
||||
update sys_tenant_management set del_flag = 1 where tenant_id = #{tenantId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSysTenantManagementByTenantIds" parameterType="String">
|
||||
update sys_tenant_management set del_flag = 1 where tenant_id in
|
||||
<foreach item="tenantId" collection="array" open="(" separator="," close=")">
|
||||
#{tenantId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -0,0 +1,229 @@
|
||||
<?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.mhd.system.mapper.SysUserMapper">
|
||||
|
||||
<resultMap type="com.mhd.system.api.domain.SysUser" id="SysUserResult">
|
||||
<id property="userId" column="user_id" />
|
||||
<result property="deptId" column="dept_id" />
|
||||
<result property="userName" column="user_name" />
|
||||
<result property="nickName" column="nick_name" />
|
||||
<result property="email" column="email" />
|
||||
<result property="phonenumber" column="phonenumber" />
|
||||
<result property="sex" column="sex" />
|
||||
<result property="avatar" column="avatar" />
|
||||
<result property="password" column="password" />
|
||||
<result property="status" column="status" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="loginIp" column="login_ip" />
|
||||
<result property="loginDate" column="login_date" />
|
||||
<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="remark" column="remark" />
|
||||
<result property="companyId" column="company_id" />
|
||||
<result property="companyName" column="company_name" />
|
||||
<association property="dept" column="dept_id" javaType="com.mhd.system.api.domain.SysDept" resultMap="deptResult" />
|
||||
<collection property="roles" javaType="java.util.List" resultMap="RoleResult" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="deptResult" type="com.mhd.system.api.domain.SysDept">
|
||||
<id property="deptId" column="dept_id" />
|
||||
<result property="parentId" column="parent_id" />
|
||||
<result property="deptName" column="dept_name" />
|
||||
<result property="ancestors" column="ancestors" />
|
||||
<result property="orderNum" column="order_num" />
|
||||
<result property="leader" column="leader" />
|
||||
<result property="status" column="dept_status" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="RoleResult" type="com.mhd.system.api.domain.SysRole">
|
||||
<id property="roleId" column="role_id" />
|
||||
<result property="roleName" column="role_name" />
|
||||
<result property="roleKey" column="role_key" />
|
||||
<result property="roleSort" column="role_sort" />
|
||||
<result property="dataScope" column="data_scope" />
|
||||
<result property="status" column="role_status" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectUserVo">
|
||||
select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,
|
||||
d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status,
|
||||
r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status,u.company_id
|
||||
from sys_user u
|
||||
left join sys_dept d on u.dept_id = d.dept_id
|
||||
left join sys_user_role ur on u.user_id = ur.user_id
|
||||
left join sys_role r on r.role_id = ur.role_id
|
||||
</sql>
|
||||
|
||||
<select id="selectUserList" parameterType="com.mhd.system.api.domain.SysUser" resultMap="SysUserResult">
|
||||
select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader,c.company_name from sys_user u
|
||||
left join sys_dept d on u.dept_id = d.dept_id
|
||||
left join sys_company c on u.company_id = c.company_id
|
||||
where u.del_flag = '0'
|
||||
<if test="userId != null and userId != 0">
|
||||
AND u.user_id = #{userId}
|
||||
</if>
|
||||
<if test="userName != null and userName != ''">
|
||||
AND u.user_name like concat('%', #{userName}, '%')
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
AND u.status = #{status}
|
||||
</if>
|
||||
<if test="phonenumber != null and phonenumber != ''">
|
||||
AND u.phonenumber like concat('%', #{phonenumber}, '%')
|
||||
</if>
|
||||
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
|
||||
AND date_format(u.create_time,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d')
|
||||
</if>
|
||||
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
|
||||
AND date_format(u.create_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d')
|
||||
</if>
|
||||
<if test="deptId != null and deptId != 0">
|
||||
AND (u.dept_id = #{deptId} OR u.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE find_in_set(#{deptId}, ancestors) ))
|
||||
</if>
|
||||
<if test="companyId != null ">
|
||||
AND u.company_id = #{companyId}
|
||||
</if>
|
||||
<!-- 数据范围过滤 -->
|
||||
${params.dataScope}
|
||||
</select>
|
||||
|
||||
<select id="selectAllocatedList" parameterType="com.mhd.system.api.domain.SysUser" resultMap="SysUserResult">
|
||||
select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time
|
||||
from sys_user u
|
||||
left join sys_dept d on u.dept_id = d.dept_id
|
||||
left join sys_user_role ur on u.user_id = ur.user_id
|
||||
left join sys_role r on r.role_id = ur.role_id
|
||||
where u.del_flag = '0' and r.role_id = #{roleId}
|
||||
<if test="userName != null and userName != ''">
|
||||
AND u.user_name like concat('%', #{userName}, '%')
|
||||
</if>
|
||||
<if test="phonenumber != null and phonenumber != ''">
|
||||
AND u.phonenumber like concat('%', #{phonenumber}, '%')
|
||||
</if>
|
||||
<!-- 数据范围过滤 -->
|
||||
${params.dataScope}
|
||||
</select>
|
||||
|
||||
<select id="selectUnallocatedList" parameterType="com.mhd.system.api.domain.SysUser" resultMap="SysUserResult">
|
||||
select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time
|
||||
from sys_user u
|
||||
left join sys_dept d on u.dept_id = d.dept_id
|
||||
left join sys_user_role ur on u.user_id = ur.user_id
|
||||
left join sys_role r on r.role_id = ur.role_id
|
||||
where u.del_flag = '0' and (r.role_id != #{roleId} or r.role_id IS NULL)
|
||||
and u.user_id not in (select u.user_id from sys_user u inner join sys_user_role ur on u.user_id = ur.user_id and ur.role_id = #{roleId})
|
||||
<if test="userName != null and userName != ''">
|
||||
AND u.user_name like concat('%', #{userName}, '%')
|
||||
</if>
|
||||
<if test="phonenumber != null and phonenumber != ''">
|
||||
AND u.phonenumber like concat('%', #{phonenumber}, '%')
|
||||
</if>
|
||||
<!-- 数据范围过滤 -->
|
||||
${params.dataScope}
|
||||
</select>
|
||||
|
||||
<select id="selectUserByUserName" parameterType="java.lang.String" resultMap="SysUserResult">
|
||||
<include refid="selectUserVo"/>
|
||||
where u.user_name = #{userName}
|
||||
</select>
|
||||
|
||||
<select id="selectUserById" parameterType="java.lang.Long" resultMap="SysUserResult">
|
||||
<include refid="selectUserVo"/>
|
||||
where u.user_id = #{userId}
|
||||
</select>
|
||||
|
||||
<select id="checkUserNameUnique" parameterType="String" resultType="int">
|
||||
select count(1) from sys_user where user_name = #{userName} limit 1
|
||||
</select>
|
||||
|
||||
<select id="checkPhoneUnique" parameterType="String" resultMap="SysUserResult">
|
||||
select user_id, phonenumber from sys_user where phonenumber = #{phonenumber} limit 1
|
||||
</select>
|
||||
|
||||
<select id="checkEmailUnique" parameterType="String" resultMap="SysUserResult">
|
||||
select user_id, email from sys_user where email = #{email} limit 1
|
||||
</select>
|
||||
|
||||
<insert id="insertUser" parameterType="SysUser" useGeneratedKeys="true" keyProperty="userId">
|
||||
insert into sys_user(
|
||||
<if test="userId != null and userId != 0">user_id,</if>
|
||||
<if test="deptId != null and deptId != 0">dept_id,</if>
|
||||
<if test="userName != null and userName != ''">user_name,</if>
|
||||
<if test="nickName != null and nickName != ''">nick_name,</if>
|
||||
<if test="email != null and email != ''">email,</if>
|
||||
<if test="avatar != null and avatar != ''">avatar,</if>
|
||||
<if test="phonenumber != null and phonenumber != ''">phonenumber,</if>
|
||||
<if test="sex != null and sex != ''">sex,</if>
|
||||
<if test="password != null and password != ''">password,</if>
|
||||
<if test="status != null and status != ''">status,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
<if test="remark != null and remark != ''">remark,</if>
|
||||
<if test="companyId != null and companyId != ''">company_id,</if>
|
||||
create_time
|
||||
)values(
|
||||
<if test="userId != null and userId != ''">#{userId},</if>
|
||||
<if test="deptId != null and deptId != ''">#{deptId},</if>
|
||||
<if test="userName != null and userName != ''">#{userName},</if>
|
||||
<if test="nickName != null and nickName != ''">#{nickName},</if>
|
||||
<if test="email != null and email != ''">#{email},</if>
|
||||
<if test="avatar != null and avatar != ''">#{avatar},</if>
|
||||
<if test="phonenumber != null and phonenumber != ''">#{phonenumber},</if>
|
||||
<if test="sex != null and sex != ''">#{sex},</if>
|
||||
<if test="password != null and password != ''">#{password},</if>
|
||||
<if test="status != null and status != ''">#{status},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
<if test="remark != null and remark != ''">#{remark},</if>
|
||||
<if test="companyId != null and companyId != ''">#{companyId},</if>
|
||||
sysdate()
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="updateUser" parameterType="SysUser">
|
||||
update sys_user
|
||||
<set>
|
||||
<if test="deptId != null and deptId != 0">dept_id = #{deptId},</if>
|
||||
<if test="userName != null and userName != ''">user_name = #{userName},</if>
|
||||
<if test="nickName != null and nickName != ''">nick_name = #{nickName},</if>
|
||||
<if test="email != null ">email = #{email},</if>
|
||||
<if test="phonenumber != null ">phonenumber = #{phonenumber},</if>
|
||||
<if test="sex != null and sex != ''">sex = #{sex},</if>
|
||||
<if test="avatar != null and avatar != ''">avatar = #{avatar},</if>
|
||||
<if test="password != null and password != ''">password = #{password},</if>
|
||||
<if test="status != null and status != ''">status = #{status},</if>
|
||||
<if test="loginIp != null and loginIp != ''">login_ip = #{loginIp},</if>
|
||||
<if test="loginDate != null">login_date = #{loginDate},</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
update_time = sysdate()
|
||||
</set>
|
||||
where user_id = #{userId}
|
||||
</update>
|
||||
|
||||
<update id="updateUserStatus" parameterType="SysUser">
|
||||
update sys_user set status = #{status} where user_id = #{userId}
|
||||
</update>
|
||||
|
||||
<update id="updateUserAvatar" parameterType="SysUser">
|
||||
update sys_user set avatar = #{avatar} where user_name = #{userName}
|
||||
</update>
|
||||
|
||||
<update id="resetUserPwd" parameterType="SysUser">
|
||||
update sys_user set password = #{password} where user_name = #{userName}
|
||||
</update>
|
||||
|
||||
<delete id="deleteUserById" parameterType="Long">
|
||||
update sys_user set del_flag = '2' where user_id = #{userId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteUserByIds" parameterType="Long">
|
||||
update sys_user set del_flag = '2' where user_id in
|
||||
<foreach collection="array" item="userId" open="(" separator="," close=")">
|
||||
#{userId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,34 @@
|
||||
<?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.mhd.system.mapper.SysUserPostMapper">
|
||||
|
||||
<resultMap type="SysUserPost" id="SysUserPostResult">
|
||||
<result property="userId" column="user_id" />
|
||||
<result property="postId" column="post_id" />
|
||||
</resultMap>
|
||||
|
||||
<delete id="deleteUserPostByUserId" parameterType="Long">
|
||||
delete from sys_user_post where user_id=#{userId}
|
||||
</delete>
|
||||
|
||||
<select id="countUserPostById" resultType="Integer">
|
||||
select count(1) from sys_user_post where post_id=#{postId}
|
||||
</select>
|
||||
|
||||
<delete id="deleteUserPost" parameterType="Long">
|
||||
delete from sys_user_post where user_id in
|
||||
<foreach collection="array" item="userId" open="(" separator="," close=")">
|
||||
#{userId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<insert id="batchUserPost">
|
||||
insert into sys_user_post(user_id, post_id) values
|
||||
<foreach item="item" index="index" collection="list" separator=",">
|
||||
(#{item.userId},#{item.postId})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,44 @@
|
||||
<?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.mhd.system.mapper.SysUserRoleMapper">
|
||||
|
||||
<resultMap type="SysUserRole" id="SysUserRoleResult">
|
||||
<result property="userId" column="user_id" />
|
||||
<result property="roleId" column="role_id" />
|
||||
</resultMap>
|
||||
|
||||
<delete id="deleteUserRoleByUserId" parameterType="Long">
|
||||
delete from sys_user_role where user_id=#{userId}
|
||||
</delete>
|
||||
|
||||
<select id="countUserRoleByRoleId" resultType="Integer">
|
||||
select count(1) from sys_user_role where role_id=#{roleId}
|
||||
</select>
|
||||
|
||||
<delete id="deleteUserRole" parameterType="Long">
|
||||
delete from sys_user_role where user_id in
|
||||
<foreach collection="array" item="userId" open="(" separator="," close=")">
|
||||
#{userId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<insert id="batchUserRole">
|
||||
insert into sys_user_role(user_id, role_id) values
|
||||
<foreach item="item" index="index" collection="list" separator=",">
|
||||
(#{item.userId},#{item.roleId})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<delete id="deleteUserRoleInfo" parameterType="SysUserRole">
|
||||
delete from sys_user_role where user_id=#{userId} and role_id=#{roleId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteUserRoleInfos">
|
||||
delete from sys_user_role where role_id=#{roleId} and user_id in
|
||||
<foreach collection="userIds" item="userId" open="(" separator="," close=")">
|
||||
#{userId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user