123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143 |
- <!DOCTYPE mapper
- PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
- "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-
- <mapper namespace="com.bosshand.virgo.core.dao.MgrOrganizationDao">
- <resultMap type="com.bosshand.virgo.core.model.MgrOrganization" id="MgrOrganizationResult" >
- <id column="id" property="id"/>
- <result column="logo" property="logo"/>
- <result column="name" property="name"/>
- <result column="contact" property="contact"/>
- <result column="contactTel" property="contactTel"/>
- <result column="address" property="address"/>
- <result column="businessLicense" property="businessLicense"/>
- <result column="introduction" property="introduction"/>
- <result column="registerDate" property="registerDate"/>
- <result column="status" property="status"/>
- <result column="organizedDataCenter" property="organizedDataCenter"/>
- <result column="organizationCode" property="organizationCode"/>
- <result column="facilitator" property="facilitator"/>
- <result column="creditNo" property="creditNo"/>
- <result column="legalPerson" property="legalPerson"/>
- <result column="certificationStatus" property="certificationStatus"/>
- </resultMap>
- <select id="getById" resultMap="MgrOrganizationResult">
- select * from mgr_organization where id = #{id}
- </select>
- <select id="listAll" resultMap="MgrOrganizationResult">
- select * from mgr_organization where status = 1
- </select>
- <select id="listByIds" resultMap="MgrOrganizationResult">
- select * from mgr_organization
- <choose>
- <when test="list != null and list.size>0">
- where id in (
- <foreach collection="list" item="item" index="index"
- separator=",">
- #{item}
- </foreach>
- )
- </when>
- <otherwise>
- where 1=0
- </otherwise>
- </choose>
- </select>
- <select id="get" resultMap="MgrOrganizationResult">
- select * from mgr_organization where id = #{id}
- </select>
- <select id="getByOrganizationCode" resultMap="MgrOrganizationResult">
- select * from mgr_organization where organizationCode = #{organizationCode}
- </select>
- <select id="getByOrganizationName" resultMap="MgrOrganizationResult">
- select * from mgr_organization where name like '%${name}%'
- </select>
- <select id="organizationByIds" parameterType="list" resultMap="MgrOrganizationResult">
- select * from mgr_organization where id in (
- <trim>
- <if test="list.size > 0">
- <foreach collection="list" item="item" index="index" separator=",">
- #{item}
- </foreach>
- </if>
- </trim>
- )
- </select>
- <select id="getList" resultMap="MgrOrganizationResult">
- select * from mgr_organization
- <where>
- <trim>
- <if test="name != null and name !=''">name = #{name}</if>
- <if test="registerDate != null and registerDate !=''">registerDate = #{registerDate}</if>
- <if test="status == 0 or status == 1">status = #{status}</if>
- </trim>
- </where>
- order by registerDate desc limit #{currIndex} , #{pageSize}
- </select>
- <select id="getTotalCount" parameterType="map" resultType="Integer">
- SELECT count(*) FROM mgr_organization
- <where>
- <trim>
- <if test="name != null and name !=''">name = #{name}</if>
- <if test="registerDate != null and registerDate !=''">registerDate = #{registerDate}</if>
- <if test="status == 0 or status == 1">status = #{status}</if>
- </trim>
- </where>
- </select>
- <insert id="insert" parameterType="com.bosshand.virgo.core.model.MgrOrganization" useGeneratedKeys="true" keyProperty="id">
- INSERT into mgr_organization(logo, name, contact, contactTel, address, businessLicense, introduction, registerDate, status, organizationCode, facilitator, creditNo, legalPerson)
- values(#{logo}, #{name}, #{contact}, #{contactTel}, #{address}, #{businessLicense}, #{introduction}, now(), #{status}, #{organizationCode}, #{facilitator}, #{creditNo}, #{legalPerson})
- </insert>
- <update id="update" parameterType="com.bosshand.virgo.core.model.MgrOrganization">
- UPDATE mgr_organization
- <trim prefix="set" suffixOverrides=",">
- <if test="id!=null">id=#{id},</if>
- <if test="logo!=null">logo=#{logo},</if>
- <if test="name!=null">name=#{name},</if>
- <if test="contact!=null">contact=#{contact},</if>
- <if test="contactTel!=null">contactTel=#{contactTel},</if>
- <if test="address!=null">address=#{address},</if>
- <if test="businessLicense!=null">businessLicense=#{businessLicense},</if>
- <if test="introduction!=null">introduction=#{introduction},</if>
- <if test="registerDate!=null">registerDate=#{registerDate},</if>
- <if test="organizedDataCenter!=0">organizedDataCenter=#{organizedDataCenter},</if>
- <if test="facilitator!=null">facilitator=#{facilitator},</if>
- <if test="creditNo!=null">creditNo=#{creditNo},</if>
- <if test="legalPerson!=null">legalPerson=#{legalPerson},</if>
- </trim>
- WHERE id=#{id}
- </update>
- <update id="updateStatus" parameterType="com.bosshand.virgo.core.model.MgrOrganization">
- UPDATE mgr_organization
- <trim prefix="set" suffixOverrides=",">
- <if test="status == 0 or status == 1">status=#{status},</if>
- </trim>
- WHERE id=#{id}
- </update>
- <update id="updateCertificationStatus" parameterType="com.bosshand.virgo.core.model.MgrOrganization">
- UPDATE mgr_organization
- <trim prefix="set" suffixOverrides=",">
- <if test="certificationStatus == 0 or certificationStatus == 1">certificationStatus=#{certificationStatus},</if>
- </trim>
- WHERE id=#{id}
- </update>
- <update id="setOrganizedDataCenter" parameterType="com.bosshand.virgo.core.model.MgrOrganization">
- UPDATE mgr_organization set organizedDataCenter = #{organizedDataCenter} WHERE id=#{id}
- </update>
- </mapper>
|