123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102 |
- <?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.caimei.modules.advisory.dao.CmAdvisoryDao">
-
- <sql id="cmAdvisoryColumns">
- a.id AS "id",
- a.name AS "name",
- a.mobile AS "mobile",
- a.commitTime AS "commitTime",
- a.delFlag AS "delFlag"
- </sql>
-
- <sql id="cmAdvisoryJoins">
- </sql>
-
- <select id="get" resultType="CmAdvisory">
- SELECT
- <include refid="cmAdvisoryColumns"/>
- FROM cm_advisory a
- <include refid="cmAdvisoryJoins"/>
- WHERE a.id = #{id}
- </select>
-
- <select id="findList" resultType="CmAdvisory">
- SELECT
- <include refid="cmAdvisoryColumns"/>
- FROM cm_advisory a
- <include refid="cmAdvisoryJoins"/>
- <where>
-
- <if test="name != null and name != ''">
- AND a.name LIKE
- <if test="dbName == 'oracle'">'%'||#{name}||'%'</if>
- <if test="dbName == 'mssql'">'%'+#{name}+'%'</if>
- <if test="dbName == 'mysql'">concat('%',#{name},'%')</if>
- </if>
- <if test="mobile != null and mobile != ''">
- AND a.mobile = #{mobile}
- </if>
- </where>
- <choose>
- <when test="page !=null and page.orderBy != null and page.orderBy != ''">
- ORDER BY ${page.orderBy}
- </when>
- <otherwise>
- ORDER BY a.commitTime DESC
- </otherwise>
- </choose>
- </select>
-
- <select id="findAllList" resultType="CmAdvisory">
- SELECT
- <include refid="cmAdvisoryColumns"/>
- FROM cm_advisory a
- <include refid="cmAdvisoryJoins"/>
- <where>
-
- </where>
- <choose>
- <when test="page !=null and page.orderBy != null and page.orderBy != ''">
- ORDER BY ${page.orderBy}
- </when>
- <otherwise>
- </otherwise>
- </choose>
- </select>
-
- <insert id="insert" parameterType="CmAdvisory" keyProperty="id" useGeneratedKeys="true">
- INSERT INTO cm_advisory(
- id,
- name,
- mobile,
- commitTime,
- delFlag
- ) VALUES (
- #{id},
- #{name},
- #{mobile},
- #{commitTime},
- #{delFlag}
- )
- </insert>
-
- <update id="update">
- UPDATE cm_advisory SET
- name = #{name},
- mobile = #{mobile},
- commitTime = #{commitTime},
- delFlag = #{delFlag}
- WHERE id = #{id}
- </update>
-
- <delete id="delete">
- DELETE FROM cm_advisory
- WHERE id = #{id}
- </delete>
- <select id="findUser" resultType="com.caimei.modules.user.entity.CmUser">
- SELECT * FROM USER WHERE bindMobile = #{mobile} AND validFlag='1'
- </select>
-
- </mapper>
|