| | |
| | | </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> |
| | |
| | | |
| | | </insert> |
| | | <insert id="insertSelective" |
| | | parameterType="${entity.class}" |
| | | parameterType="${entity.clazz}" |
| | | useGeneratedKeys="true" keyProperty="${identify.property}"> |
| | | insert into ${table} |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | |
| | | </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> |
| | |
| | | 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> |
| | |
| | | <#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> |