mappers.GenDataObjectMapper.xml Maven / Gradle / Ivy
<?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.lframework.gen.mappers.GenDataObjectMapper"> <resultMap id="DataObjectDto" type="com.lframework.gen.dto.dataobj.DataObjectDto"> <id column="id" property="id"/> <result column="code" property="code"/> <result column="name" property="name"/> <result column="type" property="type"/> <result column="available" property="available"/> <result column="gen_status" property="genStatus"/> <result column="description" property="description"/> <result column="create_by" property="createBy"/> <result column="create_time" property="createTime"/> <result column="update_by" property="updateBy"/> <result column="update_time" property="updateTime"/> </resultMap> <sql id="DataObjectDto_sql"> SELECT o.id, o.code, o.name, o.type, o.available, o.description, o.create_by, o.create_time, o.update_by, o.update_time, o.gen_status FROM gen_data_object AS o </sql> <select id="query" resultMap="DataObjectDto"> <include refid="DataObjectDto_sql"/> <where> <if test="vo != null"> <if test="vo.code != null and vo.code != ''"> AND code = #{vo.code} </if> <if test="vo.name != null and vo.name != ''"> AND name LIKE CONCAT('%', #{vo.name}, '%') </if> <if test="vo.type != null"> AND type = #{vo.type} </if> <if test="vo.available != null"> AND available = #{vo.available} </if> </if> </where> ORDER BY code </select> <select id="getById" resultMap="DataObjectDto"> <include refid="DataObjectDto_sql"/> WHERE id = #{id} </select> </mapper>