|
|
|
<?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.win.print.mapper.WinPrintModelMapper">
|
|
|
|
|
|
|
|
<resultMap type="WinPrintModel" id="WinPrintModelResult">
|
|
|
|
<result property="tenantId" column="tenant_id" />
|
|
|
|
<result property="revision" column="revision" />
|
|
|
|
<result property="createdBy" column="created_by" />
|
|
|
|
<result property="createdTime" column="created_time" />
|
|
|
|
<result property="updatedBy" column="updated_by" />
|
|
|
|
<result property="updatedTime" column="updated_time" />
|
|
|
|
<result property="id" column="id" />
|
|
|
|
<result property="mName" column="m_name" />
|
|
|
|
<result property="mCode" column="m_code" />
|
|
|
|
<result property="mType" column="m_type" />
|
|
|
|
<result property="mFilename" column="m_filename" />
|
|
|
|
<result property="isDyparam" column="is_dyparam" />
|
|
|
|
<result property="mTypeSrc" column="m_type_src" />
|
|
|
|
<result property="mPageSize" column="m_page_size" />
|
|
|
|
<result property="mPageValue" column="m_page_value" />
|
|
|
|
<result property="isPageRotate" column="is_page_rotate" />
|
|
|
|
<result property="mData" column="m_data" />
|
|
|
|
</resultMap>
|
|
|
|
<resultMap type="WinPrintModelSimple" id="WinPrintModelWinPrintSimple">
|
|
|
|
<result property="mName" column="m_name" />
|
|
|
|
<result property="mCode" column="m_code" />
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
<resultMap id="WinPrintModelWinPrintModelParamsResult" type="WinPrintModel" extends="WinPrintModelResult">
|
|
|
|
<collection property="winPrintModelParamsList" ofType="WinPrintModelParams" column="m_code" select="selectWinPrintModelParamsList" />
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
<resultMap type="WinPrintModelParams" id="WinPrintModelParamsResult">
|
|
|
|
<result property="tenantId" column="tenant_id" />
|
|
|
|
<result property="revision" column="revision" />
|
|
|
|
<result property="createdBy" column="created_by" />
|
|
|
|
<result property="createdTime" column="created_time" />
|
|
|
|
<result property="updatedBy" column="updated_by" />
|
|
|
|
<result property="updatedTime" column="updated_time" />
|
|
|
|
<result property="id" column="id" />
|
|
|
|
<result property="modelCode" column="model_code" />
|
|
|
|
<result property="paramCode" column="param_code" />
|
|
|
|
<result property="paramDesc" column="param_desc" />
|
|
|
|
<result property="paramType" column="param_type" />
|
|
|
|
<result property="paramName" column="param_name" />
|
|
|
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
<sql id="selectWinPrintModelVo">
|
|
|
|
select tenant_id, revision, created_by, created_time, updated_by, updated_time, id, m_name, m_code, m_type, m_filename, is_dyparam,m_type_src,m_page_size,m_page_value,is_page_rotate,m_data from win_print_model
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
<select id="selectWinPrintModelList" parameterType="WinPrintModel" resultMap="WinPrintModelResult">
|
|
|
|
<include refid="selectWinPrintModelVo"/>
|
|
|
|
<where>
|
|
|
|
<if test="mName != null and mName != ''"> and m_name like concat('%', #{mName}, '%')</if>
|
|
|
|
<if test="mCode != null and mCode != ''"> and m_code = #{mCode}</if>
|
|
|
|
<if test="mType != null and mType != ''"> and m_type = #{mType}</if>
|
|
|
|
<if test="isDyparam != null and isDyparam != ''"> and is_dyparam = #{isDyparam}</if>
|
|
|
|
<if test="mTypeSrc != null and mTypeSrc != ''"> and m_type_src = #{mTypeSrc}</if>
|
|
|
|
|
|
|
|
</where>
|
|
|
|
order by created_time desc
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<select id="selectWinPrintModelById" parameterType="Long" resultMap="WinPrintModelWinPrintModelParamsResult">
|
|
|
|
<include refid="selectWinPrintModelVo"/>
|
|
|
|
where id = #{id}
|
|
|
|
</select>
|
|
|
|
<select id="selectWinPrintModelListSimple" resultMap="WinPrintModelWinPrintSimple">
|
|
|
|
select m_name, m_code from win_print_model
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<select id="selectWinPrintModelByCode" parameterType="String" resultMap="WinPrintModelWinPrintModelParamsResult">
|
|
|
|
<include refid="selectWinPrintModelVo"/>
|
|
|
|
where m_code = #{code}
|
|
|
|
</select>
|
|
|
|
<select id="selectWinPrintModelParamsList" resultMap="WinPrintModelParamsResult">
|
|
|
|
select tenant_id, revision, created_by, created_time, updated_by, updated_time, id, model_code, param_code, param_desc, param_type,param_name
|
|
|
|
from win_print_model_params
|
|
|
|
where model_code = #{m_code}
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<insert id="insertWinPrintModel" parameterType="WinPrintModel" useGeneratedKeys="true" keyProperty="id">
|
|
|
|
insert into win_print_model
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
<if test="tenantId != null">tenant_id,</if>
|
|
|
|
<if test="revision != null">revision,</if>
|
|
|
|
<if test="createdBy != null">created_by,</if>
|
|
|
|
<if test="createdTime != null">created_time,</if>
|
|
|
|
<if test="updatedBy != null">updated_by,</if>
|
|
|
|
<if test="updatedTime != null">updated_time,</if>
|
|
|
|
<if test="mName != null and mName != ''">m_name,</if>
|
|
|
|
<if test="mCode != null">m_code,</if>
|
|
|
|
<if test="mType != null and mType != ''">m_type,</if>
|
|
|
|
<if test="mFilename != null">m_filename,</if>
|
|
|
|
<if test="isDyparam != null and isDyparam != ''">is_dyparam,</if>
|
|
|
|
<if test="mTypeSrc != null and mTypeSrc != ''">m_type_src,</if>
|
|
|
|
<if test="mPageSize != null and mPageSize != ''">m_page_size,</if>
|
|
|
|
<if test="mPageValue != null and mPageValue != ''">m_page_value,</if>
|
|
|
|
<if test="isPageRotate != null and isPageRotate != ''">is_page_rotate,</if>
|
|
|
|
<if test="mData != null and mData != ''">m_data,</if>
|
|
|
|
|
|
|
|
</trim>
|
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
<if test="tenantId != null">#{tenantId},</if>
|
|
|
|
<if test="revision != null">#{revision},</if>
|
|
|
|
<if test="createdBy != null">#{createdBy},</if>
|
|
|
|
<if test="createdTime != null">#{createdTime},</if>
|
|
|
|
<if test="updatedBy != null">#{updatedBy},</if>
|
|
|
|
<if test="updatedTime != null">#{updatedTime},</if>
|
|
|
|
<if test="mName != null and mName != ''">#{mName},</if>
|
|
|
|
<if test="mCode != null">#{mCode},</if>
|
|
|
|
<if test="mType != null and mType != ''">#{mType},</if>
|
|
|
|
<if test="mFilename != null">#{mFilename},</if>
|
|
|
|
<if test="isDyparam != null and isDyparam != ''">#{isDyparam},</if>
|
|
|
|
<if test="mTypeSrc != null and mTypeSrc != ''">#{mTypeSrc},</if>
|
|
|
|
<if test="mPageSize != null and mPageSize != ''">#{mPageSize},</if>
|
|
|
|
<if test="mPageValue != null and mPageValue != ''">#{mPageValue},</if>
|
|
|
|
<if test="isPageRotate != null and isPageRotate != ''">#{isPageRotate},</if>
|
|
|
|
<if test="mData != null and mData != ''">#{mData},</if>
|
|
|
|
</trim>
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
<update id="updateWinPrintModel" parameterType="WinPrintModel">
|
|
|
|
update win_print_model
|
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
|
<if test="tenantId != null">tenant_id = #{tenantId},</if>
|
|
|
|
<if test="revision != null">revision = #{revision},</if>
|
|
|
|
<if test="createdBy != null">created_by = #{createdBy},</if>
|
|
|
|
<if test="createdTime != null">created_time = #{createdTime},</if>
|
|
|
|
<if test="updatedBy != null">updated_by = #{updatedBy},</if>
|
|
|
|
<if test="updatedTime != null">updated_time = #{updatedTime},</if>
|
|
|
|
<if test="mName != null and mName != ''">m_name = #{mName},</if>
|
|
|
|
<if test="mCode != null">m_code = #{mCode},</if>
|
|
|
|
<if test="mType != null and mType != ''">m_type = #{mType},</if>
|
|
|
|
<if test="mFilename != null">m_filename = #{mFilename},</if>
|
|
|
|
<if test="isDyparam != null and isDyparam != ''">is_dyparam = #{isDyparam},</if>
|
|
|
|
<if test="mTypeSrc != null and mTypeSrc != ''">m_type_src=#{mTypeSrc},</if>
|
|
|
|
<if test="mPageSize != null and mPageSize != ''">m_page_size=#{mPageSize},</if>
|
|
|
|
<if test="mPageValue != null and mPageValue != ''">m_page_value=#{mPageValue},</if>
|
|
|
|
<if test="isPageRotate != null and isPageRotate != ''">is_page_rotate=#{isPageRotate},</if>
|
|
|
|
<if test="mData != null and mData != ''">m_data=#{mData},</if>
|
|
|
|
</trim>
|
|
|
|
where id = #{id}
|
|
|
|
</update>
|
|
|
|
|
|
|
|
<delete id="deleteWinPrintModelById" parameterType="Long">
|
|
|
|
delete from win_print_model where id = #{id}
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
<delete id="deleteWinPrintModelByIds" parameterType="String">
|
|
|
|
delete from win_print_model where id in
|
|
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
|
#{id}
|
|
|
|
</foreach>
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
<delete id="deleteWinPrintModelParamsByModelCodes" parameterType="String">
|
|
|
|
delete from win_print_model_params where model_code in
|
|
|
|
<foreach item="modelCode" collection="array" open="(" separator="," close=")">
|
|
|
|
#{modelCode}
|
|
|
|
</foreach>
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
<delete id="deleteWinPrintModelParamsByModelCode" parameterType="String">
|
|
|
|
delete from win_print_model_params where model_code = #{modelCode}
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
<insert id="batchWinPrintModelParams">
|
|
|
|
insert into win_print_model_params( tenant_id, revision, created_by, created_time, updated_by, updated_time, id, model_code, param_code, param_desc, param_type,param_name) values
|
|
|
|
<foreach item="item" index="index" collection="list" separator=",">
|
|
|
|
( #{item.tenantId}, #{item.revision}, #{item.createdBy}, #{item.createdTime}, #{item.updatedBy}, #{item.updatedTime}, #{item.id}, #{item.modelCode}, #{item.paramCode}, #{item.paramDesc}, #{item.paramType}, #{item.paramName})
|
|
|
|
</foreach>
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
</mapper>
|