123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253 |
- <?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.product.dao.CmSecondHandDetailDao">
- <sql id="cmSecondHandDetailColumns">
- a.id AS "id",
- a.productID AS "productID",
- a.sold AS "sold",
- a.secondHandType AS "secondHandType",
- a.instrumentType AS "instrumentType",
- a.fixedYears AS "fixedYears",
- a.maturityYears AS "maturityYears",
- a.companyName AS "companyName",
- a.detailTalkFlag AS "detailTalkFlag",
- a.originalPrice AS "originalPrice",
- a.contactName AS "contactName",
- a.contactMobile AS "contactMobile",
- a.dockingPeopleName AS "dockingPeopleName",
- a.dockingPeopleMobile AS "dockingPeopleMobile",
- a.secondProductType AS "secondProductType",
- a.provinceCityDistrict AS "provinceCityDistrict",
- a.townId as "townId",
- a.address AS "address",
- a.productQuality AS "productQuality",
- a.productDetails AS "productDetails",
- a.viewingNum AS "viewingNum",
- a.brandName AS "brandName",
- a.payStatus AS "payStatus",
- a.payAmount AS "payAmount",
- a.payFormData AS "payFormData",
- a.payType AS "payType",
- a.payDate AS "payDate",
- a.submitDate AS "submitDate",
- a.reviewedDate AS "reviewedDate",
- a.onLineDate AS "onLineDate",
- a.source AS "source",
- a.showContactFlag AS "showContactFlag",
- a.publisher AS "publisher",
- a.authenticationImage AS "authenticationImage",
- a.fileName AS "fileName",
- a.ossName AS "ossName",
- a.commitmentImage AS "commitmentImage",
- p.validFlag AS "validFlag",
- p.productCategory AS "productCategory",
- p.name AS "name",
- p.normalPrice AS "normalPrice",
- p.price1 AS "price1",
- p.stock AS "stock",
- p.brandID AS "brandID",
- p.costPrice as "costPrice",
- p.costCheckFlag AS "costCheckFlag",
- p.costProportional AS "costProportional",
- p.visibility AS "visibility"
- </sql>
- <sql id="cmSecondHandDetailJoins">
- left join product p on p.productID = a.productID
- </sql>
- <select id="get" resultType="CmSecondHandDetail">
- SELECT
- <include refid="cmSecondHandDetailColumns"/>
- FROM cm_second_hand_detail a
- <include refid="cmSecondHandDetailJoins"/>
- WHERE a.productID = #{id}
- </select>
- <select id="findList" resultType="CmSecondHandDetail">
- SELECT
- <include refid="cmSecondHandDetailColumns"/>
- FROM cm_second_hand_detail a
- <include refid="cmSecondHandDetailJoins"/>
- <where>
- <if test="productID != null and productID != ''">
- AND a.productID = #{productID}
- </if>
- </where>
- <choose>
- <when test="page !=null and page.orderBy != null and page.orderBy != ''">
- ORDER BY ${page.orderBy}
- </when>
- <otherwise>
- </otherwise>
- </choose>
- </select>
- <select id="findAllList" resultType="CmSecondHandDetail">
- SELECT
- <include refid="cmSecondHandDetailColumns"/>
- FROM cm_second_hand_detail a
- <include refid="cmSecondHandDetailJoins"/>
- <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="CmSecondHandDetail" keyProperty="id" useGeneratedKeys="true">
- INSERT INTO cm_second_hand_detail(
- productID,
- sold,
- secondHandType,
- instrumentType,
- fixedYears,
- maturityYears,
- companyName,
- detailTalkFlag,
- originalPrice,
- contactName,
- contactMobile,
- dockingPeopleName,
- dockingPeopleMobile,
- secondProductType,
- provinceCityDistrict,
- townId,
- address,
- productQuality,
- productDetails,
- viewingNum,
- brandName,
- payStatus,
- payAmount,
- payFormData,
- payType,
- payDate,
- submitDate,
- reviewedDate,
- onLineDate,
- source,
- showContactFlag,
- publisher,
- authenticationImage,
- fileName,
- ossName,
- commitmentImage
- ) VALUES (
- #{productID},
- #{sold},
- #{secondHandType},
- #{instrumentType},
- #{fixedYears},
- #{maturityYears},
- #{companyName},
- #{detailTalkFlag},
- #{originalPrice},
- #{contactName},
- #{contactMobile},
- #{dockingPeopleName},
- #{dockingPeopleMobile},
- #{secondProductType},
- #{provinceCityDistrict},
- #{townId},
- #{address},
- #{productQuality},
- #{productDetails},
- #{viewingNum},
- #{brandName},
- #{payStatus},
- #{payAmount},
- #{payFormData},
- #{payType},
- #{payDate},
- #{submitDate},
- #{reviewedDate},
- #{onLineDate},
- #{source},
- #{showContactFlag},
- #{publisher},
- #{authenticationImage},
- #{fileName},
- #{ossName},
- #{commitmentImage}
- )
- </insert>
- <update id="update">
- UPDATE cm_second_hand_detail SET
- productID = #{productID},
- sold = #{sold},
- secondHandType = #{secondHandType},
- instrumentType = #{instrumentType},
- fixedYears = #{fixedYears},
- maturityYears = #{maturityYears},
- companyName = #{companyName},
- detailTalkFlag = #{detailTalkFlag},
- originalPrice = #{originalPrice},
- contactName = #{contactName},
- contactMobile = #{contactMobile},
- dockingPeopleName = #{dockingPeopleName},
- dockingPeopleMobile = #{dockingPeopleMobile},
- secondProductType = #{secondProductType},
- provinceCityDistrict = #{provinceCityDistrict},
- townId = #{townId},
- address = #{address},
- productQuality = #{productQuality},
- productDetails = #{productDetails},
- viewingNum = #{viewingNum},
- brandName = #{brandName},
- payStatus = #{payStatus},
- payAmount = #{payAmount},
- payFormData = #{payFormData},
- payType = #{payType},
- payDate = #{payDate},
- submitDate = #{submitDate},
- reviewedDate = #{reviewedDate},
- onLineDate = #{onLineDate},
- source = #{source},
- showContactFlag = #{showContactFlag},
- publisher = #{publisher},
- authenticationImage = #{authenticationImage},
- fileName = #{fileName},
- ossName = #{ossName},
- commitmentImage = #{commitmentImage}
- WHERE productID = #{productID}
- </update>
- <update id="updateRevieweInfo">
- UPDATE cm_second_hand_detail SET
- reviewedDate = #{reviewedDate},
- onLineDate = #{onLineDate}
- WHERE productID = #{productID}
- </update>
- <update id="updateOnLineDate">
- UPDATE cm_second_hand_detail SET
- onLineDate = #{date}
- WHERE productID = #{productID}
- </update>
- <update id="updatSecondHnadproductSold">
- UPDATE cm_second_hand_detail SET sold = 1 where productID = #{productID}
- </update>
- <delete id="delete">
- DELETE FROM cm_second_hand_detail
- WHERE productID = #{productID}
- </delete>
- <update id="updatSecondHnadBySold">
- UPDATE cm_second_hand_detail SET sold = 0 WHERE productID = #{productID}
- </update>
- </mapper>
|