123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- <!DOCTYPE mapper
- PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
- "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.bosshand.virgo.api.workark.dao.InvoiceModelDao">
- <resultMap type="com.bosshand.virgo.api.workark.model.InvoiceModel" id="result">
- <id column="id" property="id"/>
- <result column="organizationId" property="organizationId"/>
- <result column="userId" property="userId"/>
- <result column="type" property="type"/>
- <result column="name" property="name"/>
- <result column="taxpayerIdentificationNumber" property="taxpayerIdentificationNumber"/>
- <result column="address" property="address"/>
- <result column="phone" property="phone"/>
- <result column="bankAccount" property="bankAccount"/>
- <result column="bankAccountNumber" property="bankAccountNumber"/>
- <result column="content" property="content"/>
- </resultMap>
- <select id="get" resultMap="result">
- select * from workark_invoice_model where id = #{id}
- </select>
- <select id="getList" resultMap="result">
- select * from workark_invoice_model
- <where>
- <if test="organizationId != 0">
- and organizationId = #{organizationId}
- </if>
- <if test="userId != 0">
- and userId = #{userId}
- </if>
- <if test="type != null">
- and type = #{type}
- </if>
- <if test="name != null">
- and name = #{name}
- </if>
- <if test="taxpayerIdentificationNumber != null">
- and taxpayerIdentificationNumber = #{taxpayerIdentificationNumber}
- </if>
- <if test="phone != null">
- and phone = #{phone}
- </if>
- <if test="bankAccount != null">
- and bankAccount = #{bankAccount}
- </if>
- <if test="bankAccountNumber != null">
- and bankAccountNumber = #{bankAccountNumber}
- </if>
- </where>
- </select>
- <insert id="save" useGeneratedKeys="true" keyProperty="id">
- INSERT INTO workark_invoice_model (`organizationId`, `userId`, `type`, `name`, `taxpayerIdentificationNumber`, `address`, `phone`, `bankAccount`, `bankAccountNumber`, `content`)
- VALUES (#{organizationId}, #{userId}, #{type}, #{name}, #{taxpayerIdentificationNumber}, #{address}, #{phone}, #{bankAccount}, #{bankAccountNumber}, #{content})
- </insert>
- <update id="update" parameterType="com.bosshand.virgo.api.workark.model.Invoice">
- UPDATE workark_invoice_model
- <trim prefix="set" suffixOverrides=",">
- <if test="organizationId != 0">organizationId = #{organizationId},</if>
- <if test="userId != 0">userId = #{userId},</if>
- <if test="type != null">type = #{type},</if>
- <if test="name != null">name = #{name},</if>
- <if test="taxpayerIdentificationNumber != null">taxpayerIdentificationNumber = #{taxpayerIdentificationNumber},</if>
- <if test="address != null">address = #{address},</if>
- <if test="phone != null">phone = #{phone},</if>
- <if test="bankAccount != null">bankAccount = #{bankAccount},</if>
- <if test="bankAccountNumber != null">bankAccountNumber = #{bankAccountNumber},</if>
- <if test="content != null">content = #{content},</if>
- </trim>
- WHERE id=#{id}
- </update>
- <delete id="delete">
- DELETE FROM workark_invoice_model WHERE id=#{id}
- </delete>
- </mapper>
|