137 lines
7.2 KiB
XML
137 lines
7.2 KiB
XML
|
|
<?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.czlis.liswork.mapper.xtwh.ComReportDictMapper">
|
||
|
|
<resultMap type="com.czlis.common.core.domain.entity.lis.ComReportDict" id="ComReportDictResult">
|
||
|
|
<id property="reportId" column="report_id" />
|
||
|
|
<result property="reportType" column="report_type" />
|
||
|
|
<result property="reportCode" column="report_code" />
|
||
|
|
<result property="reportName" column="report_name" />
|
||
|
|
<result property="reportOptiontype" column="report_optiontype" />
|
||
|
|
<result property="reportDefvalue" column="report_defvalue" />
|
||
|
|
<result property="reportSort" column="report_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="selectComReportDictVo">
|
||
|
|
select report_id,report_type,report_code,report_name,report_optiontype,report_defvalue,report_sort,
|
||
|
|
status,create_by,create_time,update_by,update_time,remark from com_report_dict
|
||
|
|
</sql>
|
||
|
|
<select id="selectComReportDictList" resultMap="ComReportDictResult" parameterType="com.czlis.common.core.domain.entity.lis.ComReportDict" >
|
||
|
|
<include refid="selectComReportDictVo"></include>
|
||
|
|
<where>
|
||
|
|
<if test="reportId != null and reportId != 0">
|
||
|
|
and report_id = #{reportId}
|
||
|
|
</if>
|
||
|
|
<if test="reportType != null and reportType != ''">
|
||
|
|
and report_type = #{reportType}
|
||
|
|
</if>
|
||
|
|
<if test="reportCode != null and reportCode != ''">
|
||
|
|
and report_code = #{reportCode}
|
||
|
|
</if>
|
||
|
|
<if test="reportName != null and reportName != ''">
|
||
|
|
and report_name = #{reportName}
|
||
|
|
</if>
|
||
|
|
<if test="reportOptiontype != null and reportOptiontype != ''">
|
||
|
|
and report_optiontype = #{reportOptiontype}
|
||
|
|
</if>
|
||
|
|
<if test="status != null and status != ''">
|
||
|
|
and status = #{status}
|
||
|
|
</if>
|
||
|
|
</where>
|
||
|
|
order by report_sort ASC
|
||
|
|
</select>
|
||
|
|
<select id="getCountById" resultType="Long">
|
||
|
|
select count(1) from com_report_dict where report_id = #{reportId}
|
||
|
|
</select>
|
||
|
|
<select id="selectComReportDictAll" resultMap="ComReportDictResult">
|
||
|
|
<include refid="selectComReportDictVo"/>
|
||
|
|
order by report_sort
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id="selectComReportDictById" parameterType="Long" resultMap="ComReportDictResult">
|
||
|
|
<include refid="selectComReportDictVo"/>
|
||
|
|
where report_id = #{reportId}
|
||
|
|
</select>
|
||
|
|
<select id="selectComReportDictByType" parameterType="String" resultMap="ComReportDictResult">
|
||
|
|
<include refid="selectComReportDictVo"/>
|
||
|
|
where report_type = #{reportType}
|
||
|
|
order by report_sort
|
||
|
|
</select>
|
||
|
|
|
||
|
|
|
||
|
|
<select id="checkDictNameUnique" parameterType="String" resultMap="ComReportDictResult">
|
||
|
|
select top 1 report_id,report_type,report_code,report_name,report_optiontype,report_defvalue,report_sort,
|
||
|
|
status,create_by,create_time,update_by,update_time,remark
|
||
|
|
from com_report_dict
|
||
|
|
where report_name=#{reportName} and report_type = #{reportType}
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id="checkDictCodeUnique" parameterType="String" resultMap="ComReportDictResult">
|
||
|
|
select top 1 report_id,report_type,report_code,report_name,report_optiontype,report_defvalue,report_sort,
|
||
|
|
status,create_by,create_time,update_by,update_time,remark
|
||
|
|
from com_report_dict
|
||
|
|
where report_code=#{reportCode} and report_type = #{reportType}
|
||
|
|
</select>
|
||
|
|
<insert id="insertComReportDict" parameterType="com.czlis.common.core.domain.entity.lis.ComReportDict" useGeneratedKeys="true" keyProperty="reportId">
|
||
|
|
insert into com_report_dict(
|
||
|
|
<if test="reportId != null and reportId != 0">report_id,</if>
|
||
|
|
<if test="reportType != null and reportType != ''">report_type,</if>
|
||
|
|
<if test="reportCode != null and reportCode != ''">report_code,</if>
|
||
|
|
<if test="reportName != null and reportName != ''">report_name,</if>
|
||
|
|
<if test="reportOptiontype != null and reportOptiontype != ''">report_optiontype,</if>
|
||
|
|
<if test="reportDefvalue != null and reportDefvalue != ''">report_defvalue,</if>
|
||
|
|
<if test="reportSort != null">report_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="reportId != null and reportId != 0">#{reportId},</if>
|
||
|
|
<if test="reportType != null and reportType != ''">#{reportType},</if>
|
||
|
|
<if test="reportCode != null and reportCode != ''">#{reportCode},</if>
|
||
|
|
<if test="reportName != null and reportName != ''">#{reportName},</if>
|
||
|
|
<if test="reportOptiontype != null and reportOptiontype != ''">#{reportOptiontype},</if>
|
||
|
|
<if test="reportDefvalue != null and reportDefvalue != ''">#{reportDefvalue},</if>
|
||
|
|
<if test="reportSort != null">#{reportSort},</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>
|
||
|
|
getdate()
|
||
|
|
)
|
||
|
|
</insert>
|
||
|
|
|
||
|
|
<delete id="delComReportDictById" parameterType="Long">
|
||
|
|
delete from com_report_dict where report_id = #{reportId}
|
||
|
|
</delete>
|
||
|
|
|
||
|
|
<delete id="delComReportDictByIds" parameterType="Long">
|
||
|
|
delete from com_report_dict where report_id in
|
||
|
|
<foreach collection="array" item="reportId" open="(" separator="," close=")">
|
||
|
|
#{reportId}
|
||
|
|
</foreach>
|
||
|
|
</delete>
|
||
|
|
|
||
|
|
<update id="updateComReportDict" parameterType="com.czlis.common.core.domain.entity.lis.ComReportDict">
|
||
|
|
update com_report_dict
|
||
|
|
<set>
|
||
|
|
<if test="reportType != null and reportType != ''">report_type = #{reportType},</if>
|
||
|
|
<if test="reportCode != null and reportCode != ''">report_code = #{reportCode},</if>
|
||
|
|
<if test="reportName != null and reportName != ''">report_name = #{reportName},</if>
|
||
|
|
<if test="reportOptiontype != null and reportOptiontype != ''">report_optiontype = #{reportOptiontype},</if>
|
||
|
|
<if test="reportDefvalue != null and reportDefvalue != ''">report_defvalue = #{reportDefvalue},</if>
|
||
|
|
<if test="reportSort != null">report_sort = #{reportSort},</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 = getdate()
|
||
|
|
</set>
|
||
|
|
where report_id = #{reportId}
|
||
|
|
</update>
|
||
|
|
|
||
|
|
|
||
|
|
</mapper>
|