admin
2021-10-13 052e1d5c47c4e536fde79074d53b0481c7d4f9b6
src/main/resources/generater/dao/mybatisDBXML.ftl
@@ -17,32 +17,32 @@
    </sql>
    <select id="selectByPrimaryKey" resultMap="BaseResultMap"
            parameterType="java.lang.Long">
            parameterType="${identify.type}">
        select
        <include refid="Base_Column_List"/>
        from ${table} where ${identify.column} = <#noparse>#{</#noparse>id, jdbcType=${identify.jdbcType}}
    </select>
    <select id="selectByPrimaryKeyForUpdate" resultMap="BaseResultMap"
            parameterType="java.lang.Long">
            parameterType="${identify.type}">
        select
        <include refid="Base_Column_List"/>
        from ${table} where ${identify.column} = <#noparse>#{</#noparse>id,jdbcType=${identify.jdbcType}} for update
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    <delete id="deleteByPrimaryKey" parameterType="${identify.type}">
        delete from
        ${table} where ${identify.column} = <#noparse>#{</#noparse>id,jdbcType=${identify.jdbcType}}
    </delete>
    <insert id="insert"
            parameterType="${entity.class}"
            parameterType="${entity.clazz}"
            useGeneratedKeys="true" keyProperty="${identify.property}">
        insert into
        ${table}
        <trim prefix="(" suffix=")" suffixOverrides=",">
        <#list columnList as column>
            ${column.column}},
            ${column.column},
        </#list>
        </trim>
@@ -56,7 +56,7 @@
    </insert>
    <insert id="insertSelective"
            parameterType="${entity.class}"
            parameterType="${entity.clazz}"
            useGeneratedKeys="true" keyProperty="${identify.property}">
        insert into ${table}
        <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -74,7 +74,7 @@
        </trim>
    </insert>
    <update id="updateByPrimaryKey"
            parameterType="${entity.class}">
            parameterType="${entity.clazz}">
        update ${table}
        <set>
            <if test="${identify.property} != null">${identify.column} = <#noparse>#{</#noparse>${identify.property},jdbcType=${identify.jdbcType}},</if>
@@ -85,7 +85,7 @@
        where ${identify.column} = <#noparse>#{</#noparse>${identify.property},jdbcType=${identify.jdbcType}}
    </update>
    <update id="updateByPrimaryKeySelective"
            parameterType="${entity.class}">
            parameterType="${entity.clazz}">
        update ${table}
        <set>
              <#list columnList as column>
@@ -110,6 +110,18 @@
             <#if query.queryType=="contains">
                and ${query.columnData.column} = '%<#noparse>#{</#noparse>query.${query.columnName}}%'
             </#if>
              <#if query.queryType=="gt">
                and ${query.columnData.column} > <#noparse>#{</#noparse>query.${query.columnName}}
              </#if>
              <#if query.queryType=="gte">
                and ${query.columnData.column} >= <#noparse>#{</#noparse>query.${query.columnName}}
              </#if>
              <#if query.queryType=="lt">
                and ${query.columnData.column} <![CDATA[<]]> <#noparse>#{</#noparse>query.${query.columnName}}
              </#if>
              <#if query.queryType=="lte">
                and ${query.columnData.column} <![CDATA[<=]]> <#noparse>#{</#noparse>query.${query.columnName}}
              </#if>
        </if>
        </#list>
    </sql>